From df077b629b8cff99e85045847c8014a32d776b74 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 7 Jul 2025 23:22:30 +0000 Subject: [PATCH 1/2] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.576.1 --- .speakeasy/gen.lock | 787 +- .speakeasy/gen.yaml | 7 +- .speakeasy/glean-merged-spec.yaml | 26 +- .speakeasy/workflow.lock | 14 +- README.md | 26 +- RELEASES.md | 12 +- USAGE.md | 4 +- build.gradle | 14 +- docs/models/components/Answer.md | 52 +- docs/models/components/AnswerCreationData.md | 28 +- docs/models/components/EditAnswerRequest.md | 34 +- docs/models/components/FeedRequestCategory.md | 1 + docs/models/components/ListEntitiesRequest.md | 3 +- docs/models/components/Message.md | 8 +- docs/models/components/Relation.md | 6 +- docs/models/components/RelationType.md | 13 +- docs/models/components/RequestType.md | 11 + docs/models/components/TimePeriodType.md | 13 +- docs/models/components/TimeRange.md | 9 +- docs/models/components/WarningType.md | 17 +- docs/sdks/activity/README.md | 4 +- docs/sdks/agents/README.md | 22 +- docs/sdks/announcements/README.md | 6 +- docs/sdks/answers/README.md | 10 +- docs/sdks/chat/README.md | 20 +- docs/sdks/clientauthentication/README.md | 2 +- docs/sdks/clientdocuments/README.md | 8 +- docs/sdks/clientshortcuts/README.md | 10 +- docs/sdks/collections/README.md | 16 +- docs/sdks/datasource/README.md | 2 +- docs/sdks/datasources/README.md | 4 +- docs/sdks/entities/README.md | 6 +- docs/sdks/indexingauthentication/README.md | 2 +- docs/sdks/indexingdocuments/README.md | 20 +- docs/sdks/indexingshortcuts/README.md | 4 +- docs/sdks/insights/README.md | 2 +- docs/sdks/messages/README.md | 2 +- docs/sdks/people/README.md | 18 +- docs/sdks/permissions/README.md | 24 +- docs/sdks/pins/README.md | 10 +- docs/sdks/policies/README.md | 10 +- docs/sdks/reports/README.md | 6 +- docs/sdks/search/README.md | 10 +- docs/sdks/tools/README.md | 4 +- docs/sdks/verification/README.md | 6 +- docs/sdks/visibilityoverrides/README.md | 4 +- gradle.properties | 2 +- .../api_client/glean_api_client/Activity.java | 266 +- .../api_client/glean_api_client/Agents.java | 681 +- .../glean_api_client/Announcements.java | 409 +- .../api_client/glean_api_client/Answers.java | 677 +- .../api_client/glean_api_client/Chat.java | 1378 +-- .../api_client/glean_api_client/Client.java | 87 +- .../ClientAuthentication.java | 136 +- .../glean_api_client/ClientDocuments.java | 553 +- .../glean_api_client/ClientShortcuts.java | 678 +- .../glean_api_client/Collections.java | 1123 +-- .../api_client/glean_api_client/Data.java | 12 +- .../glean_api_client/Datasource.java | 138 +- .../glean_api_client/Datasources.java | 275 +- .../api_client/glean_api_client/Entities.java | 291 +- .../api_client/glean_api_client/Glean.java | 19 +- .../glean_api_client/Governance.java | 12 +- .../glean_api_client/GovernanceDocuments.java | 7 +- .../api_client/glean_api_client/Indexing.java | 37 +- .../IndexingAuthentication.java | 136 +- .../glean_api_client/IndexingDocuments.java | 1300 +-- .../glean_api_client/IndexingShortcuts.java | 264 +- .../api_client/glean_api_client/Insights.java | 153 +- .../api_client/glean_api_client/Messages.java | 153 +- .../api_client/glean_api_client/People.java | 1128 +-- .../glean_api_client/Permissions.java | 1483 +-- .../api_client/glean_api_client/Pins.java | 677 +- .../api_client/glean_api_client/Policies.java | 666 +- .../api_client/glean_api_client/Reports.java | 394 +- .../glean_api_client/SDKConfiguration.java | 4 +- .../api_client/glean_api_client/Search.java | 723 +- .../api_client/glean_api_client/Tools.java | 280 +- .../glean_api_client/Verification.java | 413 +- .../glean_api_client/Visibilityoverrides.java | 280 +- .../models/components/Activity.java | 5 +- .../models/components/ActivityEnum.java | 2 +- .../models/components/ActivityEvent.java | 13 +- .../components/ActivityEventAction.java | 2 +- .../components/ActivityEventParams.java | 21 +- .../components/AddCollectionItemsError.java | 5 +- .../AddCollectionItemsErrorErrorType.java | 2 +- .../components/AddCollectionItemsRequest.java | 7 +- .../AddCollectionItemsResponse.java | 7 +- .../components/AdditionalFieldDefinition.java | 7 +- .../models/components/Agent.java | 13 +- .../models/components/AgentCapabilities.java | 9 +- .../models/components/AgentConfig.java | 7 +- .../models/components/AgentEnum.java | 2 +- .../components/AgentExecutionStatus.java | 2 +- .../models/components/AgentMetadata.java | 3 +- .../models/components/AgentRun.java | 13 +- .../models/components/AgentRunCreate.java | 11 +- .../components/AgentRunWaitResponse.java | 7 +- .../models/components/AgentSchemas.java | 9 +- .../models/components/AiAppActionCounts.java | 17 +- .../components/AiAppsInsightsResponse.java | 13 +- .../models/components/AiInsightsResponse.java | 27 +- .../models/components/AllowlistOptions.java | 5 +- .../models/components/Announcement.java | 51 +- .../components/AnnouncementChannel.java | 2 +- .../components/AnnouncementPostType.java | 2 +- .../components/AnnouncementViewerInfo.java | 7 +- .../models/components/AnonymousEvent.java | 7 +- .../components/AnonymousEventEventType.java | 2 +- .../models/components/Answer.java | 83 +- .../models/components/AnswerBoard.java | 29 +- .../models/components/AnswerCreationData.java | 59 +- .../AnswerCreationDataSourceType.java | 2 +- .../models/components/AnswerLike.java | 7 +- .../models/components/AnswerLikes.java | 9 +- .../models/components/AnswerResult.java | 7 +- .../models/components/AnswerSourceType.java | 2 +- .../models/components/AppResult.java | 11 +- .../components/AssistantActivityType.java | 2 +- .../models/components/AuthConfig.java | 23 +- .../models/components/AuthConfigStatus.java | 2 +- .../models/components/AuthConfigType.java | 2 +- .../models/components/AuthToken.java | 15 +- .../models/components/AuthType.java | 2 +- .../models/components/Author.java | 2 +- .../components/AutocompleteRequest.java | 19 +- .../AutocompleteRequestResultType.java | 2 +- .../components/AutocompleteResponse.java | 17 +- .../models/components/AutocompleteResult.java | 25 +- .../components/AutocompleteResultGroup.java | 9 +- .../AutocompleteResultResultType.java | 2 +- .../models/components/Badge.java | 11 +- .../components/BulkIndexDocumentsRequest.java | 17 +- .../components/BulkIndexEmployeesRequest.java | 15 +- .../components/BulkIndexGroupsRequest.java | 17 +- .../BulkIndexMembershipsRequest.java | 17 +- .../components/BulkIndexShortcutsRequest.java | 13 +- .../components/BulkIndexTeamsRequest.java | 13 +- .../components/BulkIndexUsersRequest.java | 17 +- .../components/BulkUploadHistoryEvent.java | 13 +- .../BulkUploadHistoryEventStatus.java | 2 +- .../models/components/CalendarAttendee.java | 13 +- .../models/components/CalendarAttendees.java | 17 +- .../models/components/CalendarEvent.java | 29 +- .../components/CalendarEventEventType.java | 2 +- .../components/CanonicalizingRegexType.java | 7 +- .../components/CategoryToResultSize.java | 5 +- .../models/components/ChannelInviteInfo.java | 13 +- .../models/components/Chat.java | 21 +- .../models/components/ChatFile.java | 11 +- .../components/ChatFileFailureReason.java | 2 +- .../models/components/ChatFileMetadata.java | 13 +- .../models/components/ChatFileStatus.java | 2 +- .../models/components/ChatMessage.java | 23 +- .../components/ChatMessageCitation.java | 13 +- .../components/ChatMessageFragment.java | 15 +- .../models/components/ChatMetadata.java | 19 +- .../models/components/ChatMetadataResult.java | 7 +- .../models/components/ChatRequest.java | 25 +- .../models/components/ChatResponse.java | 13 +- .../components/ChatRestrictionFilters.java | 9 +- .../models/components/ChatResult.java | 7 +- .../ChatZeroStateSuggestionOptions.java | 5 +- .../CheckDocumentAccessRequest.java | 11 +- .../CheckDocumentAccessResponse.java | 5 +- .../models/components/ClusterGroup.java | 9 +- .../models/components/ClusterTypeEnum.java | 2 +- .../models/components/Code.java | 13 +- .../models/components/CodeLine.java | 9 +- .../models/components/Collection.java | 49 +- .../models/components/CollectionError1.java | 5 +- .../models/components/CollectionError2.java | 5 +- .../models/components/CollectionError3.java | 5 +- .../components/CollectionErrorErrorCode.java | 2 +- .../models/components/CollectionItem.java | 29 +- .../components/CollectionItemDescriptor.java | 17 +- .../CollectionItemDescriptorItemType.java | 2 +- .../components/CollectionItemItemType.java | 2 +- .../components/CollectionPinMetadata.java | 7 +- .../components/CollectionPinTarget.java | 9 +- .../CollectionPinnableCategories.java | 2 +- .../components/CollectionPinnableTargets.java | 2 +- .../components/CollectionPinnedMetadata.java | 7 +- .../models/components/CommentDefinition.java | 15 +- .../components/CommunicationChannel.java | 2 +- .../models/components/Company.java | 29 +- .../models/components/ConferenceData.java | 9 +- .../components/ConferenceDataSource.java | 2 +- .../models/components/ConnectorType.java | 2 +- .../models/components/ContentDefinition.java | 9 +- .../components/ContentInsightsResponse.java | 13 +- .../models/components/ContentType.java | 2 +- .../models/components/CountInfo.java | 9 +- .../components/CreateAnnouncementRequest.java | 31 +- .../CreateAnnouncementRequestChannel.java | 2 +- .../CreateAnnouncementRequestPostType.java | 2 +- .../components/CreateAnswerRequest.java | 5 +- .../components/CreateAuthTokenResponse.java | 7 +- .../components/CreateCollectionRequest.java | 25 +- .../components/CreateCollectionResponse.java | 55 +- .../CreateCollectionResponseErrorCode.java | 2 +- .../components/CreateDlpReportRequest.java | 11 +- .../components/CreateDlpReportResponse.java | 5 +- .../components/CreateShortcutRequest.java | 5 +- .../components/CreateShortcutResponse.java | 7 +- .../models/components/CustomDataValue.java | 13 +- .../components/CustomDatasourceConfig.java | 57 +- .../CustomDatasourceConfigConnectorType.java | 2 +- .../models/components/CustomEntity.java | 17 +- .../components/CustomEntityMetadata.java | 5 +- .../models/components/CustomFieldData.java | 9 +- .../models/components/CustomFieldValue.java | 5 +- .../components/CustomFieldValueHyperlink.java | 7 +- .../components/CustomFieldValuePerson.java | 5 +- .../components/CustomFieldValueStr.java | 5 +- .../models/components/CustomProperty.java | 7 +- .../models/components/Customer.java | 23 +- .../models/components/CustomerMetadata.java | 7 +- .../models/components/Datasource.java | 2 +- .../DatasourceBulkMembershipDefinition.java | 7 +- .../models/components/DatasourceCategory.java | 2 +- .../components/DatasourceGroupDefinition.java | 5 +- .../DatasourceMembershipDefinition.java | 9 +- ...atasourceObjectTypeDocumentCountEntry.java | 7 +- .../models/components/DatasourceProfile.java | 13 +- .../components/DatasourceUserDefinition.java | 11 +- .../components/DatasourceVisibility.java | 2 +- .../models/components/DatasourcesType.java | 2 +- ...sourceStatusIdentityResponseComponent.java | 7 +- ...StatusIdentityResponseComponentCounts.java | 5 +- .../DebugDatasourceStatusResponse.java | 9 +- .../DebugDatasourceStatusResponseCounts.java | 7 +- .../components/DebugDocumentRequest.java | 7 +- .../components/DebugDocumentResponse.java | 7 +- .../components/DebugDocumentsRequest.java | 5 +- .../components/DebugDocumentsResponse.java | 5 +- .../DebugDocumentsResponseItem.java | 9 +- .../models/components/DebugUserRequest.java | 5 +- .../models/components/DebugUserResponse.java | 7 +- .../components/DeleteAnnouncementRequest.java | 5 +- .../components/DeleteAnswerRequest.java | 7 +- .../components/DeleteChatFilesRequest.java | 5 +- .../models/components/DeleteChatsRequest.java | 5 +- .../DeleteCollectionItemRequest.java | 9 +- .../DeleteCollectionItemResponse.java | 5 +- .../components/DeleteCollectionRequest.java | 7 +- .../components/DeleteDocumentRequest.java | 11 +- .../components/DeleteEmployeeRequest.java | 7 +- .../models/components/DeleteGroupRequest.java | 9 +- .../components/DeleteMembershipRequest.java | 9 +- .../components/DeleteShortcutRequest.java | 5 +- .../models/components/DeleteTeamRequest.java | 5 +- .../models/components/DeleteUserRequest.java | 9 +- .../models/components/Direction.java | 2 +- .../models/components/Disambiguation.java | 9 +- .../DisplayableListItemUIConfig.java | 5 +- .../models/components/DlpConfig.java | 29 +- .../models/components/DlpFrequency.java | 2 +- .../models/components/DlpPerson.java | 9 +- .../models/components/DlpPersonMetadata.java | 7 +- .../models/components/DlpReport.java | 27 +- .../models/components/DlpReportStatus.java | 2 +- .../models/components/DlpSimpleResult.java | 2 +- .../models/components/DocCategory.java | 2 +- .../models/components/Document.java | 25 +- .../models/components/DocumentContent.java | 5 +- .../models/components/DocumentDefinition.java | 49 +- .../models/components/DocumentInsight.java | 9 +- .../components/DocumentInteractions.java | 15 +- .../DocumentInteractionsDefinition.java | 9 +- .../models/components/DocumentMetadata.java | 83 +- .../models/components/DocumentOrError.java | 5 +- .../components/DocumentOrErrorUnion.java | 5 +- .../DocumentPermissionsDefinition.java | 13 +- .../models/components/DocumentSection.java | 7 +- .../models/components/DocumentSpec1.java | 5 +- .../models/components/DocumentSpec2.java | 5 +- .../models/components/DocumentSpec3.java | 9 +- .../components/DocumentSpecUgcType.java | 2 +- .../models/components/DocumentSpecUnion.java | 5 +- .../components/DocumentStatusResponse.java | 13 +- .../models/components/DocumentVisibility.java | 2 +- .../DocumentVisibilityOverride.java | 7 +- .../DocumentVisibilityOverrideOverride.java | 2 +- .../DocumentVisibilityUpdateResult.java | 9 +- ...ocumentVisibilityUpdateResultOverride.java | 2 +- .../models/components/Documents.java | 9 +- .../models/components/EditAnswerRequest.java | 65 +- .../EditAnswerRequestSourceType.java | 2 +- .../components/EditCollectionItemRequest.java | 13 +- .../EditCollectionItemResponse.java | 5 +- .../components/EditCollectionRequest.java | 25 +- .../components/EditCollectionResponse.java | 55 +- .../EditCollectionResponseErrorCode.java | 2 +- .../models/components/EditPinRequest.java | 9 +- .../components/EmployeeInfoDefinition.java | 57 +- .../models/components/EmployeeTeamInfo.java | 9 +- .../models/components/EntitiesSortOrder.java | 2 +- .../models/components/EntityRelationship.java | 7 +- .../models/components/EntityType.java | 2 +- .../models/components/Error.java | 5 +- .../models/components/ErrorMessage.java | 7 +- .../models/components/Event.java | 2 +- .../components/EventClassification.java | 7 +- .../components/EventClassificationName.java | 2 +- .../models/components/EventStrategyName.java | 2 +- .../components/ExternalSharingOptions.java | 21 +- .../models/components/ExternalShortcut.java | 25 +- .../models/components/ExtractedQnA.java | 9 +- .../models/components/FacetBucket.java | 11 +- .../models/components/FacetBucketFilter.java | 7 +- .../models/components/FacetFilter.java | 9 +- .../models/components/FacetFilterSet.java | 5 +- .../models/components/FacetFilterValue.java | 9 +- .../models/components/FacetResult.java | 13 +- .../models/components/FacetValue.java | 11 +- .../models/components/FavoriteInfo.java | 11 +- .../models/components/FeedEntry.java | 43 +- .../models/components/FeedRequest.java | 11 +- .../components/FeedRequestCategory.java | 3 +- .../models/components/FeedRequestOptions.java | 13 +- .../models/components/FeedResponse.java | 15 +- .../models/components/FeedResult.java | 11 +- .../models/components/FeedResultCategory.java | 2 +- .../models/components/Feedback.java | 43 +- .../models/components/FeedbackCategory.java | 2 +- .../models/components/FeedbackChannel.java | 2 +- .../components/FeedbackChatExchange.java | 15 +- .../models/components/File.java | 7 +- .../models/components/FollowupAction.java | 15 +- .../models/components/Format.java | 2 +- .../components/GeneratedAttachment.java | 15 +- .../GeneratedAttachmentContent.java | 7 +- .../models/components/GeneratedQna.java | 19 +- .../models/components/GeneratedQnaStatus.java | 2 +- .../models/components/GetAnswerError.java | 7 +- .../components/GetAnswerErrorErrorType.java | 2 +- .../models/components/GetAnswerRequest.java | 7 +- .../models/components/GetAnswerResponse.java | 7 +- .../components/GetChatApplicationRequest.java | 5 +- .../GetChatApplicationResponse.java | 5 +- .../components/GetChatFilesRequest.java | 5 +- .../components/GetChatFilesResponse.java | 5 +- .../models/components/GetChatRequest.java | 5 +- .../models/components/GetChatResponse.java | 5 +- .../components/GetCollectionRequest.java | 11 +- .../components/GetCollectionResponse.java | 11 +- .../GetDatasourceConfigRequest.java | 5 +- .../components/GetDlpReportResponse.java | 5 +- .../components/GetDocPermissionsRequest.java | 5 +- .../components/GetDocPermissionsResponse.java | 5 +- .../components/GetDocumentCountRequest.java | 5 +- .../components/GetDocumentCountResponse.java | 5 +- .../components/GetDocumentStatusRequest.java | 9 +- .../components/GetDocumentStatusResponse.java | 11 +- ...etDocumentVisibilityOverridesResponse.java | 5 +- .../GetDocumentsByFacetsRequest.java | 9 +- .../GetDocumentsByFacetsResponse.java | 9 +- .../components/GetDocumentsRequest.java | 7 +- .../GetDocumentsRequestIncludeField.java | 2 +- .../components/GetDocumentsResponse.java | 5 +- .../models/components/GetPinRequest.java | 5 +- .../models/components/GetPinResponse.java | 5 +- .../models/components/GetShortcutRequest.java | 5 +- .../components/GetShortcutRequestUnion.java | 5 +- .../components/GetShortcutResponse.java | 7 +- .../components/GetUserCountRequest.java | 5 +- .../components/GetUserCountResponse.java | 5 +- .../GleanAssistInsightsResponse.java | 13 +- .../models/components/GleanDataError.java | 11 +- .../models/components/GrantPermission.java | 5 +- .../models/components/GrantType.java | 2 +- .../components/GreenlistUsersRequest.java | 7 +- .../models/components/Group.java | 9 +- .../models/components/GroupType.java | 2 +- .../models/components/HideBuiltInFacet.java | 2 +- .../models/components/Hotword.java | 7 +- .../models/components/HotwordProximity.java | 7 +- .../models/components/IconConfig.java | 19 +- .../models/components/IconType.java | 2 +- .../models/components/IdType.java | 2 +- .../models/components/Identity.java | 11 +- .../models/components/IncludeType.java | 2 +- .../components/IndexDocumentRequest.java | 7 +- .../components/IndexDocumentsRequest.java | 9 +- .../components/IndexEmployeeRequest.java | 7 +- .../models/components/IndexGroupRequest.java | 9 +- .../components/IndexMembershipRequest.java | 9 +- .../models/components/IndexStatus.java | 7 +- .../models/components/IndexTeamRequest.java | 7 +- .../models/components/IndexUserRequest.java | 9 +- .../models/components/IndexingShortcut.java | 21 +- .../models/components/InputOptions.java | 15 +- .../models/components/InputSchema.java | 3 +- .../InsightsAgentsRequestOptions.java | 5 +- .../InsightsAiAppRequestOptions.java | 5 +- .../models/components/InsightsRequest.java | 17 +- .../components/InsightsRequestCategory.java | 2 +- .../models/components/InsightsResponse.java | 29 +- .../components/InvalidOperatorValueError.java | 7 +- .../models/components/InviteInfo.java | 13 +- .../models/components/Issue.java | 2 +- .../models/components/JustificationType.java | 2 +- .../models/components/KnowledgeType.java | 2 +- .../models/components/LabeledCountInfo.java | 7 +- .../models/components/LastScanStatus.java | 2 +- .../components/LikelihoodThreshold.java | 2 +- .../models/components/ListAnswersRequest.java | 5 +- .../components/ListAnswersResponse.java | 5 +- .../models/components/ListChatsResponse.java | 5 +- .../components/ListCollectionsRequest.java | 9 +- .../components/ListCollectionsResponse.java | 5 +- .../components/ListDlpReportsResponse.java | 5 +- .../components/ListEntitiesRequest.java | 101 +- .../ListEntitiesRequestEntityType.java | 2 +- .../ListEntitiesRequestIncludeField.java | 2 +- .../components/ListEntitiesResponse.java | 21 +- .../models/components/ListPinsResponse.java | 5 +- .../ListShortcutsPaginatedRequest.java | 15 +- ...ShortcutsPaginatedRequestIncludeField.java | 2 +- .../ListShortcutsPaginatedResponse.java | 9 +- .../models/components/ManualFeedbackInfo.java | 37 +- .../components/ManualFeedbackInfoSource.java | 2 +- .../models/components/Meeting.java | 17 +- .../models/components/Message.java | 7 +- .../models/components/MessageTextBlock.java | 7 +- .../models/components/MessageType.java | 2 +- .../models/components/MessagesRequest.java | 19 +- .../models/components/MessagesResponse.java | 9 +- .../models/components/Mode.java | 2 +- .../models/components/ObjectDefinition.java | 15 +- .../models/components/ObjectPermissions.java | 5 +- .../models/components/OperatorMetadata.java | 17 +- .../models/components/OperatorScope.java | 7 +- .../models/components/OperatorType.java | 2 +- .../models/components/OrderBy.java | 2 +- .../models/components/OutputSchema.java | 3 +- .../models/components/PeopleRequest.java | 15 +- .../components/PeopleRequestIncludeField.java | 2 +- .../models/components/PeopleResponse.java | 9 +- .../models/components/Period.java | 11 +- .../models/components/Permissions.java | 19 +- ...ermissionsGroupIntersectionDefinition.java | 5 +- .../models/components/Person.java | 11 +- .../models/components/PersonDistance.java | 9 +- .../models/components/PersonMetadata.java | 91 +- .../models/components/PersonMetadataType.java | 2 +- .../models/components/PersonObject.java | 7 +- .../models/components/PersonTeam.java | 13 +- .../components/PersonTeamRelationship.java | 2 +- .../components/PersonToTeamRelationship.java | 11 +- .../PersonToTeamRelationshipRelationship.java | 2 +- .../models/components/PinDocument.java | 19 +- .../models/components/PinRequest.java | 9 +- .../models/components/PossibleValue.java | 7 +- .../ProcessAllDocumentsRequest.java | 5 +- .../ProcessAllMembershipsRequest.java | 5 +- .../components/ProcessingHistoryEvent.java | 7 +- .../models/components/ProcessingState.java | 2 +- .../models/components/Prominence.java | 2 +- .../models/components/PromptTemplate.java | 29 +- .../components/PromptTemplateResult.java | 11 +- .../models/components/PropertyDefinition.java | 21 +- .../models/components/PropertyGroup.java | 7 +- .../models/components/PropertyType.java | 2 +- .../models/components/Provider.java | 2 +- .../models/components/QueryInsight.java | 15 +- .../components/QueryInsightsResponse.java | 13 +- .../models/components/QuerySuggestion.java | 19 +- .../components/QuerySuggestionList.java | 7 +- .../models/components/Quicklink.java | 15 +- .../models/components/Reaction.java | 11 +- .../models/components/ReadPermission.java | 5 +- .../components/RecommendationsRequest.java | 19 +- .../RecommendationsRequestOptions.java | 13 +- .../models/components/ReferenceRange.java | 7 +- .../models/components/RelatedDocuments.java | 13 +- .../models/components/RelatedObject.java | 7 +- .../models/components/RelatedObjectEdge.java | 5 +- .../components/RelatedObjectMetadata.java | 5 +- .../models/components/RelatedQuestion.java | 9 +- .../models/components/Relation.java | 8 +- .../models/components/RelationType.java | 5 +- .../models/components/Reminder.java | 13 +- .../models/components/ReminderRequest.java | 11 +- .../components/ReportStatusResponse.java | 7 +- .../ReportStatusResponseStatus.java | 2 +- .../models/components/RequestType.java | 40 + .../models/components/ResponseHint.java | 2 +- .../models/components/ResponseStatus.java | 2 +- .../models/components/RestrictionFilters.java | 5 +- .../models/components/ResultDocument.java | 7 +- .../models/components/ResultTab.java | 11 +- .../models/components/ResultsDescription.java | 7 +- .../models/components/ResultsResponse.java | 19 +- .../models/components/Role.java | 2 +- .../components/RotateTokenResponse.java | 9 +- .../models/components/Scope.java | 2 +- .../models/components/ScopeType.java | 2 +- .../components/SearchAgentsRequest.java | 5 +- .../components/SearchAgentsResponse.java | 5 +- .../models/components/SearchProviderInfo.java | 9 +- .../models/components/SearchRequest.java | 31 +- .../components/SearchRequestInputDetails.java | 5 +- .../components/SearchRequestOptions.java | 37 +- .../models/components/SearchResponse.java | 37 +- .../components/SearchResponseMetadata.java | 27 +- .../models/components/SearchResult.java | 45 +- .../SearchResultProminenceEnum.java | 2 +- .../components/SearchResultSnippet.java | 15 +- .../models/components/SearchWarning.java | 11 +- .../models/components/Security.java | 5 +- .../models/components/SeenFeedbackInfo.java | 5 +- .../components/SensitiveContentOptions.java | 9 +- .../components/SensitiveExpression.java | 7 +- .../models/components/SensitiveInfoType.java | 7 +- .../models/components/SessionInfo.java | 11 +- .../models/components/Share.java | 9 +- .../models/components/SharingOptions.java | 19 +- .../models/components/Shortcut.java | 47 +- .../models/components/ShortcutError.java | 5 +- .../components/ShortcutErrorErrorType.java | 2 +- .../models/components/ShortcutInsight.java | 9 +- .../components/ShortcutInsightsResponse.java | 11 +- .../components/ShortcutMutableProperties.java | 19 +- .../ShortcutsPaginationMetadata.java | 9 +- .../models/components/SocialNetwork.java | 9 +- .../components/SocialNetworkDefinition.java | 9 +- .../models/components/SortOptions.java | 7 +- .../models/components/State.java | 2 +- .../models/components/StructuredLink.java | 9 +- .../models/components/StructuredLocation.java | 21 +- .../models/components/StructuredResult.java | 45 +- .../components/StructuredResultSource.java | 2 +- .../models/components/StructuredText.java | 7 +- .../models/components/StructuredTextItem.java | 11 +- .../StructuredTextMutableProperties.java | 5 +- .../models/components/SummarizeRequest.java | 13 +- .../models/components/SummarizeResponse.java | 9 +- .../models/components/Summary.java | 7 +- .../models/components/Team.java | 45 +- .../models/components/TeamEmail.java | 7 +- .../models/components/TeamInfoDefinition.java | 25 +- .../models/components/TeamMember.java | 9 +- .../models/components/TeamStatus.java | 2 +- .../models/components/TextRange.java | 13 +- .../models/components/TextRangeType.java | 2 +- .../models/components/Thumbnail.java | 7 +- .../models/components/TimeInterval.java | 7 +- .../models/components/TimePeriodType.java | 5 +- .../models/components/TimePoint.java | 7 +- .../models/components/TimeRange.java | 78 +- .../models/components/Tool.java | 13 +- .../models/components/ToolInfo.java | 7 +- .../models/components/ToolMetadata.java | 39 +- .../models/components/ToolMetadataType.java | 2 +- .../models/components/ToolParameter.java | 17 +- .../models/components/ToolParameterType.java | 2 +- .../models/components/ToolType.java | 2 +- .../models/components/ToolsCallParameter.java | 11 +- .../models/components/ToolsCallRequest.java | 7 +- .../models/components/ToolsCallResponse.java | 7 +- .../models/components/ToolsListResponse.java | 5 +- .../models/components/UgcType.java | 2 +- .../models/components/UiConfig.java | 7 +- .../models/components/UiOptions.java | 2 +- .../models/components/Unpin.java | 5 +- .../components/UpdateAnnouncementRequest.java | 33 +- .../UpdateAnnouncementRequestChannel.java | 2 +- .../UpdateAnnouncementRequestPostType.java | 2 +- .../components/UpdateDlpConfigRequest.java | 7 +- .../components/UpdateDlpConfigResponse.java | 7 +- .../components/UpdateDlpReportRequest.java | 13 +- .../components/UpdateDlpReportResponse.java | 5 +- ...ateDocumentVisibilityOverridesRequest.java | 5 +- ...teDocumentVisibilityOverridesResponse.java | 5 +- .../components/UpdatePermissionsRequest.java | 13 +- .../components/UpdateShortcutRequest.java | 21 +- .../components/UpdateShortcutResponse.java | 7 +- .../components/UploadChatFilesRequest.java | 5 +- .../components/UploadChatFilesResponse.java | 5 +- .../components/UploadShortcutsRequest.java | 13 +- .../models/components/UploadStatusEnum.java | 2 +- .../models/components/User.java | 7 +- .../models/components/UserActivity.java | 11 +- .../models/components/UserActivityAction.java | 2 +- .../components/UserActivityInsight.java | 13 +- .../components/UserGeneratedContentId.java | 5 +- .../components/UserInsightsResponse.java | 15 +- .../components/UserReferenceDefinition.java | 9 +- .../models/components/UserRole.java | 2 +- .../components/UserRoleSpecification.java | 11 +- .../models/components/UserStatusResponse.java | 9 +- .../models/components/UserViewInfo.java | 9 +- .../models/components/Value.java | 3 +- .../models/components/Verification.java | 7 +- .../models/components/VerificationFeed.java | 5 +- .../components/VerificationMetadata.java | 19 +- .../models/components/VerifyRequest.java | 7 +- .../components/VerifyRequestAction.java | 2 +- .../models/components/ViewerInfo.java | 7 +- .../models/components/Vote.java | 2 +- .../models/components/WarningType.java | 5 +- .../models/components/Workflow.java | 17 +- .../components/WorkflowFeedbackInfo.java | 5 +- .../WorkflowFeedbackInfoSource.java | 2 +- .../models/components/WorkflowResult.java | 5 +- .../components/WriteActionParameter.java | 15 +- .../components/WriteActionParameterType.java | 2 +- .../models/components/WriteActionType.java | 2 +- .../models/components/WritePermission.java | 11 +- .../models/errors/APIException.java | 8 +- .../models/errors/CollectionError.java | 6 +- .../models/errors/ErrorCode.java | 2 +- .../models/errors/GleanDataError.java | 12 +- .../operations/ActivityRequestBuilder.java | 16 +- .../models/operations/ActivityResponse.java | 9 +- .../AddcollectionitemsRequestBuilder.java | 16 +- .../AddcollectionitemsResponse.java | 11 +- ...AddverificationreminderRequestBuilder.java | 16 +- .../AddverificationreminderResponse.java | 11 +- .../operations/AdminsearchRequestBuilder.java | 16 +- .../operations/AdminsearchResponse.java | 11 +- .../AutocompleteRequestBuilder.java | 16 +- .../operations/AutocompleteResponse.java | 11 +- .../models/operations/ChatRequest.java | 7 +- .../models/operations/ChatRequestBuilder.java | 27 +- .../models/operations/ChatResponse.java | 11 +- .../models/operations/ChatStreamRequest.java | 7 +- .../operations/ChatStreamRequestBuilder.java | 27 +- .../models/operations/ChatStreamResponse.java | 11 +- .../CreateAndStreamRunRequestBuilder.java | 16 +- .../CreateAndStreamRunResponse.java | 11 +- .../CreateAndWaitRunRequestBuilder.java | 16 +- .../operations/CreateAndWaitRunResponse.java | 11 +- .../CreateannouncementRequestBuilder.java | 16 +- .../CreateannouncementResponse.java | 11 +- .../CreateanswerRequestBuilder.java | 16 +- .../operations/CreateanswerResponse.java | 11 +- .../CreateauthtokenRequestBuilder.java | 15 +- .../operations/CreateauthtokenResponse.java | 11 +- .../CreatecollectionRequestBuilder.java | 16 +- .../operations/CreatecollectionResponse.java | 11 +- .../CreatepolicyRequestBuilder.java | 16 +- .../operations/CreatepolicyResponse.java | 11 +- .../CreatereportRequestBuilder.java | 16 +- .../operations/CreatereportResponse.java | 11 +- .../CreateshortcutRequestBuilder.java | 16 +- .../operations/CreateshortcutResponse.java | 11 +- .../operations/DeleteallchatsRequest.java | 5 +- .../DeleteallchatsRequestBuilder.java | 25 +- .../operations/DeleteallchatsResponse.java | 9 +- .../DeleteannouncementRequestBuilder.java | 16 +- .../DeleteannouncementResponse.java | 9 +- .../DeleteanswerRequestBuilder.java | 16 +- .../operations/DeleteanswerResponse.java | 9 +- .../operations/DeletechatfilesRequest.java | 7 +- .../DeletechatfilesRequestBuilder.java | 27 +- .../operations/DeletechatfilesResponse.java | 9 +- .../models/operations/DeletechatsRequest.java | 7 +- .../operations/DeletechatsRequestBuilder.java | 27 +- .../operations/DeletechatsResponse.java | 9 +- .../DeletecollectionRequestBuilder.java | 16 +- .../operations/DeletecollectionResponse.java | 9 +- .../DeletecollectionitemRequestBuilder.java | 16 +- .../DeletecollectionitemResponse.java | 11 +- .../DeleteshortcutRequestBuilder.java | 16 +- .../operations/DeleteshortcutResponse.java | 9 +- .../operations/DownloadpolicycsvRequest.java | 5 +- .../DownloadpolicycsvRequestBuilder.java | 25 +- .../operations/DownloadpolicycsvResponse.java | 11 +- .../operations/DownloadreportcsvRequest.java | 5 +- .../DownloadreportcsvRequestBuilder.java | 25 +- .../operations/DownloadreportcsvResponse.java | 11 +- .../operations/EditanswerRequestBuilder.java | 16 +- .../models/operations/EditanswerResponse.java | 11 +- .../EditcollectionRequestBuilder.java | 16 +- .../operations/EditcollectionResponse.java | 11 +- .../EditcollectionitemRequestBuilder.java | 16 +- .../EditcollectionitemResponse.java | 11 +- .../operations/EditpinRequestBuilder.java | 16 +- .../models/operations/EditpinResponse.java | 11 +- .../models/operations/FeedRequestBuilder.java | 16 +- .../models/operations/FeedResponse.java | 11 +- .../models/operations/FeedbackRequest.java | 7 +- .../operations/FeedbackRequestBuilder.java | 27 +- .../models/operations/FeedbackResponse.java | 9 +- .../models/operations/GetAgentRequest.java | 7 +- .../operations/GetAgentRequestBuilder.java | 27 +- .../models/operations/GetAgentResponse.java | 11 +- .../operations/GetAgentSchemasRequest.java | 7 +- .../GetAgentSchemasRequestBuilder.java | 27 +- .../operations/GetAgentSchemasResponse.java | 11 +- .../GetRestApiV1ToolsListRequest.java | 5 +- .../GetRestApiV1ToolsListRequestBuilder.java | 25 +- .../GetRestApiV1ToolsListResponse.java | 11 +- .../operations/GetanswerRequestBuilder.java | 16 +- .../models/operations/GetanswerResponse.java | 11 +- .../models/operations/GetchatRequest.java | 7 +- .../operations/GetchatRequestBuilder.java | 27 +- .../models/operations/GetchatResponse.java | 11 +- .../operations/GetchatapplicationRequest.java | 7 +- .../GetchatapplicationRequestBuilder.java | 27 +- .../GetchatapplicationResponse.java | 11 +- .../operations/GetchatfilesRequest.java | 7 +- .../GetchatfilesRequestBuilder.java | 27 +- .../operations/GetchatfilesResponse.java | 11 +- .../GetcollectionRequestBuilder.java | 16 +- .../operations/GetcollectionResponse.java | 11 +- .../GetdocpermissionsRequestBuilder.java | 16 +- .../operations/GetdocpermissionsResponse.java | 11 +- .../GetdocumentsRequestBuilder.java | 16 +- .../operations/GetdocumentsResponse.java | 11 +- .../GetdocumentsbyfacetsRequestBuilder.java | 16 +- .../GetdocumentsbyfacetsResponse.java | 11 +- .../operations/GetdocvisibilityRequest.java | 5 +- .../GetdocvisibilityRequestBuilder.java | 25 +- .../operations/GetdocvisibilityResponse.java | 11 +- .../operations/GetpinRequestBuilder.java | 16 +- .../models/operations/GetpinResponse.java | 11 +- .../models/operations/GetpolicyRequest.java | 7 +- .../operations/GetpolicyRequestBuilder.java | 27 +- .../models/operations/GetpolicyResponse.java | 11 +- .../operations/GetreportstatusRequest.java | 5 +- .../GetreportstatusRequestBuilder.java | 25 +- .../operations/GetreportstatusResponse.java | 11 +- .../operations/GetshortcutRequestBuilder.java | 16 +- .../operations/GetshortcutResponse.java | 11 +- .../operations/InsightsRequestBuilder.java | 16 +- .../models/operations/InsightsResponse.java | 11 +- .../operations/ListanswersRequestBuilder.java | 16 +- .../operations/ListanswersResponse.java | 11 +- .../models/operations/ListchatsRequest.java | 5 +- .../operations/ListchatsRequestBuilder.java | 25 +- .../models/operations/ListchatsResponse.java | 11 +- .../ListcollectionsRequestBuilder.java | 16 +- .../operations/ListcollectionsResponse.java | 11 +- .../ListentitiesRequestBuilder.java | 16 +- .../operations/ListentitiesResponse.java | 11 +- .../models/operations/ListpinsRequest.java | 3 +- .../operations/ListpinsRequestBuilder.java | 16 +- .../models/operations/ListpinsResponse.java | 11 +- .../operations/ListpoliciesRequest.java | 7 +- .../ListpoliciesRequestBuilder.java | 27 +- .../operations/ListpoliciesResponse.java | 11 +- .../ListshortcutsRequestBuilder.java | 16 +- .../operations/ListshortcutsResponse.java | 11 +- .../operations/ListverificationsRequest.java | 5 +- .../ListverificationsRequestBuilder.java | 25 +- .../operations/ListverificationsResponse.java | 11 +- .../operations/MessagesRequestBuilder.java | 16 +- .../models/operations/MessagesResponse.java | 11 +- .../operations/PeopleRequestBuilder.java | 16 +- .../models/operations/PeopleResponse.java | 11 +- .../models/operations/PinRequestBuilder.java | 16 +- .../models/operations/PinResponse.java | 11 +- ...ApiIndexV1AdddatasourceRequestBuilder.java | 16 +- .../PostApiIndexV1AdddatasourceResponse.java | 9 +- ...PostApiIndexV1BetausersRequestBuilder.java | 16 +- .../PostApiIndexV1BetausersResponse.java | 9 +- ...dexV1BulkindexdocumentsRequestBuilder.java | 16 +- ...tApiIndexV1BulkindexdocumentsResponse.java | 9 +- ...dexV1BulkindexemployeesRequestBuilder.java | 16 +- ...tApiIndexV1BulkindexemployeesResponse.java | 9 +- ...iIndexV1BulkindexgroupsRequestBuilder.java | 16 +- ...PostApiIndexV1BulkindexgroupsResponse.java | 9 +- ...xV1BulkindexmembershipsRequestBuilder.java | 16 +- ...piIndexV1BulkindexmembershipsResponse.java | 9 +- ...dexV1BulkindexshortcutsRequestBuilder.java | 16 +- ...tApiIndexV1BulkindexshortcutsResponse.java | 9 +- ...piIndexV1BulkindexteamsRequestBuilder.java | 16 +- .../PostApiIndexV1BulkindexteamsResponse.java | 9 +- ...piIndexV1BulkindexusersRequestBuilder.java | 16 +- .../PostApiIndexV1BulkindexusersResponse.java | 9 +- ...exV1CheckdocumentaccessRequestBuilder.java | 16 +- ...ApiIndexV1CheckdocumentaccessResponse.java | 11 +- ...IndexV1DebugDatasourceDocumentRequest.java | 7 +- ...DebugDatasourceDocumentRequestBuilder.java | 27 +- ...ndexV1DebugDatasourceDocumentResponse.java | 11 +- ...ndexV1DebugDatasourceDocumentsRequest.java | 7 +- ...ebugDatasourceDocumentsRequestBuilder.java | 27 +- ...dexV1DebugDatasourceDocumentsResponse.java | 11 +- ...piIndexV1DebugDatasourceStatusRequest.java | 5 +- ...V1DebugDatasourceStatusRequestBuilder.java | 25 +- ...iIndexV1DebugDatasourceStatusResponse.java | 11 +- ...tApiIndexV1DebugDatasourceUserRequest.java | 7 +- ...exV1DebugDatasourceUserRequestBuilder.java | 27 +- ...ApiIndexV1DebugDatasourceUserResponse.java | 11 +- ...piIndexV1DeletedocumentRequestBuilder.java | 16 +- .../PostApiIndexV1DeletedocumentResponse.java | 9 +- ...piIndexV1DeleteemployeeRequestBuilder.java | 16 +- .../PostApiIndexV1DeleteemployeeResponse.java | 9 +- ...stApiIndexV1DeletegroupRequestBuilder.java | 16 +- .../PostApiIndexV1DeletegroupResponse.java | 9 +- ...IndexV1DeletemembershipRequestBuilder.java | 16 +- ...ostApiIndexV1DeletemembershipResponse.java | 9 +- ...ostApiIndexV1DeleteteamRequestBuilder.java | 16 +- .../PostApiIndexV1DeleteteamResponse.java | 9 +- ...ostApiIndexV1DeleteuserRequestBuilder.java | 16 +- .../PostApiIndexV1DeleteuserResponse.java | 9 +- ...exV1GetdatasourceconfigRequestBuilder.java | 16 +- ...ApiIndexV1GetdatasourceconfigResponse.java | 11 +- ...IndexV1GetdocumentcountRequestBuilder.java | 16 +- ...ostApiIndexV1GetdocumentcountResponse.java | 11 +- ...ndexV1GetdocumentstatusRequestBuilder.java | 16 +- ...stApiIndexV1GetdocumentstatusResponse.java | 11 +- ...tApiIndexV1GetusercountRequestBuilder.java | 16 +- .../PostApiIndexV1GetusercountResponse.java | 11 +- ...ApiIndexV1IndexdocumentRequestBuilder.java | 16 +- .../PostApiIndexV1IndexdocumentResponse.java | 9 +- ...piIndexV1IndexdocumentsRequestBuilder.java | 16 +- .../PostApiIndexV1IndexdocumentsResponse.java | 9 +- ...ApiIndexV1IndexemployeeRequestBuilder.java | 16 +- .../PostApiIndexV1IndexemployeeResponse.java | 9 +- ...ostApiIndexV1IndexgroupRequestBuilder.java | 16 +- .../PostApiIndexV1IndexgroupResponse.java | 9 +- ...iIndexV1IndexmembershipRequestBuilder.java | 16 +- ...PostApiIndexV1IndexmembershipResponse.java | 9 +- ...PostApiIndexV1IndexteamRequestBuilder.java | 16 +- .../PostApiIndexV1IndexteamResponse.java | 9 +- ...PostApiIndexV1IndexuserRequestBuilder.java | 16 +- .../PostApiIndexV1IndexuserResponse.java | 9 +- ...exV1ProcessalldocumentsRequestBuilder.java | 16 +- ...ApiIndexV1ProcessalldocumentsResponse.java | 9 +- ...essallemployeesandteamsRequestBuilder.java | 15 +- ...V1ProcessallemployeesandteamsResponse.java | 9 +- ...V1ProcessallmembershipsRequestBuilder.java | 16 +- ...iIndexV1ProcessallmembershipsResponse.java | 9 +- ...stApiIndexV1RotatetokenRequestBuilder.java | 15 +- .../PostApiIndexV1RotatetokenResponse.java | 11 +- ...ndexV1UpdatepermissionsRequestBuilder.java | 16 +- ...stApiIndexV1UpdatepermissionsResponse.java | 9 +- ...iIndexV1UploadshortcutsRequestBuilder.java | 16 +- ...PostApiIndexV1UploadshortcutsResponse.java | 9 +- .../PostRestApiV1ToolsCallRequestBuilder.java | 16 +- .../PostRestApiV1ToolsCallResponse.java | 11 +- .../RecommendationsRequestBuilder.java | 16 +- .../operations/RecommendationsResponse.java | 11 +- .../operations/SDKMethodInterfaces.java | 662 -- .../SearchAgentsRequestBuilder.java | 16 +- .../operations/SearchAgentsResponse.java | 11 +- .../operations/SearchRequestBuilder.java | 16 +- .../models/operations/SearchResponse.java | 11 +- .../SetdocvisibilityRequestBuilder.java | 16 +- .../operations/SetdocvisibilityResponse.java | 11 +- .../operations/SummarizeRequestBuilder.java | 16 +- .../models/operations/SummarizeResponse.java | 11 +- .../operations/UnpinRequestBuilder.java | 16 +- .../models/operations/UnpinResponse.java | 9 +- .../UpdateannouncementRequestBuilder.java | 16 +- .../UpdateannouncementResponse.java | 11 +- .../operations/UpdatepolicyRequest.java | 7 +- .../UpdatepolicyRequestBuilder.java | 27 +- .../operations/UpdatepolicyResponse.java | 11 +- .../UpdateshortcutRequestBuilder.java | 16 +- .../operations/UpdateshortcutResponse.java | 11 +- .../operations/UploadchatfilesRequest.java | 7 +- .../UploadchatfilesRequestBuilder.java | 27 +- .../operations/UploadchatfilesResponse.java | 11 +- .../operations/VerifyRequestBuilder.java | 16 +- .../models/operations/VerifyResponse.java | 11 +- .../operations/ActivityOperation.java | 161 + .../AddcollectionitemsOperation.java | 174 + .../AddverificationreminderOperation.java | 174 + .../operations/AdminsearchOperation.java | 190 + .../operations/AutocompleteOperation.java | 173 + .../operations/ChatOperation.java | 178 + .../operations/ChatStreamOperation.java | 175 + .../CreateAndStreamRunOperation.java | 170 + .../operations/CreateAndWaitRunOperation.java | 174 + .../CreateannouncementOperation.java | 174 + .../operations/CreateanswerOperation.java | 174 + .../operations/CreateauthtokenOperation.java | 157 + .../operations/CreatecollectionOperation.java | 190 + .../operations/CreatepolicyOperation.java | 174 + .../operations/CreatereportOperation.java | 174 + .../operations/CreateshortcutOperation.java | 174 + .../operations/DeleteallchatsOperation.java | 149 + .../DeleteannouncementOperation.java | 161 + .../operations/DeleteanswerOperation.java | 161 + .../operations/DeletechatfilesOperation.java | 166 + .../operations/DeletechatsOperation.java | 166 + .../operations/DeletecollectionOperation.java | 177 + .../DeletecollectionitemOperation.java | 174 + .../operations/DeleteshortcutOperation.java | 161 + .../DownloadpolicycsvOperation.java | 155 + .../DownloadreportcsvOperation.java | 155 + .../operations/EditanswerOperation.java | 174 + .../operations/EditcollectionOperation.java | 190 + .../EditcollectionitemOperation.java | 174 + .../operations/EditpinOperation.java | 174 + .../operations/FeedOperation.java | 173 + .../operations/FeedbackOperation.java | 163 + .../operations/GetAgentOperation.java | 165 + .../operations/GetAgentSchemasOperation.java | 165 + .../GetRestApiV1ToolsListOperation.java | 163 + .../operations/GetanswerOperation.java | 174 + .../operations/GetchatOperation.java | 179 + .../GetchatapplicationOperation.java | 179 + .../operations/GetchatfilesOperation.java | 179 + .../operations/GetcollectionOperation.java | 174 + .../GetdocpermissionsOperation.java | 174 + .../operations/GetdocumentsOperation.java | 171 + .../GetdocumentsbyfacetsOperation.java | 171 + .../operations/GetdocvisibilityOperation.java | 163 + .../operations/GetpinOperation.java | 174 + .../operations/GetpolicyOperation.java | 165 + .../operations/GetreportstatusOperation.java | 160 + .../operations/GetshortcutOperation.java | 174 + .../operations/InsightsOperation.java | 173 + .../operations/ListanswersOperation.java | 174 + .../operations/ListchatsOperation.java | 163 + .../operations/ListcollectionsOperation.java | 174 + .../operations/ListentitiesOperation.java | 174 + .../operations/ListpinsOperation.java | 174 + .../operations/ListpoliciesOperation.java | 163 + .../operations/ListshortcutsOperation.java | 174 + .../ListverificationsOperation.java | 163 + .../operations/MessagesOperation.java | 173 + .../operations/Operations.java | 32 + .../operations/PeopleOperation.java | 173 + .../operations/PinOperation.java | 174 + .../PostApiIndexV1AdddatasourceOperation.java | 161 + .../PostApiIndexV1BetausersOperation.java | 161 + ...ApiIndexV1BulkindexdocumentsOperation.java | 161 + ...ApiIndexV1BulkindexemployeesOperation.java | 161 + ...ostApiIndexV1BulkindexgroupsOperation.java | 161 + ...iIndexV1BulkindexmembershipsOperation.java | 161 + ...ApiIndexV1BulkindexshortcutsOperation.java | 161 + ...PostApiIndexV1BulkindexteamsOperation.java | 161 + ...PostApiIndexV1BulkindexusersOperation.java | 161 + ...piIndexV1CheckdocumentaccessOperation.java | 174 + ...dexV1DebugDatasourceDocumentOperation.java | 176 + ...exV1DebugDatasourceDocumentsOperation.java | 176 + ...IndexV1DebugDatasourceStatusOperation.java | 160 + ...piIndexV1DebugDatasourceUserOperation.java | 176 + ...PostApiIndexV1DeletedocumentOperation.java | 161 + ...PostApiIndexV1DeleteemployeeOperation.java | 161 + .../PostApiIndexV1DeletegroupOperation.java | 161 + ...stApiIndexV1DeletemembershipOperation.java | 161 + .../PostApiIndexV1DeleteteamOperation.java | 161 + .../PostApiIndexV1DeleteuserOperation.java | 161 + ...piIndexV1GetdatasourceconfigOperation.java | 174 + ...stApiIndexV1GetdocumentcountOperation.java | 174 + ...tApiIndexV1GetdocumentstatusOperation.java | 174 + .../PostApiIndexV1GetusercountOperation.java | 174 + .../PostApiIndexV1IndexdocumentOperation.java | 161 + ...PostApiIndexV1IndexdocumentsOperation.java | 161 + .../PostApiIndexV1IndexemployeeOperation.java | 161 + .../PostApiIndexV1IndexgroupOperation.java | 161 + ...ostApiIndexV1IndexmembershipOperation.java | 161 + .../PostApiIndexV1IndexteamOperation.java | 161 + .../PostApiIndexV1IndexuserOperation.java | 161 + ...piIndexV1ProcessalldocumentsOperation.java | 158 + ...1ProcessallemployeesandteamsOperation.java | 143 + ...IndexV1ProcessallmembershipsOperation.java | 158 + .../PostApiIndexV1RotatetokenOperation.java | 157 + ...tApiIndexV1UpdatepermissionsOperation.java | 161 + ...ostApiIndexV1UploadshortcutsOperation.java | 161 + .../PostRestApiV1ToolsCallOperation.java | 174 + .../operations/RecommendationsOperation.java | 178 + .../operations/SearchAgentsOperation.java | 173 + .../operations/SearchOperation.java | 189 + .../operations/SetdocvisibilityOperation.java | 174 + .../operations/SummarizeOperation.java | 173 + .../operations/UnpinOperation.java | 161 + .../UpdateannouncementOperation.java | 174 + .../operations/UpdatepolicyOperation.java | 176 + .../operations/UpdateshortcutOperation.java | 174 + .../operations/UploadchatfilesOperation.java | 179 + .../operations/VerifyOperation.java | 174 + .../utils/CopiableInputStream.java | 26 + .../glean_api_client/utils/Exceptions.java | 87 + .../glean_api_client/utils/Globals.java | 89 + .../glean_api_client/utils/HTTPClient.java | 21 + .../glean_api_client/utils/Helpers.java | 2 +- .../utils/QueryParameters.java | 15 +- .../glean_api_client/utils/Response.java | 1 - .../utils/SpeakeasyHTTPClient.java | 24 +- .../glean_api_client/utils/Utils.java | 238 +- .../glean_api_client/ActivitiesTests.java | 2 +- .../glean_api_client/AgentsTests.java | 4 +- .../glean_api_client/AnnouncementsTests.java | 6 +- .../glean_api_client/AnswersTests.java | 10 +- .../glean_api_client/ClientActivityTests.java | 2 +- .../ClientAuthenticationTests.java | 2 +- .../glean_api_client/ClientChatTests.java | 24 +- .../ClientDocumentsTests.java | 6 +- .../ClientShortcutsTests.java | 10 +- .../ClientVerificationTests.java | 6 +- .../glean_api_client/CollectionsTests.java | 16 +- .../glean_api_client/DatasourcesTests.java | 4 +- .../glean_api_client/EntitiesTests.java | 4 +- .../IndexingAuthenticationTests.java | 2 +- .../IndexingDocumentsTests.java | 10 +- .../IndexingPermissionsTests.java | 24 +- .../glean_api_client/InsightsTests.java | 2 +- .../glean_api_client/MessagesTests.java | 2 +- .../glean_api_client/PeopleTests.java | 2 +- .../glean_api_client/PinsTests.java | 10 +- .../glean_api_client/PoliciesTests.java | 4 +- .../glean_api_client/SearchTests.java | 10 +- .../glean_api_client/SummarizeTests.java | 2 +- .../glean_api_client/ToolsTests.java | 4 +- .../TroubleshootingTests.java | 8 +- tests/mockserver/.gitignore | 1 + tests/mockserver/Dockerfile | 11 + tests/mockserver/Makefile | 18 + tests/mockserver/README.md | 52 + tests/mockserver/go.mod | 15 + tests/mockserver/go.sum | 16 + .../internal/handler/assert/contenttype.go | 99 + .../internal/handler/assert/header.go | 70 + .../internal/handler/assert/parameter.go | 110 + .../internal/handler/assert/pointer.go | 12 + .../internal/handler/assert/security.go | 75 + tests/mockserver/internal/handler/doc.go | 5 + .../internal/handler/generated_handler.go | 35 + .../internal/handler/generated_handlers.go | 100 + .../handler/pathgetrestapiv1agentsagentid.go | 66 + .../pathgetrestapiv1agentsagentidschemas.go | 66 + .../pathgetrestapiv1governancedatapolicies.go | 62 + ...athgetrestapiv1governancedatapoliciesid.go | 62 + .../handler/pathgetrestapiv1toolslist.go | 62 + .../pathpostapiindexv1adddatasource.go | 53 + .../handler/pathpostapiindexv1betausers.go | 53 + .../pathpostapiindexv1bulkindexdocuments.go | 53 + .../pathpostapiindexv1bulkindexgroups.go | 53 + .../pathpostapiindexv1bulkindexmemberships.go | 53 + .../pathpostapiindexv1bulkindexusers.go | 53 + .../pathpostapiindexv1checkdocumentaccess.go | 67 + .../pathpostapiindexv1deletedocument.go | 53 + .../handler/pathpostapiindexv1deletegroup.go | 53 + .../pathpostapiindexv1deletemembership.go | 53 + .../handler/pathpostapiindexv1deleteuser.go | 53 + .../pathpostapiindexv1getdatasourceconfig.go | 86 + .../pathpostapiindexv1getdocumentcount.go | 67 + .../pathpostapiindexv1getdocumentstatus.go | 67 + .../handler/pathpostapiindexv1getusercount.go | 67 + .../pathpostapiindexv1indexdocument.go | 53 + .../pathpostapiindexv1indexdocuments.go | 53 + .../handler/pathpostapiindexv1indexgroup.go | 53 + .../pathpostapiindexv1indexmembership.go | 53 + .../handler/pathpostapiindexv1indexuser.go | 53 + .../pathpostapiindexv1processalldocuments.go | 53 + ...stapiindexv1processallemployeesandteams.go | 48 + ...pathpostapiindexv1processallmemberships.go | 53 + .../handler/pathpostapiindexv1rotatetoken.go | 62 + .../pathpostapiindexv1updatepermissions.go | 53 + .../handler/pathpostrestapiv1activity.go | 53 + .../pathpostrestapiv1addcollectionitems.go | 1517 +++ ...athpostrestapiv1addverificationreminder.go | 761 ++ .../handler/pathpostrestapiv1adminsearch.go | 163 + .../handler/pathpostrestapiv1autocomplete.go | 80 + .../internal/handler/pathpostrestapiv1chat.go | 171 + .../pathpostrestapiv1createannouncement.go | 2371 +++++ .../handler/pathpostrestapiv1createanswer.go | 2065 ++++ .../pathpostrestapiv1createauthtoken.go | 65 + .../pathpostrestapiv1createcollection.go | 1964 ++++ .../pathpostrestapiv1createshortcut.go | 67 + .../pathpostrestapiv1deleteallchats.go | 48 + .../pathpostrestapiv1deleteannouncement.go | 53 + .../handler/pathpostrestapiv1deleteanswer.go | 53 + .../pathpostrestapiv1deletechatfiles.go | 53 + .../handler/pathpostrestapiv1deletechats.go | 53 + .../pathpostrestapiv1deletecollection.go | 53 + .../pathpostrestapiv1deletecollectionitem.go | 1847 ++++ .../pathpostrestapiv1deleteshortcut.go | 53 + .../handler/pathpostrestapiv1editanswer.go | 2231 +++++ .../pathpostrestapiv1editcollection.go | 1491 +++ .../pathpostrestapiv1editcollectionitem.go | 1134 +++ .../handler/pathpostrestapiv1editpin.go | 406 + .../internal/handler/pathpostrestapiv1feed.go | 2074 ++++ .../handler/pathpostrestapiv1feedback.go | 53 + .../handler/pathpostrestapiv1getanswer.go | 2650 +++++ .../handler/pathpostrestapiv1getchat.go | 1202 +++ .../pathpostrestapiv1getchatapplication.go | 67 + .../handler/pathpostrestapiv1getchatfiles.go | 86 + .../handler/pathpostrestapiv1getcollection.go | 1335 +++ .../pathpostrestapiv1getdocpermissions.go | 67 + .../handler/pathpostrestapiv1getdocuments.go | 79 + .../pathpostrestapiv1getdocumentsbyfacets.go | 1341 +++ .../handler/pathpostrestapiv1getpin.go | 605 ++ .../handler/pathpostrestapiv1getshortcut.go | 67 + .../handler/pathpostrestapiv1insights.go | 5262 ++++++++++ .../handler/pathpostrestapiv1listanswers.go | 3497 +++++++ .../handler/pathpostrestapiv1listchats.go | 626 ++ .../pathpostrestapiv1listcollections.go | 1907 ++++ .../handler/pathpostrestapiv1listentities.go | 709 ++ .../handler/pathpostrestapiv1listpins.go | 692 ++ .../handler/pathpostrestapiv1listshortcuts.go | 153 + .../pathpostrestapiv1listverifications.go | 1716 ++++ .../handler/pathpostrestapiv1messages.go | 8718 +++++++++++++++++ .../handler/pathpostrestapiv1people.go | 1640 ++++ .../internal/handler/pathpostrestapiv1pin.go | 546 ++ .../pathpostrestapiv1recommendations.go | 5663 +++++++++++ .../handler/pathpostrestapiv1search.go | 163 + .../handler/pathpostrestapiv1summarize.go | 67 + .../handler/pathpostrestapiv1toolscall.go | 67 + .../handler/pathpostrestapiv1unpin.go | 53 + .../pathpostrestapiv1updateannouncement.go | 2580 +++++ .../pathpostrestapiv1updateshortcut.go | 67 + .../handler/pathpostrestapiv1verify.go | 899 ++ .../internal/handler/values/files.go | 40 + tests/mockserver/internal/logging/doc.go | 4 + tests/mockserver/internal/logging/formats.go | 38 + .../mockserver/internal/logging/http_file.go | 310 + .../internal/logging/http_logger.go | 90 + tests/mockserver/internal/logging/levels.go | 55 + tests/mockserver/internal/logging/logger.go | 40 + .../internal/logging/oas_operation.go | 87 + .../internal/logging/oas_operation_call.go | 123 + .../sdk/models/components/activity.go | 14 + .../sdk/models/components/activityevent.go | 110 + .../models/components/activityeventparams.go | 87 + .../components/addcollectionitemserror.go | 42 + .../components/addcollectionitemsrequest.go | 24 + .../components/addcollectionitemsresponse.go | 22 + .../components/additionalfielddefinition.go | 44 + .../internal/sdk/models/components/agent.go | 106 + .../sdk/models/components/agentconfig.go | 87 + .../models/components/agentexecutionstatus.go | 35 + .../sdk/models/components/agentrun.go | 52 + .../sdk/models/components/agentruncreate.go | 43 + .../models/components/agentrunwaitresponse.go | 23 + .../sdk/models/components/agentschemas.go | 42 + .../models/components/aiappactioncounts.go | 84 + .../components/aiappsinsightsresponse.go | 50 + .../models/components/aiinsightsresponse.go | 113 + .../sdk/models/components/allowlistoptions.go | 16 + .../sdk/models/components/announcement.go | 307 + .../sdk/models/components/anonymousevent.go | 56 + .../internal/sdk/models/components/answer.go | 257 + .../sdk/models/components/answerboard.go | 134 + .../models/components/answercreationdata.go | 143 + .../sdk/models/components/answerlike.go | 39 + .../sdk/models/components/answerlikes.go | 32 + .../sdk/models/components/answerresult.go | 23 + .../sdk/models/components/appresult.go | 42 + .../sdk/models/components/authconfig.go | 217 + .../sdk/models/components/authtoken.go | 56 + .../models/components/autocompleterequest.go | 141 + .../models/components/autocompleteresponse.go | 66 + .../models/components/autocompleteresult.go | 164 + .../components/autocompleteresultgroup.go | 34 + .../internal/sdk/models/components/badge.go | 43 + .../components/bulkindexdocumentsrequest.go | 70 + .../components/bulkindexemployeesrequest.go | 61 + .../components/bulkindexgroupsrequest.go | 70 + .../components/bulkindexmembershipsrequest.go | 70 + .../components/bulkindexshortcutsrequest.go | 52 + .../components/bulkindexteamsrequest.go | 52 + .../components/bulkindexusersrequest.go | 70 + .../components/bulkuploadhistoryevent.go | 123 + .../sdk/models/components/calendarattendee.go | 86 + .../models/components/calendarattendees.go | 69 + .../sdk/models/components/calendarevent.go | 151 + .../components/canonicalizingregextype.go | 25 + .../models/components/channelinviteinfo.go | 66 + .../internal/sdk/models/components/chat.go | 87 + .../sdk/models/components/chatfile.go | 43 + .../components/chatfilefailurereason.go | 50 + .../sdk/models/components/chatfilemetadata.go | 52 + .../sdk/models/components/chatfilestatus.go | 41 + .../sdk/models/components/chatmessage.go | 186 + .../models/components/chatmessagecitation.go | 50 + .../models/components/chatmessagefragment.go | 58 + .../sdk/models/components/chatmetadata.go | 78 + .../models/components/chatmetadataresult.go | 24 + .../sdk/models/components/chatrequest.go | 102 + .../sdk/models/components/chatresponse.go | 51 + .../components/chatrestrictionfilters.go | 31 + .../sdk/models/components/chatresult.go | 24 + .../chatzerostatesuggestionoptions.go | 15 + .../components/checkdocumentaccessrequest.go | 43 + .../components/checkdocumentaccessresponse.go | 16 + .../sdk/models/components/clustergroup.go | 33 + .../sdk/models/components/clustertypeenum.go | 56 + .../internal/sdk/models/components/code.go | 47 + .../sdk/models/components/codeline.go | 31 + .../sdk/models/components/collection.go | 222 + .../sdk/models/components/collectionerror.go | 60 + .../sdk/models/components/collectionitem.go | 168 + .../components/collectionitemdescriptor.go | 102 + .../components/collectionpinmetadata.go | 23 + .../collectionpinnablecategories.go | 38 + .../components/collectionpinnabletargets.go | 35 + .../components/collectionpinnedmetadata.go | 24 + .../models/components/collectionpintarget.go | 33 + .../models/components/commentdefinition.go | 61 + .../models/components/communicationchannel.go | 34 + .../internal/sdk/models/components/company.go | 139 + .../sdk/models/components/conferencedata.go | 91 + .../sdk/models/components/connectortype.go | 53 + .../models/components/contentdefinition.go | 33 + .../components/contentinsightsresponse.go | 51 + .../sdk/models/components/contenttype.go | 31 + .../sdk/models/components/countinfo.go | 32 + .../components/createannouncementrequest.go | 201 + .../models/components/createanswerrequest.go | 14 + .../components/createauthtokenresponse.go | 24 + .../components/createcollectionrequest.go | 104 + .../components/createcollectionresponse.go | 289 + .../components/createdlpreportrequest.go | 42 + .../components/createdlpreportresponse.go | 15 + .../components/createshortcutrequest.go | 14 + .../components/createshortcutresponse.go | 22 + .../components/customdatasourceconfig.go | 415 + .../sdk/models/components/customdatavalue.go | 47 + .../sdk/models/components/customentity.go | 67 + .../models/components/customentitymetadata.go | 15 + .../sdk/models/components/customer.go | 110 + .../sdk/models/components/customermetadata.go | 24 + .../sdk/models/components/customfielddata.go | 47 + .../sdk/models/components/customfieldvalue.go | 94 + .../components/customfieldvaluehyperlink.go | 24 + .../components/customfieldvalueperson.go | 14 + .../models/components/customfieldvaluestr.go | 15 + .../sdk/models/components/customproperty.go | 24 + .../datasourcebulkmembershipdefinition.go | 25 + .../components/datasourcegroupdefinition.go | 16 + .../datasourcemembershipdefinition.go | 34 + .../datasourceobjecttypedocumentcountentry.go | 24 + .../models/components/datasourceprofile.go | 51 + .../components/datasourceuserdefinition.go | 41 + ...tasourcestatusidentityresponsecomponent.go | 35 + .../debugdatasourcestatusresponse.go | 153 + .../models/components/debugdocumentrequest.go | 25 + .../components/debugdocumentresponse.go | 25 + .../components/debugdocumentsrequest.go | 16 + .../components/debugdocumentsresponse.go | 16 + .../components/debugdocumentsresponseitem.go | 34 + .../sdk/models/components/debuguserrequest.go | 16 + .../models/components/debuguserresponse.go | 25 + .../components/deleteannouncementrequest.go | 15 + .../models/components/deleteanswerrequest.go | 24 + .../components/deletechatfilesrequest.go | 15 + .../models/components/deletechatsrequest.go | 15 + .../components/deletecollectionitemrequest.go | 33 + .../deletecollectionitemresponse.go | 14 + .../components/deletecollectionrequest.go | 24 + .../components/deletedocumentrequest.go | 43 + .../components/deleteemployeerequest.go | 25 + .../models/components/deletegrouprequest.go | 34 + .../components/deletemembershiprequest.go | 34 + .../components/deleteshortcutrequest.go | 15 + .../models/components/deleteteamrequest.go | 16 + .../models/components/deleteuserrequest.go | 34 + .../sdk/models/components/disambiguation.go | 34 + .../components/displayablelistitemuiconfig.go | 16 + .../sdk/models/components/dlpconfig.go | 125 + .../sdk/models/components/dlpfrequency.go | 44 + .../sdk/models/components/dlpperson.go | 33 + .../models/components/dlppersonmetadata.go | 24 + .../sdk/models/components/dlpreport.go | 155 + .../sdk/models/components/dlpreportstatus.go | 41 + .../sdk/models/components/dlpsimpleresult.go | 34 + .../sdk/models/components/document.go | 101 + .../sdk/models/components/documentcontent.go | 15 + .../models/components/documentdefinition.go | 213 + .../sdk/models/components/documentinsight.go | 30 + .../models/components/documentinteractions.go | 60 + .../documentinteractionsdefinition.go | 31 + .../sdk/models/components/documentmetadata.go | 366 + .../models/components/documentorerrorunion.go | 84 + .../documentpermissionsdefinition.go | 52 + .../sdk/models/components/documentsection.go | 24 + .../models/components/documentspecunion.go | 182 + .../components/documentstatusresponse.go | 52 + .../models/components/documentvisibility.go | 47 + .../components/documentvisibilityoverride.go | 61 + .../documentvisibilityupdateresult.go | 70 + .../models/components/editanswerrequest.go | 170 + .../components/editcollectionitemrequest.go | 51 + .../components/editcollectionitemresponse.go | 14 + .../components/editcollectionrequest.go | 104 + .../components/editcollectionresponse.go | 289 + .../sdk/models/components/editpinrequest.go | 33 + .../components/employeeinfodefinition.go | 272 + .../sdk/models/components/employeeteaminfo.go | 34 + .../models/components/entitiessortorder.go | 50 + .../models/components/entityrelationship.go | 25 + .../sdk/models/components/entitytype.go | 38 + .../sdk/models/components/errormessage.go | 23 + .../models/components/eventclassification.go | 24 + .../components/eventclassificationname.go | 32 + .../models/components/eventstrategyname.go | 56 + .../components/externalsharingoptions.go | 89 + .../sdk/models/components/externalshortcut.go | 105 + .../sdk/models/components/extractedqna.go | 32 + .../sdk/models/components/facetbucket.go | 41 + .../models/components/facetbucketfilter.go | 24 + .../sdk/models/components/facetfilter.go | 32 + .../sdk/models/components/facetfilterset.go | 15 + .../sdk/models/components/facetfiltervalue.go | 73 + .../sdk/models/components/facetresult.go | 51 + .../sdk/models/components/facetvalue.go | 41 + .../sdk/models/components/favoriteinfo.go | 41 + .../sdk/models/components/feedback.go | 386 + .../models/components/feedbackchatexchange.go | 78 + .../sdk/models/components/feedentry.go | 340 + .../sdk/models/components/feedrequest.go | 131 + .../models/components/feedrequestoptions.go | 61 + .../sdk/models/components/feedresponse.go | 59 + .../sdk/models/components/feedresult.go | 133 + .../sdk/models/components/followupaction.go | 61 + .../models/components/generatedattachment.go | 57 + .../components/generatedattachmentcontent.go | 25 + .../sdk/models/components/generatedqna.go | 128 + .../sdk/models/components/getanswererror.go | 53 + .../sdk/models/components/getanswerrequest.go | 24 + .../models/components/getanswerresponse.go | 22 + .../components/getchatapplicationrequest.go | 15 + .../components/getchatapplicationresponse.go | 14 + .../models/components/getchatfilesrequest.go | 15 + .../models/components/getchatfilesresponse.go | 15 + .../sdk/models/components/getchatrequest.go | 15 + .../sdk/models/components/getchatresponse.go | 14 + .../models/components/getcollectionrequest.go | 42 + .../components/getcollectionresponse.go | 39 + .../components/getdatasourceconfigrequest.go | 16 + .../models/components/getdlpreportresponse.go | 15 + .../components/getdocpermissionsrequest.go | 15 + .../components/getdocpermissionsresponse.go | 15 + .../components/getdocumentcountrequest.go | 16 + .../components/getdocumentcountresponse.go | 16 + .../components/getdocumentsbyfacetsrequest.go | 33 + .../getdocumentsbyfacetsresponse.go | 33 + .../models/components/getdocumentsrequest.go | 61 + .../models/components/getdocumentsresponse.go | 15 + .../components/getdocumentstatusrequest.go | 34 + .../components/getdocumentstatusresponse.go | 43 + .../getdocumentvisibilityoverridesresponse.go | 14 + .../sdk/models/components/getpinrequest.go | 15 + .../sdk/models/components/getpinresponse.go | 14 + .../components/getshortcutrequestunion.go | 84 + .../models/components/getshortcutresponse.go | 22 + .../models/components/getusercountrequest.go | 16 + .../models/components/getusercountresponse.go | 16 + .../components/gleanassistinsightsresponse.go | 51 + .../sdk/models/components/gleandataerror.go | 41 + .../sdk/models/components/grantpermission.go | 16 + .../components/greenlistusersrequest.go | 25 + .../internal/sdk/models/components/group.go | 33 + .../sdk/models/components/grouptype.go | 53 + .../internal/sdk/models/components/hotword.go | 22 + .../sdk/models/components/hotwordproximity.go | 22 + .../sdk/models/components/httpmetadata.go | 28 + .../sdk/models/components/iconconfig.go | 138 + .../models/components/indexdocumentrequest.go | 25 + .../components/indexdocumentsrequest.go | 34 + .../models/components/indexemployeerequest.go | 25 + .../models/components/indexgrouprequest.go | 34 + .../sdk/models/components/indexingshortcut.go | 87 + .../components/indexmembershiprequest.go | 34 + .../sdk/models/components/indexstatus.go | 40 + .../sdk/models/components/indexteamrequest.go | 25 + .../sdk/models/components/indexuserrequest.go | 34 + .../sdk/models/components/inputoptions.go | 132 + .../insightsagentsrequestoptions.go | 15 + .../components/insightsaiapprequestoptions.go | 15 + .../sdk/models/components/insightsrequest.go | 156 + .../sdk/models/components/insightsresponse.go | 112 + .../components/invalidoperatorvalueerror.go | 24 + .../sdk/models/components/inviteinfo.go | 71 + .../sdk/models/components/labeledcountinfo.go | 24 + .../models/components/listanswersrequest.go | 15 + .../models/components/listanswersresponse.go | 15 + .../models/components/listchatsresponse.go | 14 + .../components/listcollectionsrequest.go | 34 + .../components/listcollectionsresponse.go | 15 + .../components/listdlpreportsresponse.go | 14 + .../models/components/listentitiesrequest.go | 214 + .../models/components/listentitiesresponse.go | 83 + .../sdk/models/components/listpinsresponse.go | 15 + .../listshortcutspaginatedrequest.go | 89 + .../listshortcutspaginatedresponse.go | 31 + .../models/components/manualfeedbackinfo.go | 324 + .../internal/sdk/models/components/meeting.go | 78 + .../internal/sdk/models/components/message.go | 43 + .../sdk/models/components/messagesrequest.go | 170 + .../sdk/models/components/messagesresponse.go | 31 + .../sdk/models/components/objectdefinition.go | 137 + .../models/components/objectpermissions.go | 15 + .../sdk/models/components/operatormetadata.go | 102 + .../sdk/models/components/operatorscope.go | 22 + .../sdk/models/components/peoplerequest.go | 141 + .../sdk/models/components/peopleresponse.go | 33 + .../internal/sdk/models/components/period.go | 44 + .../sdk/models/components/permissions.go | 80 + .../permissionsgroupintersectiondefinition.go | 15 + .../internal/sdk/models/components/person.go | 41 + .../sdk/models/components/persondistance.go | 33 + .../sdk/models/components/personmetadata.go | 450 + .../sdk/models/components/personobject.go | 24 + .../sdk/models/components/personteam.go | 106 + .../components/persontoteamrelationship.go | 96 + .../sdk/models/components/pindocument.go | 90 + .../sdk/models/components/pinrequest.go | 33 + .../sdk/models/components/possiblevalue.go | 25 + .../components/processalldocumentsrequest.go | 16 + .../processallmembershipsrequest.go | 16 + .../components/processinghistoryevent.go | 25 + .../sdk/models/components/prompttemplate.go | 119 + .../models/components/prompttemplateresult.go | 39 + .../models/components/propertydefinition.go | 162 + .../sdk/models/components/propertygroup.go | 25 + .../sdk/models/components/queryinsight.go | 56 + .../components/queryinsightsresponse.go | 51 + .../sdk/models/components/querysuggestion.go | 75 + .../models/components/querysuggestionlist.go | 22 + .../sdk/models/components/quicklink.go | 101 + .../sdk/models/components/reaction.go | 40 + .../sdk/models/components/readpermission.go | 16 + .../components/recommendationsrequest.go | 90 + .../recommendationsrequestoptions.go | 50 + .../sdk/models/components/referencerange.go | 24 + .../sdk/models/components/relateddocuments.go | 126 + .../sdk/models/components/relatedobject.go | 37 + .../models/components/relatedobjectedge.go | 14 + .../sdk/models/components/relatedquestion.go | 33 + .../sdk/models/components/reminder.go | 49 + .../sdk/models/components/reminderrequest.go | 42 + .../models/components/reportstatusresponse.go | 66 + .../models/components/restrictionfilters.go | 15 + .../models/components/resultsdescription.go | 24 + .../sdk/models/components/resultsresponse.go | 73 + .../sdk/models/components/resulttab.go | 42 + .../models/components/rotatetokenresponse.go | 34 + .../sdk/models/components/scopetype.go | 35 + .../models/components/searchagentsrequest.go | 15 + .../models/components/searchagentsresponse.go | 14 + .../models/components/searchproviderinfo.go | 33 + .../sdk/models/components/searchrequest.go | 144 + .../components/searchrequestinputdetails.go | 15 + .../models/components/searchrequestoptions.go | 197 + .../sdk/models/components/searchresponse.go | 151 + .../components/searchresponsemetadata.go | 111 + .../sdk/models/components/searchresult.go | 191 + .../components/searchresultprominenceenum.go | 38 + .../models/components/searchresultsnippet.go | 60 + .../sdk/models/components/searchwarning.go | 89 + .../sdk/models/components/security.go | 14 + .../sdk/models/components/seenfeedbackinfo.go | 15 + .../components/sensitivecontentoptions.go | 34 + .../models/components/sensitiveexpression.go | 24 + .../models/components/sensitiveinfotype.go | 58 + .../sdk/models/components/sessioninfo.go | 58 + .../internal/sdk/models/components/share.go | 32 + .../sdk/models/components/sharingoptions.go | 79 + .../sdk/models/components/shortcut.go | 216 + .../sdk/models/components/shortcuterror.go | 51 + .../sdk/models/components/shortcutinsight.go | 30 + .../components/shortcutinsightsresponse.go | 42 + .../components/shortcutmutableproperties.go | 78 + .../components/shortcutspaginationmetadata.go | 31 + .../sdk/models/components/socialnetwork.go | 33 + .../components/socialnetworkdefinition.go | 34 + .../sdk/models/components/sortoptions.go | 53 + .../sdk/models/components/structuredlink.go | 34 + .../models/components/structuredlocation.go | 88 + .../sdk/models/components/structuredresult.go | 243 + .../sdk/models/components/structuredtext.go | 23 + .../models/components/structuredtextitem.go | 39 + .../structuredtextmutableproperties.go | 14 + .../sdk/models/components/summarizerequest.go | 68 + .../models/components/summarizeresponse.go | 42 + .../internal/sdk/models/components/summary.go | 23 + .../internal/sdk/models/components/team.go | 242 + .../sdk/models/components/teamemail.go | 40 + .../models/components/teaminfodefinition.go | 107 + .../sdk/models/components/teammember.go | 50 + .../sdk/models/components/textrange.go | 87 + .../sdk/models/components/thumbnail.go | 24 + .../sdk/models/components/timeinterval.go | 24 + .../sdk/models/components/timepoint.go | 24 + .../sdk/models/components/timerange.go | 49 + .../internal/sdk/models/components/tool.go | 83 + .../sdk/models/components/toolinfo.go | 24 + .../sdk/models/components/toolmetadata.go | 316 + .../sdk/models/components/toolparameter.go | 109 + .../models/components/toolscallparameter.go | 42 + .../sdk/models/components/toolscallrequest.go | 24 + .../models/components/toolscallresponse.go | 24 + .../models/components/toolslistresponse.go | 14 + .../internal/sdk/models/components/ugctype.go | 46 + .../internal/sdk/models/components/unpin.go | 15 + .../components/updateannouncementrequest.go | 210 + .../components/updatedlpconfigrequest.go | 24 + .../components/updatedlpconfigresponse.go | 23 + .../components/updatedlpreportrequest.go | 51 + .../components/updatedlpreportresponse.go | 14 + ...pdatedocumentvisibilityoverridesrequest.go | 14 + ...datedocumentvisibilityoverridesresponse.go | 15 + .../components/updatepermissionsrequest.go | 52 + .../components/updateshortcutrequest.go | 87 + .../components/updateshortcutresponse.go | 22 + .../components/uploadchatfilesrequest.go | 38 + .../components/uploadchatfilesresponse.go | 15 + .../components/uploadshortcutsrequest.go | 52 + .../sdk/models/components/uploadstatusenum.go | 38 + .../internal/sdk/models/components/user.go | 24 + .../sdk/models/components/useractivity.go | 108 + .../models/components/useractivityinsight.go | 80 + .../components/usergeneratedcontentid.go | 15 + .../models/components/userinsightsresponse.go | 60 + .../components/userreferencedefinition.go | 32 + .../sdk/models/components/userrole.go | 44 + .../components/userrolespecification.go | 39 + .../models/components/userstatusresponse.go | 34 + .../sdk/models/components/userviewinfo.go | 33 + .../sdk/models/components/verification.go | 58 + .../sdk/models/components/verificationfeed.go | 15 + .../models/components/verificationmetadata.go | 75 + .../sdk/models/components/verifyrequest.go | 59 + .../sdk/models/components/viewerinfo.go | 75 + .../sdk/models/components/workflow.go | 66 + .../models/components/workflowfeedbackinfo.go | 50 + .../sdk/models/components/workflowresult.go | 14 + .../models/components/writeactionparameter.go | 98 + .../sdk/models/components/writepermission.go | 43 + .../sdk/models/operations/activity.go | 18 + .../models/operations/addcollectionitems.go | 27 + .../operations/addverificationreminder.go | 27 + .../sdk/models/operations/adminsearch.go | 27 + .../sdk/models/operations/autocomplete.go | 27 + .../internal/sdk/models/operations/chat.go | 48 + .../sdk/models/operations/chatstream.go | 48 + .../models/operations/createandstreamrun.go | 27 + .../sdk/models/operations/createandwaitrun.go | 27 + .../models/operations/createannouncement.go | 27 + .../sdk/models/operations/createanswer.go | 27 + .../sdk/models/operations/createauthtoken.go | 27 + .../sdk/models/operations/createcollection.go | 27 + .../sdk/models/operations/createpolicy.go | 27 + .../sdk/models/operations/createreport.go | 27 + .../sdk/models/operations/createshortcut.go | 27 + .../sdk/models/operations/deleteallchats.go | 30 + .../models/operations/deleteannouncement.go | 18 + .../sdk/models/operations/deleteanswer.go | 18 + .../sdk/models/operations/deletechatfiles.go | 38 + .../sdk/models/operations/deletechats.go | 38 + .../sdk/models/operations/deletecollection.go | 18 + .../models/operations/deletecollectionitem.go | 27 + .../sdk/models/operations/deleteshortcut.go | 18 + .../models/operations/downloadpolicycsv.go | 39 + .../models/operations/downloadreportcsv.go | 39 + .../sdk/models/operations/editanswer.go | 27 + .../sdk/models/operations/editcollection.go | 27 + .../models/operations/editcollectionitem.go | 27 + .../internal/sdk/models/operations/editpin.go | 27 + .../internal/sdk/models/operations/feed.go | 27 + .../sdk/models/operations/feedback.go | 38 + .../sdk/models/operations/getagent.go | 48 + .../sdk/models/operations/getagentschemas.go | 48 + .../sdk/models/operations/getanswer.go | 27 + .../internal/sdk/models/operations/getchat.go | 47 + .../models/operations/getchatapplication.go | 47 + .../sdk/models/operations/getchatfiles.go | 47 + .../sdk/models/operations/getcollection.go | 27 + .../models/operations/getdocpermissions.go | 27 + .../sdk/models/operations/getdocuments.go | 27 + .../models/operations/getdocumentsbyfacets.go | 27 + .../sdk/models/operations/getdocvisibility.go | 39 + .../internal/sdk/models/operations/getpin.go | 27 + .../sdk/models/operations/getpolicy.go | 48 + .../sdk/models/operations/getreportstatus.go | 39 + .../operations/getrestapiv1toolslist.go | 39 + .../sdk/models/operations/getshortcut.go | 27 + .../sdk/models/operations/insights.go | 27 + .../sdk/models/operations/listanswers.go | 27 + .../sdk/models/operations/listchats.go | 39 + .../sdk/models/operations/listcollections.go | 27 + .../sdk/models/operations/listentities.go | 27 + .../sdk/models/operations/listpins.go | 31 + .../sdk/models/operations/listpolicies.go | 48 + .../sdk/models/operations/listshortcuts.go | 27 + .../models/operations/listverifications.go | 39 + .../sdk/models/operations/messages.go | 27 + .../internal/sdk/models/operations/people.go | 27 + .../internal/sdk/models/operations/pin.go | 27 + .../operations/postapiindexv1adddatasource.go | 18 + .../operations/postapiindexv1betausers.go | 18 + .../postapiindexv1bulkindexdocuments.go | 18 + .../postapiindexv1bulkindexemployees.go | 18 + .../postapiindexv1bulkindexgroups.go | 18 + .../postapiindexv1bulkindexmemberships.go | 18 + .../postapiindexv1bulkindexshortcuts.go | 18 + .../postapiindexv1bulkindexteams.go | 18 + .../postapiindexv1bulkindexusers.go | 18 + .../postapiindexv1checkdocumentaccess.go | 27 + .../postapiindexv1debugdatasourcedocument.go | 47 + .../postapiindexv1debugdatasourcedocuments.go | 47 + .../postapiindexv1debugdatasourcestatus.go | 39 + .../postapiindexv1debugdatasourceuser.go | 47 + .../postapiindexv1deletedocument.go | 18 + .../postapiindexv1deleteemployee.go | 18 + .../operations/postapiindexv1deletegroup.go | 18 + .../postapiindexv1deletemembership.go | 18 + .../operations/postapiindexv1deleteteam.go | 18 + .../operations/postapiindexv1deleteuser.go | 18 + .../postapiindexv1getdatasourceconfig.go | 27 + .../postapiindexv1getdocumentcount.go | 27 + .../postapiindexv1getdocumentstatus.go | 27 + .../operations/postapiindexv1getusercount.go | 27 + .../operations/postapiindexv1indexdocument.go | 18 + .../postapiindexv1indexdocuments.go | 18 + .../operations/postapiindexv1indexemployee.go | 18 + .../operations/postapiindexv1indexgroup.go | 18 + .../postapiindexv1indexmembership.go | 18 + .../operations/postapiindexv1indexteam.go | 18 + .../operations/postapiindexv1indexuser.go | 18 + .../postapiindexv1processalldocuments.go | 18 + ...stapiindexv1processallemployeesandteams.go | 18 + .../postapiindexv1processallmemberships.go | 18 + .../operations/postapiindexv1rotatetoken.go | 27 + .../postapiindexv1updatepermissions.go | 18 + .../postapiindexv1uploadshortcuts.go | 18 + .../operations/postrestapiv1toolscall.go | 27 + .../sdk/models/operations/recommendations.go | 27 + .../internal/sdk/models/operations/search.go | 27 + .../sdk/models/operations/searchagents.go | 27 + .../sdk/models/operations/setdocvisibility.go | 27 + .../sdk/models/operations/summarize.go | 27 + .../internal/sdk/models/operations/unpin.go | 18 + .../models/operations/updateannouncement.go | 27 + .../sdk/models/operations/updatepolicy.go | 47 + .../sdk/models/operations/updateshortcut.go | 27 + .../sdk/models/operations/uploadchatfiles.go | 47 + .../internal/sdk/models/operations/verify.go | 27 + .../sdk/models/sdkerrors/collectionerror.go | 20 + .../sdk/models/sdkerrors/gleandataerror.go | 26 + tests/mockserver/internal/sdk/types/bigint.go | 21 + tests/mockserver/internal/sdk/types/date.go | 90 + .../mockserver/internal/sdk/types/datetime.go | 23 + .../mockserver/internal/sdk/types/decimal.go | 20 + .../internal/sdk/types/jsonl/jsonl.go | 7 + .../mockserver/internal/sdk/types/pointers.go | 11 + tests/mockserver/internal/sdk/utils/json.go | 675 ++ .../mockserver/internal/sdk/utils/reflect.go | 49 + tests/mockserver/internal/sdk/utils/sort.go | 94 + tests/mockserver/internal/server/doc.go | 4 + .../internal/server/generated_handlers.go | 17 + .../internal/server/internal_handlers.go | 343 + tests/mockserver/internal/server/server.go | 134 + .../internal/server/server_option.go | 30 + .../server/templates/log/index.html.tmpl | 22 + .../server/templates/log/operation.html.tmpl | 93 + .../server/templates/log/style.css.tmpl | 64 + .../internal/tracking/requesttracker.go | 47 + tests/mockserver/main.go | 74 + tests/mockserver/testdata/example.file | 1 + 1653 files changed, 120584 insertions(+), 19220 deletions(-) create mode 100644 docs/models/components/RequestType.md create mode 100644 src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java delete mode 100644 src/main/java/com/glean/api_client/glean_api_client/models/operations/SDKMethodInterfaces.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ActivityOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/AddcollectionitemsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/AddverificationreminderOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/AdminsearchOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/AutocompleteOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ChatOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ChatStreamOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndStreamRunOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndWaitRunOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreateannouncementOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreateanswerOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreateauthtokenOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreatecollectionOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreatepolicyOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreatereportOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/CreateshortcutOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeleteallchatsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeleteannouncementOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeleteanswerOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatfilesOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionitemOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DeleteshortcutOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DownloadpolicycsvOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/DownloadreportcsvOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/EditanswerOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionitemOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/EditpinOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/FeedOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/FeedbackOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentSchemasOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetRestApiV1ToolsListOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetanswerOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetchatOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetchatapplicationOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetchatfilesOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetcollectionOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetdocpermissionsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsbyfacetsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetdocvisibilityOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetpinOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetpolicyOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetreportstatusOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/GetshortcutOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/InsightsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListanswersOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListchatsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListcollectionsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListentitiesOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListpinsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListpoliciesOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListshortcutsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/ListverificationsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/MessagesOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/Operations.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PeopleOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PinOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1AdddatasourceOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BetausersOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexdocumentsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexemployeesOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexgroupsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexmembershipsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexshortcutsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexteamsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexusersOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1CheckdocumentaccessOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceStatusOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceUserOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletedocumentOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteemployeeOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletegroupOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletemembershipOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteteamOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteuserOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdatasourceconfigOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentcountOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentstatusOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetusercountOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexemployeeOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexgroupOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexmembershipOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexteamOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexuserOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessalldocumentsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallemployeesandteamsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallmembershipsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1RotatetokenOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UpdatepermissionsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UploadshortcutsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/PostRestApiV1ToolsCallOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/RecommendationsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/SearchAgentsOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/SearchOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/SetdocvisibilityOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/SummarizeOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/UnpinOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/UpdateannouncementOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/UpdatepolicyOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/UpdateshortcutOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/UploadchatfilesOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/operations/VerifyOperation.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/utils/CopiableInputStream.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/utils/Exceptions.java create mode 100644 src/main/java/com/glean/api_client/glean_api_client/utils/Globals.java create mode 100644 tests/mockserver/.gitignore create mode 100644 tests/mockserver/Dockerfile create mode 100644 tests/mockserver/Makefile create mode 100644 tests/mockserver/README.md create mode 100644 tests/mockserver/go.mod create mode 100644 tests/mockserver/go.sum create mode 100644 tests/mockserver/internal/handler/assert/contenttype.go create mode 100644 tests/mockserver/internal/handler/assert/header.go create mode 100644 tests/mockserver/internal/handler/assert/parameter.go create mode 100644 tests/mockserver/internal/handler/assert/pointer.go create mode 100644 tests/mockserver/internal/handler/assert/security.go create mode 100644 tests/mockserver/internal/handler/doc.go create mode 100644 tests/mockserver/internal/handler/generated_handler.go create mode 100644 tests/mockserver/internal/handler/generated_handlers.go create mode 100644 tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go create mode 100644 tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go create mode 100644 tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go create mode 100644 tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go create mode 100644 tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1adddatasource.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1betausers.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1bulkindexdocuments.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1bulkindexgroups.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1bulkindexmemberships.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1bulkindexusers.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1deletedocument.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1deletegroup.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1deletemembership.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1deleteuser.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1indexdocument.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1indexdocuments.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1indexgroup.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1indexmembership.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1indexuser.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1processalldocuments.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1processallemployeesandteams.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1processallmemberships.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go create mode 100644 tests/mockserver/internal/handler/pathpostapiindexv1updatepermissions.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1activity.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1chat.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deleteallchats.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deleteannouncement.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deleteanswer.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deletechatfiles.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deletechats.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deletecollection.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1deleteshortcut.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1editpin.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1feed.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1feedback.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getchat.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getpin.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1insights.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1listchats.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1listentities.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1listpins.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1messages.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1people.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1pin.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1search.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1summarize.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1unpin.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go create mode 100644 tests/mockserver/internal/handler/pathpostrestapiv1verify.go create mode 100644 tests/mockserver/internal/handler/values/files.go create mode 100644 tests/mockserver/internal/logging/doc.go create mode 100644 tests/mockserver/internal/logging/formats.go create mode 100644 tests/mockserver/internal/logging/http_file.go create mode 100644 tests/mockserver/internal/logging/http_logger.go create mode 100644 tests/mockserver/internal/logging/levels.go create mode 100644 tests/mockserver/internal/logging/logger.go create mode 100644 tests/mockserver/internal/logging/oas_operation.go create mode 100644 tests/mockserver/internal/logging/oas_operation_call.go create mode 100644 tests/mockserver/internal/sdk/models/components/activity.go create mode 100644 tests/mockserver/internal/sdk/models/components/activityevent.go create mode 100644 tests/mockserver/internal/sdk/models/components/activityeventparams.go create mode 100644 tests/mockserver/internal/sdk/models/components/addcollectionitemserror.go create mode 100644 tests/mockserver/internal/sdk/models/components/addcollectionitemsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/addcollectionitemsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/additionalfielddefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/agent.go create mode 100644 tests/mockserver/internal/sdk/models/components/agentconfig.go create mode 100644 tests/mockserver/internal/sdk/models/components/agentexecutionstatus.go create mode 100644 tests/mockserver/internal/sdk/models/components/agentrun.go create mode 100644 tests/mockserver/internal/sdk/models/components/agentruncreate.go create mode 100644 tests/mockserver/internal/sdk/models/components/agentrunwaitresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/agentschemas.go create mode 100644 tests/mockserver/internal/sdk/models/components/aiappactioncounts.go create mode 100644 tests/mockserver/internal/sdk/models/components/aiappsinsightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/aiinsightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/allowlistoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/announcement.go create mode 100644 tests/mockserver/internal/sdk/models/components/anonymousevent.go create mode 100644 tests/mockserver/internal/sdk/models/components/answer.go create mode 100644 tests/mockserver/internal/sdk/models/components/answerboard.go create mode 100644 tests/mockserver/internal/sdk/models/components/answercreationdata.go create mode 100644 tests/mockserver/internal/sdk/models/components/answerlike.go create mode 100644 tests/mockserver/internal/sdk/models/components/answerlikes.go create mode 100644 tests/mockserver/internal/sdk/models/components/answerresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/appresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/authconfig.go create mode 100644 tests/mockserver/internal/sdk/models/components/authtoken.go create mode 100644 tests/mockserver/internal/sdk/models/components/autocompleterequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/autocompleteresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/autocompleteresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/autocompleteresultgroup.go create mode 100644 tests/mockserver/internal/sdk/models/components/badge.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkindexdocumentsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkindexemployeesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkindexgroupsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkindexmembershipsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkindexshortcutsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkindexteamsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkindexusersrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/bulkuploadhistoryevent.go create mode 100644 tests/mockserver/internal/sdk/models/components/calendarattendee.go create mode 100644 tests/mockserver/internal/sdk/models/components/calendarattendees.go create mode 100644 tests/mockserver/internal/sdk/models/components/calendarevent.go create mode 100644 tests/mockserver/internal/sdk/models/components/canonicalizingregextype.go create mode 100644 tests/mockserver/internal/sdk/models/components/channelinviteinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/chat.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatfile.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatfilefailurereason.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatfilemetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatfilestatus.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatmessage.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatmessagecitation.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatmessagefragment.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatmetadataresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatrestrictionfilters.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/chatzerostatesuggestionoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/checkdocumentaccessrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/checkdocumentaccessresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/clustergroup.go create mode 100644 tests/mockserver/internal/sdk/models/components/clustertypeenum.go create mode 100644 tests/mockserver/internal/sdk/models/components/code.go create mode 100644 tests/mockserver/internal/sdk/models/components/codeline.go create mode 100644 tests/mockserver/internal/sdk/models/components/collection.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionerror.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionitem.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionitemdescriptor.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionpinmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionpinnablecategories.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionpinnabletargets.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionpinnedmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/collectionpintarget.go create mode 100644 tests/mockserver/internal/sdk/models/components/commentdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/communicationchannel.go create mode 100644 tests/mockserver/internal/sdk/models/components/company.go create mode 100644 tests/mockserver/internal/sdk/models/components/conferencedata.go create mode 100644 tests/mockserver/internal/sdk/models/components/connectortype.go create mode 100644 tests/mockserver/internal/sdk/models/components/contentdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/contentinsightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/contenttype.go create mode 100644 tests/mockserver/internal/sdk/models/components/countinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/createannouncementrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/createanswerrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/createauthtokenresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/createcollectionrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/createcollectionresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/createdlpreportrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/createdlpreportresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/createshortcutrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/createshortcutresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/customdatasourceconfig.go create mode 100644 tests/mockserver/internal/sdk/models/components/customdatavalue.go create mode 100644 tests/mockserver/internal/sdk/models/components/customentity.go create mode 100644 tests/mockserver/internal/sdk/models/components/customentitymetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/customer.go create mode 100644 tests/mockserver/internal/sdk/models/components/customermetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/customfielddata.go create mode 100644 tests/mockserver/internal/sdk/models/components/customfieldvalue.go create mode 100644 tests/mockserver/internal/sdk/models/components/customfieldvaluehyperlink.go create mode 100644 tests/mockserver/internal/sdk/models/components/customfieldvalueperson.go create mode 100644 tests/mockserver/internal/sdk/models/components/customfieldvaluestr.go create mode 100644 tests/mockserver/internal/sdk/models/components/customproperty.go create mode 100644 tests/mockserver/internal/sdk/models/components/datasourcebulkmembershipdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/datasourcegroupdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/datasourcemembershipdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/datasourceobjecttypedocumentcountentry.go create mode 100644 tests/mockserver/internal/sdk/models/components/datasourceprofile.go create mode 100644 tests/mockserver/internal/sdk/models/components/datasourceuserdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/debugdatasourcestatusidentityresponsecomponent.go create mode 100644 tests/mockserver/internal/sdk/models/components/debugdatasourcestatusresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/debugdocumentrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/debugdocumentresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/debugdocumentsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/debugdocumentsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/debugdocumentsresponseitem.go create mode 100644 tests/mockserver/internal/sdk/models/components/debuguserrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/debuguserresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/deleteannouncementrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deleteanswerrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletechatfilesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletechatsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletecollectionitemrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletecollectionitemresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletecollectionrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletedocumentrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deleteemployeerequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletegrouprequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deletemembershiprequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deleteshortcutrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deleteteamrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/deleteuserrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/disambiguation.go create mode 100644 tests/mockserver/internal/sdk/models/components/displayablelistitemuiconfig.go create mode 100644 tests/mockserver/internal/sdk/models/components/dlpconfig.go create mode 100644 tests/mockserver/internal/sdk/models/components/dlpfrequency.go create mode 100644 tests/mockserver/internal/sdk/models/components/dlpperson.go create mode 100644 tests/mockserver/internal/sdk/models/components/dlppersonmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/dlpreport.go create mode 100644 tests/mockserver/internal/sdk/models/components/dlpreportstatus.go create mode 100644 tests/mockserver/internal/sdk/models/components/dlpsimpleresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/document.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentcontent.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentinsight.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentinteractions.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentinteractionsdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentorerrorunion.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentpermissionsdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentsection.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentspecunion.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentstatusresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentvisibility.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentvisibilityoverride.go create mode 100644 tests/mockserver/internal/sdk/models/components/documentvisibilityupdateresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/editanswerrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/editcollectionitemrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/editcollectionitemresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/editcollectionrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/editcollectionresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/editpinrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/employeeinfodefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/employeeteaminfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/entitiessortorder.go create mode 100644 tests/mockserver/internal/sdk/models/components/entityrelationship.go create mode 100644 tests/mockserver/internal/sdk/models/components/entitytype.go create mode 100644 tests/mockserver/internal/sdk/models/components/errormessage.go create mode 100644 tests/mockserver/internal/sdk/models/components/eventclassification.go create mode 100644 tests/mockserver/internal/sdk/models/components/eventclassificationname.go create mode 100644 tests/mockserver/internal/sdk/models/components/eventstrategyname.go create mode 100644 tests/mockserver/internal/sdk/models/components/externalsharingoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/externalshortcut.go create mode 100644 tests/mockserver/internal/sdk/models/components/extractedqna.go create mode 100644 tests/mockserver/internal/sdk/models/components/facetbucket.go create mode 100644 tests/mockserver/internal/sdk/models/components/facetbucketfilter.go create mode 100644 tests/mockserver/internal/sdk/models/components/facetfilter.go create mode 100644 tests/mockserver/internal/sdk/models/components/facetfilterset.go create mode 100644 tests/mockserver/internal/sdk/models/components/facetfiltervalue.go create mode 100644 tests/mockserver/internal/sdk/models/components/facetresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/facetvalue.go create mode 100644 tests/mockserver/internal/sdk/models/components/favoriteinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/feedback.go create mode 100644 tests/mockserver/internal/sdk/models/components/feedbackchatexchange.go create mode 100644 tests/mockserver/internal/sdk/models/components/feedentry.go create mode 100644 tests/mockserver/internal/sdk/models/components/feedrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/feedrequestoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/feedresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/feedresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/followupaction.go create mode 100644 tests/mockserver/internal/sdk/models/components/generatedattachment.go create mode 100644 tests/mockserver/internal/sdk/models/components/generatedattachmentcontent.go create mode 100644 tests/mockserver/internal/sdk/models/components/generatedqna.go create mode 100644 tests/mockserver/internal/sdk/models/components/getanswererror.go create mode 100644 tests/mockserver/internal/sdk/models/components/getanswerrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getanswerresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getchatapplicationrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getchatapplicationresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getchatfilesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getchatfilesresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getchatrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getchatresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getcollectionrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getcollectionresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdatasourceconfigrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdlpreportresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocpermissionsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocpermissionsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentcountrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentcountresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentstatusrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentstatusresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getdocumentvisibilityoverridesresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getpinrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getpinresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go create mode 100644 tests/mockserver/internal/sdk/models/components/getshortcutresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/getusercountrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/getusercountresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/gleanassistinsightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/gleandataerror.go create mode 100644 tests/mockserver/internal/sdk/models/components/grantpermission.go create mode 100644 tests/mockserver/internal/sdk/models/components/greenlistusersrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/group.go create mode 100644 tests/mockserver/internal/sdk/models/components/grouptype.go create mode 100644 tests/mockserver/internal/sdk/models/components/hotword.go create mode 100644 tests/mockserver/internal/sdk/models/components/hotwordproximity.go create mode 100644 tests/mockserver/internal/sdk/models/components/httpmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/iconconfig.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexdocumentrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexdocumentsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexemployeerequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexgrouprequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexingshortcut.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexmembershiprequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexstatus.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexteamrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/indexuserrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/inputoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/insightsagentsrequestoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/insightsaiapprequestoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/insightsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/insightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/invalidoperatorvalueerror.go create mode 100644 tests/mockserver/internal/sdk/models/components/inviteinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/labeledcountinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/listanswersrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/listanswersresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/listchatsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/listcollectionsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/listcollectionsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/listdlpreportsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/listentitiesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/listentitiesresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/listpinsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/listshortcutspaginatedrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/listshortcutspaginatedresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/manualfeedbackinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/meeting.go create mode 100644 tests/mockserver/internal/sdk/models/components/message.go create mode 100644 tests/mockserver/internal/sdk/models/components/messagesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/messagesresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/objectdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/objectpermissions.go create mode 100644 tests/mockserver/internal/sdk/models/components/operatormetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/operatorscope.go create mode 100644 tests/mockserver/internal/sdk/models/components/peoplerequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/peopleresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/period.go create mode 100644 tests/mockserver/internal/sdk/models/components/permissions.go create mode 100644 tests/mockserver/internal/sdk/models/components/permissionsgroupintersectiondefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/person.go create mode 100644 tests/mockserver/internal/sdk/models/components/persondistance.go create mode 100644 tests/mockserver/internal/sdk/models/components/personmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/personobject.go create mode 100644 tests/mockserver/internal/sdk/models/components/personteam.go create mode 100644 tests/mockserver/internal/sdk/models/components/persontoteamrelationship.go create mode 100644 tests/mockserver/internal/sdk/models/components/pindocument.go create mode 100644 tests/mockserver/internal/sdk/models/components/pinrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/possiblevalue.go create mode 100644 tests/mockserver/internal/sdk/models/components/processalldocumentsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/processallmembershipsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/processinghistoryevent.go create mode 100644 tests/mockserver/internal/sdk/models/components/prompttemplate.go create mode 100644 tests/mockserver/internal/sdk/models/components/prompttemplateresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/propertydefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/propertygroup.go create mode 100644 tests/mockserver/internal/sdk/models/components/queryinsight.go create mode 100644 tests/mockserver/internal/sdk/models/components/queryinsightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/querysuggestion.go create mode 100644 tests/mockserver/internal/sdk/models/components/querysuggestionlist.go create mode 100644 tests/mockserver/internal/sdk/models/components/quicklink.go create mode 100644 tests/mockserver/internal/sdk/models/components/reaction.go create mode 100644 tests/mockserver/internal/sdk/models/components/readpermission.go create mode 100644 tests/mockserver/internal/sdk/models/components/recommendationsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/recommendationsrequestoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/referencerange.go create mode 100644 tests/mockserver/internal/sdk/models/components/relateddocuments.go create mode 100644 tests/mockserver/internal/sdk/models/components/relatedobject.go create mode 100644 tests/mockserver/internal/sdk/models/components/relatedobjectedge.go create mode 100644 tests/mockserver/internal/sdk/models/components/relatedquestion.go create mode 100644 tests/mockserver/internal/sdk/models/components/reminder.go create mode 100644 tests/mockserver/internal/sdk/models/components/reminderrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/reportstatusresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/restrictionfilters.go create mode 100644 tests/mockserver/internal/sdk/models/components/resultsdescription.go create mode 100644 tests/mockserver/internal/sdk/models/components/resultsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/resulttab.go create mode 100644 tests/mockserver/internal/sdk/models/components/rotatetokenresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/scopetype.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchagentsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchagentsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchproviderinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchrequestinputdetails.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchrequestoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchresponsemetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchresultprominenceenum.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchresultsnippet.go create mode 100644 tests/mockserver/internal/sdk/models/components/searchwarning.go create mode 100644 tests/mockserver/internal/sdk/models/components/security.go create mode 100644 tests/mockserver/internal/sdk/models/components/seenfeedbackinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/sensitivecontentoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/sensitiveexpression.go create mode 100644 tests/mockserver/internal/sdk/models/components/sensitiveinfotype.go create mode 100644 tests/mockserver/internal/sdk/models/components/sessioninfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/share.go create mode 100644 tests/mockserver/internal/sdk/models/components/sharingoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/shortcut.go create mode 100644 tests/mockserver/internal/sdk/models/components/shortcuterror.go create mode 100644 tests/mockserver/internal/sdk/models/components/shortcutinsight.go create mode 100644 tests/mockserver/internal/sdk/models/components/shortcutinsightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/shortcutmutableproperties.go create mode 100644 tests/mockserver/internal/sdk/models/components/shortcutspaginationmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/socialnetwork.go create mode 100644 tests/mockserver/internal/sdk/models/components/socialnetworkdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/sortoptions.go create mode 100644 tests/mockserver/internal/sdk/models/components/structuredlink.go create mode 100644 tests/mockserver/internal/sdk/models/components/structuredlocation.go create mode 100644 tests/mockserver/internal/sdk/models/components/structuredresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/structuredtext.go create mode 100644 tests/mockserver/internal/sdk/models/components/structuredtextitem.go create mode 100644 tests/mockserver/internal/sdk/models/components/structuredtextmutableproperties.go create mode 100644 tests/mockserver/internal/sdk/models/components/summarizerequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/summarizeresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/summary.go create mode 100644 tests/mockserver/internal/sdk/models/components/team.go create mode 100644 tests/mockserver/internal/sdk/models/components/teamemail.go create mode 100644 tests/mockserver/internal/sdk/models/components/teaminfodefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/teammember.go create mode 100644 tests/mockserver/internal/sdk/models/components/textrange.go create mode 100644 tests/mockserver/internal/sdk/models/components/thumbnail.go create mode 100644 tests/mockserver/internal/sdk/models/components/timeinterval.go create mode 100644 tests/mockserver/internal/sdk/models/components/timepoint.go create mode 100644 tests/mockserver/internal/sdk/models/components/timerange.go create mode 100644 tests/mockserver/internal/sdk/models/components/tool.go create mode 100644 tests/mockserver/internal/sdk/models/components/toolinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/toolmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/toolparameter.go create mode 100644 tests/mockserver/internal/sdk/models/components/toolscallparameter.go create mode 100644 tests/mockserver/internal/sdk/models/components/toolscallrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/toolscallresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/toolslistresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/ugctype.go create mode 100644 tests/mockserver/internal/sdk/models/components/unpin.go create mode 100644 tests/mockserver/internal/sdk/models/components/updateannouncementrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/updatedlpconfigrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/updatedlpconfigresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/updatedlpreportrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/updatedlpreportresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/updatepermissionsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/updateshortcutrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/updateshortcutresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/uploadchatfilesresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/uploadshortcutsrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/uploadstatusenum.go create mode 100644 tests/mockserver/internal/sdk/models/components/user.go create mode 100644 tests/mockserver/internal/sdk/models/components/useractivity.go create mode 100644 tests/mockserver/internal/sdk/models/components/useractivityinsight.go create mode 100644 tests/mockserver/internal/sdk/models/components/usergeneratedcontentid.go create mode 100644 tests/mockserver/internal/sdk/models/components/userinsightsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/userreferencedefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/userrole.go create mode 100644 tests/mockserver/internal/sdk/models/components/userrolespecification.go create mode 100644 tests/mockserver/internal/sdk/models/components/userstatusresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/userviewinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/verification.go create mode 100644 tests/mockserver/internal/sdk/models/components/verificationfeed.go create mode 100644 tests/mockserver/internal/sdk/models/components/verificationmetadata.go create mode 100644 tests/mockserver/internal/sdk/models/components/verifyrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/viewerinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/workflow.go create mode 100644 tests/mockserver/internal/sdk/models/components/workflowfeedbackinfo.go create mode 100644 tests/mockserver/internal/sdk/models/components/workflowresult.go create mode 100644 tests/mockserver/internal/sdk/models/components/writeactionparameter.go create mode 100644 tests/mockserver/internal/sdk/models/components/writepermission.go create mode 100644 tests/mockserver/internal/sdk/models/operations/activity.go create mode 100644 tests/mockserver/internal/sdk/models/operations/addcollectionitems.go create mode 100644 tests/mockserver/internal/sdk/models/operations/addverificationreminder.go create mode 100644 tests/mockserver/internal/sdk/models/operations/adminsearch.go create mode 100644 tests/mockserver/internal/sdk/models/operations/autocomplete.go create mode 100644 tests/mockserver/internal/sdk/models/operations/chat.go create mode 100644 tests/mockserver/internal/sdk/models/operations/chatstream.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createandstreamrun.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createandwaitrun.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createannouncement.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createanswer.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createauthtoken.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createcollection.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createpolicy.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createreport.go create mode 100644 tests/mockserver/internal/sdk/models/operations/createshortcut.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deleteallchats.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deleteannouncement.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deleteanswer.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deletechatfiles.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deletechats.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deletecollection.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deletecollectionitem.go create mode 100644 tests/mockserver/internal/sdk/models/operations/deleteshortcut.go create mode 100644 tests/mockserver/internal/sdk/models/operations/downloadpolicycsv.go create mode 100644 tests/mockserver/internal/sdk/models/operations/downloadreportcsv.go create mode 100644 tests/mockserver/internal/sdk/models/operations/editanswer.go create mode 100644 tests/mockserver/internal/sdk/models/operations/editcollection.go create mode 100644 tests/mockserver/internal/sdk/models/operations/editcollectionitem.go create mode 100644 tests/mockserver/internal/sdk/models/operations/editpin.go create mode 100644 tests/mockserver/internal/sdk/models/operations/feed.go create mode 100644 tests/mockserver/internal/sdk/models/operations/feedback.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getagent.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getagentschemas.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getanswer.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getchat.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getchatapplication.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getchatfiles.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getcollection.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getdocpermissions.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getdocuments.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getdocumentsbyfacets.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getdocvisibility.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getpin.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getpolicy.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getreportstatus.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getrestapiv1toolslist.go create mode 100644 tests/mockserver/internal/sdk/models/operations/getshortcut.go create mode 100644 tests/mockserver/internal/sdk/models/operations/insights.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listanswers.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listchats.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listcollections.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listentities.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listpins.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listpolicies.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listshortcuts.go create mode 100644 tests/mockserver/internal/sdk/models/operations/listverifications.go create mode 100644 tests/mockserver/internal/sdk/models/operations/messages.go create mode 100644 tests/mockserver/internal/sdk/models/operations/people.go create mode 100644 tests/mockserver/internal/sdk/models/operations/pin.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1betausers.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexdocuments.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexemployees.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexgroups.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexmemberships.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexshortcuts.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexteams.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexusers.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1checkdocumentaccess.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocument.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocuments.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcestatus.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourceuser.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1deletedocument.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteemployee.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1deletegroup.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1deletemembership.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteteam.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteuser.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1getdatasourceconfig.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentcount.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentstatus.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1getusercount.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocument.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocuments.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1indexemployee.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1indexgroup.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1indexmembership.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1indexteam.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1indexuser.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1processalldocuments.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1processallemployeesandteams.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1processallmemberships.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1rotatetoken.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1updatepermissions.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postapiindexv1uploadshortcuts.go create mode 100644 tests/mockserver/internal/sdk/models/operations/postrestapiv1toolscall.go create mode 100644 tests/mockserver/internal/sdk/models/operations/recommendations.go create mode 100644 tests/mockserver/internal/sdk/models/operations/search.go create mode 100644 tests/mockserver/internal/sdk/models/operations/searchagents.go create mode 100644 tests/mockserver/internal/sdk/models/operations/setdocvisibility.go create mode 100644 tests/mockserver/internal/sdk/models/operations/summarize.go create mode 100644 tests/mockserver/internal/sdk/models/operations/unpin.go create mode 100644 tests/mockserver/internal/sdk/models/operations/updateannouncement.go create mode 100644 tests/mockserver/internal/sdk/models/operations/updatepolicy.go create mode 100644 tests/mockserver/internal/sdk/models/operations/updateshortcut.go create mode 100644 tests/mockserver/internal/sdk/models/operations/uploadchatfiles.go create mode 100644 tests/mockserver/internal/sdk/models/operations/verify.go create mode 100644 tests/mockserver/internal/sdk/models/sdkerrors/collectionerror.go create mode 100644 tests/mockserver/internal/sdk/models/sdkerrors/gleandataerror.go create mode 100644 tests/mockserver/internal/sdk/types/bigint.go create mode 100644 tests/mockserver/internal/sdk/types/date.go create mode 100644 tests/mockserver/internal/sdk/types/datetime.go create mode 100644 tests/mockserver/internal/sdk/types/decimal.go create mode 100644 tests/mockserver/internal/sdk/types/jsonl/jsonl.go create mode 100644 tests/mockserver/internal/sdk/types/pointers.go create mode 100644 tests/mockserver/internal/sdk/utils/json.go create mode 100644 tests/mockserver/internal/sdk/utils/reflect.go create mode 100644 tests/mockserver/internal/sdk/utils/sort.go create mode 100644 tests/mockserver/internal/server/doc.go create mode 100644 tests/mockserver/internal/server/generated_handlers.go create mode 100644 tests/mockserver/internal/server/internal_handlers.go create mode 100644 tests/mockserver/internal/server/server.go create mode 100644 tests/mockserver/internal/server/server_option.go create mode 100644 tests/mockserver/internal/server/templates/log/index.html.tmpl create mode 100644 tests/mockserver/internal/server/templates/log/operation.html.tmpl create mode 100644 tests/mockserver/internal/server/templates/log/style.css.tmpl create mode 100644 tests/mockserver/internal/tracking/requesttracker.go create mode 100644 tests/mockserver/main.go create mode 100644 tests/mockserver/testdata/example.file diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 75df01a2..4e0f7f37 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 0359d4fe-2923-46fc-aaca-cf70b48dcfa1 management: - docChecksum: 6cb4c4786bf30fecfc20b38750d745eb + docChecksum: bb65a174a6b697994f7bde3845843d9d docVersion: 0.9.0 - speakeasyVersion: 1.563.2 - generationVersion: 2.629.2 - releaseVersion: 0.5.6 - configChecksum: a3fcc2f551abcd371f1891c11a1cf24a + speakeasyVersion: 1.576.1 + generationVersion: 2.651.2 + releaseVersion: 0.6.0 + configChecksum: 36947d923e8382f9287cbfeee1bf3f84 repoURL: https://github.com/gleanwork/api-client-java.git published: true features: @@ -14,18 +14,19 @@ features: additionalDependencies: 0.1.0 additionalProperties: 0.0.1 constsAndDefaults: 0.1.1 - core: 3.39.0 + core: 3.42.3 deprecations: 2.81.1 examples: 2.81.5 flattening: 2.81.1 - globalSecurity: 2.82.8 + globalSecurity: 2.83.0 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.2 groups: 2.81.2 + mockServer: 0.1.1 nameOverrides: 2.81.3 sdkHooks: 1.1.0 - tests: 0.8.4 + tests: 0.9.1 unions: 0.0.6 generatedFiles: - .gitattributes @@ -439,6 +440,7 @@ generatedFiles: - docs/models/components/ReminderRequest.md - docs/models/components/ReportStatusResponse.md - docs/models/components/ReportStatusResponseStatus.md + - docs/models/components/RequestType.md - docs/models/components/ResponseHint.md - docs/models/components/ResponseStatus.md - docs/models/components/RestrictionFilters.md @@ -1178,6 +1180,7 @@ generatedFiles: - src/main/java/com/glean/api_client/glean_api_client/models/components/ReminderRequest.java - src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponse.java - src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponseStatus.java + - src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java - src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseHint.java - src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseStatus.java - src/main/java/com/glean/api_client/glean_api_client/models/components/RestrictionFilters.java @@ -1529,7 +1532,6 @@ generatedFiles: - src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallResponse.java - src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsRequestBuilder.java - src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsResponse.java - - src/main/java/com/glean/api_client/glean_api_client/models/operations/SDKMethodInterfaces.java - src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsRequestBuilder.java - src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsResponse.java - src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchRequestBuilder.java @@ -1552,16 +1554,129 @@ generatedFiles: - src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesResponse.java - src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyRequestBuilder.java - src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyResponse.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ActivityOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/AddcollectionitemsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/AddverificationreminderOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/AdminsearchOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/AutocompleteOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ChatOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ChatStreamOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndStreamRunOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndWaitRunOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreateannouncementOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreateanswerOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreateauthtokenOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreatecollectionOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreatepolicyOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreatereportOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/CreateshortcutOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeleteallchatsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeleteannouncementOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeleteanswerOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatfilesOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionitemOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DeleteshortcutOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DownloadpolicycsvOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/DownloadreportcsvOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/EditanswerOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionitemOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/EditpinOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/FeedOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/FeedbackOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentSchemasOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetRestApiV1ToolsListOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetanswerOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetchatOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetchatapplicationOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetchatfilesOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetcollectionOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetdocpermissionsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsbyfacetsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetdocvisibilityOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetpinOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetpolicyOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetreportstatusOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/GetshortcutOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/InsightsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListanswersOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListchatsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListcollectionsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListentitiesOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListpinsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListpoliciesOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListshortcutsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/ListverificationsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/MessagesOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/Operations.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PeopleOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PinOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1AdddatasourceOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BetausersOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexdocumentsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexemployeesOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexgroupsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexmembershipsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexshortcutsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexteamsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexusersOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1CheckdocumentaccessOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceStatusOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceUserOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletedocumentOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteemployeeOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletegroupOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletemembershipOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteteamOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteuserOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdatasourceconfigOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentcountOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentstatusOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetusercountOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexemployeeOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexgroupOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexmembershipOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexteamOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexuserOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessalldocumentsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallemployeesandteamsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallmembershipsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1RotatetokenOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UpdatepermissionsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UploadshortcutsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/PostRestApiV1ToolsCallOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/RecommendationsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/SearchAgentsOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/SearchOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/SetdocvisibilityOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/SummarizeOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/UnpinOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/UpdateannouncementOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/UpdatepolicyOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/UpdateshortcutOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/UploadchatfilesOperation.java + - src/main/java/com/glean/api_client/glean_api_client/operations/VerifyOperation.java - src/main/java/com/glean/api_client/glean_api_client/utils/BackoffStrategy.java - src/main/java/com/glean/api_client/glean_api_client/utils/BigDecimalString.java - src/main/java/com/glean/api_client/glean_api_client/utils/BigIntegerString.java - src/main/java/com/glean/api_client/glean_api_client/utils/Constants.java + - src/main/java/com/glean/api_client/glean_api_client/utils/CopiableInputStream.java - src/main/java/com/glean/api_client/glean_api_client/utils/Deserializers.java - src/main/java/com/glean/api_client/glean_api_client/utils/EventStream.java - src/main/java/com/glean/api_client/glean_api_client/utils/EventStreamLineReader.java - src/main/java/com/glean/api_client/glean_api_client/utils/EventStreamMessage.java - src/main/java/com/glean/api_client/glean_api_client/utils/EventStreamReader.java + - src/main/java/com/glean/api_client/glean_api_client/utils/Exceptions.java - src/main/java/com/glean/api_client/glean_api_client/utils/FormMetadata.java + - src/main/java/com/glean/api_client/glean_api_client/utils/Globals.java - src/main/java/com/glean/api_client/glean_api_client/utils/HTTPClient.java - src/main/java/com/glean/api_client/glean_api_client/utils/HTTPRequest.java - src/main/java/com/glean/api_client/glean_api_client/utils/HasSecurity.java @@ -1628,6 +1743,652 @@ generatedFiles: - src/test/java/com/glean/api_client/glean_api_client/ToolsTests.java - src/test/java/com/glean/api_client/glean_api_client/TroubleshootingTests.java - src/test/java/com/glean/api_client/glean_api_client/VisibilityoverridesTests.java + - tests/mockserver/.gitignore + - tests/mockserver/Dockerfile + - tests/mockserver/Makefile + - tests/mockserver/README.md + - tests/mockserver/go.mod + - tests/mockserver/go.sum + - tests/mockserver/internal/handler/assert/contenttype.go + - tests/mockserver/internal/handler/assert/header.go + - tests/mockserver/internal/handler/assert/parameter.go + - tests/mockserver/internal/handler/assert/pointer.go + - tests/mockserver/internal/handler/assert/security.go + - tests/mockserver/internal/handler/doc.go + - tests/mockserver/internal/handler/generated_handler.go + - tests/mockserver/internal/handler/generated_handlers.go + - tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go + - tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go + - tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go + - tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go + - tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go + - tests/mockserver/internal/handler/pathpostapiindexv1adddatasource.go + - tests/mockserver/internal/handler/pathpostapiindexv1betausers.go + - tests/mockserver/internal/handler/pathpostapiindexv1bulkindexdocuments.go + - tests/mockserver/internal/handler/pathpostapiindexv1bulkindexgroups.go + - tests/mockserver/internal/handler/pathpostapiindexv1bulkindexmemberships.go + - tests/mockserver/internal/handler/pathpostapiindexv1bulkindexusers.go + - tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go + - tests/mockserver/internal/handler/pathpostapiindexv1deletedocument.go + - tests/mockserver/internal/handler/pathpostapiindexv1deletegroup.go + - tests/mockserver/internal/handler/pathpostapiindexv1deletemembership.go + - tests/mockserver/internal/handler/pathpostapiindexv1deleteuser.go + - tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go + - tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go + - tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go + - tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go + - tests/mockserver/internal/handler/pathpostapiindexv1indexdocument.go + - tests/mockserver/internal/handler/pathpostapiindexv1indexdocuments.go + - tests/mockserver/internal/handler/pathpostapiindexv1indexgroup.go + - tests/mockserver/internal/handler/pathpostapiindexv1indexmembership.go + - tests/mockserver/internal/handler/pathpostapiindexv1indexuser.go + - tests/mockserver/internal/handler/pathpostapiindexv1processalldocuments.go + - tests/mockserver/internal/handler/pathpostapiindexv1processallemployeesandteams.go + - tests/mockserver/internal/handler/pathpostapiindexv1processallmemberships.go + - tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go + - tests/mockserver/internal/handler/pathpostapiindexv1updatepermissions.go + - tests/mockserver/internal/handler/pathpostrestapiv1activity.go + - tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go + - tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go + - tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go + - tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go + - tests/mockserver/internal/handler/pathpostrestapiv1chat.go + - tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go + - tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go + - tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go + - tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go + - tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go + - tests/mockserver/internal/handler/pathpostrestapiv1deleteallchats.go + - tests/mockserver/internal/handler/pathpostrestapiv1deleteannouncement.go + - tests/mockserver/internal/handler/pathpostrestapiv1deleteanswer.go + - tests/mockserver/internal/handler/pathpostrestapiv1deletechatfiles.go + - tests/mockserver/internal/handler/pathpostrestapiv1deletechats.go + - tests/mockserver/internal/handler/pathpostrestapiv1deletecollection.go + - tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go + - tests/mockserver/internal/handler/pathpostrestapiv1deleteshortcut.go + - tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go + - tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go + - tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go + - tests/mockserver/internal/handler/pathpostrestapiv1editpin.go + - tests/mockserver/internal/handler/pathpostrestapiv1feed.go + - tests/mockserver/internal/handler/pathpostrestapiv1feedback.go + - tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go + - tests/mockserver/internal/handler/pathpostrestapiv1getchat.go + - tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go + - tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go + - tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go + - tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go + - tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go + - tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go + - tests/mockserver/internal/handler/pathpostrestapiv1getpin.go + - tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go + - tests/mockserver/internal/handler/pathpostrestapiv1insights.go + - tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go + - tests/mockserver/internal/handler/pathpostrestapiv1listchats.go + - tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go + - tests/mockserver/internal/handler/pathpostrestapiv1listentities.go + - tests/mockserver/internal/handler/pathpostrestapiv1listpins.go + - tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go + - tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go + - tests/mockserver/internal/handler/pathpostrestapiv1messages.go + - tests/mockserver/internal/handler/pathpostrestapiv1people.go + - tests/mockserver/internal/handler/pathpostrestapiv1pin.go + - tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go + - tests/mockserver/internal/handler/pathpostrestapiv1search.go + - tests/mockserver/internal/handler/pathpostrestapiv1summarize.go + - tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go + - tests/mockserver/internal/handler/pathpostrestapiv1unpin.go + - tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go + - tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go + - tests/mockserver/internal/handler/pathpostrestapiv1verify.go + - tests/mockserver/internal/handler/values/files.go + - tests/mockserver/internal/logging/doc.go + - tests/mockserver/internal/logging/formats.go + - tests/mockserver/internal/logging/http_file.go + - tests/mockserver/internal/logging/http_logger.go + - tests/mockserver/internal/logging/levels.go + - tests/mockserver/internal/logging/logger.go + - tests/mockserver/internal/logging/oas_operation.go + - tests/mockserver/internal/logging/oas_operation_call.go + - tests/mockserver/internal/sdk/models/components/activity.go + - tests/mockserver/internal/sdk/models/components/activityevent.go + - tests/mockserver/internal/sdk/models/components/activityeventparams.go + - tests/mockserver/internal/sdk/models/components/addcollectionitemserror.go + - tests/mockserver/internal/sdk/models/components/addcollectionitemsrequest.go + - tests/mockserver/internal/sdk/models/components/addcollectionitemsresponse.go + - tests/mockserver/internal/sdk/models/components/additionalfielddefinition.go + - tests/mockserver/internal/sdk/models/components/agent.go + - tests/mockserver/internal/sdk/models/components/agentconfig.go + - tests/mockserver/internal/sdk/models/components/agentexecutionstatus.go + - tests/mockserver/internal/sdk/models/components/agentrun.go + - tests/mockserver/internal/sdk/models/components/agentruncreate.go + - tests/mockserver/internal/sdk/models/components/agentrunwaitresponse.go + - tests/mockserver/internal/sdk/models/components/agentschemas.go + - tests/mockserver/internal/sdk/models/components/aiappactioncounts.go + - tests/mockserver/internal/sdk/models/components/aiappsinsightsresponse.go + - tests/mockserver/internal/sdk/models/components/aiinsightsresponse.go + - tests/mockserver/internal/sdk/models/components/allowlistoptions.go + - tests/mockserver/internal/sdk/models/components/announcement.go + - tests/mockserver/internal/sdk/models/components/anonymousevent.go + - tests/mockserver/internal/sdk/models/components/answer.go + - tests/mockserver/internal/sdk/models/components/answerboard.go + - tests/mockserver/internal/sdk/models/components/answercreationdata.go + - tests/mockserver/internal/sdk/models/components/answerlike.go + - tests/mockserver/internal/sdk/models/components/answerlikes.go + - tests/mockserver/internal/sdk/models/components/answerresult.go + - tests/mockserver/internal/sdk/models/components/appresult.go + - tests/mockserver/internal/sdk/models/components/authconfig.go + - tests/mockserver/internal/sdk/models/components/authtoken.go + - tests/mockserver/internal/sdk/models/components/autocompleterequest.go + - tests/mockserver/internal/sdk/models/components/autocompleteresponse.go + - tests/mockserver/internal/sdk/models/components/autocompleteresult.go + - tests/mockserver/internal/sdk/models/components/autocompleteresultgroup.go + - tests/mockserver/internal/sdk/models/components/badge.go + - tests/mockserver/internal/sdk/models/components/bulkindexdocumentsrequest.go + - tests/mockserver/internal/sdk/models/components/bulkindexemployeesrequest.go + - tests/mockserver/internal/sdk/models/components/bulkindexgroupsrequest.go + - tests/mockserver/internal/sdk/models/components/bulkindexmembershipsrequest.go + - tests/mockserver/internal/sdk/models/components/bulkindexshortcutsrequest.go + - tests/mockserver/internal/sdk/models/components/bulkindexteamsrequest.go + - tests/mockserver/internal/sdk/models/components/bulkindexusersrequest.go + - tests/mockserver/internal/sdk/models/components/bulkuploadhistoryevent.go + - tests/mockserver/internal/sdk/models/components/calendarattendee.go + - tests/mockserver/internal/sdk/models/components/calendarattendees.go + - tests/mockserver/internal/sdk/models/components/calendarevent.go + - tests/mockserver/internal/sdk/models/components/canonicalizingregextype.go + - tests/mockserver/internal/sdk/models/components/channelinviteinfo.go + - tests/mockserver/internal/sdk/models/components/chat.go + - tests/mockserver/internal/sdk/models/components/chatfile.go + - tests/mockserver/internal/sdk/models/components/chatfilefailurereason.go + - tests/mockserver/internal/sdk/models/components/chatfilemetadata.go + - tests/mockserver/internal/sdk/models/components/chatfilestatus.go + - tests/mockserver/internal/sdk/models/components/chatmessage.go + - tests/mockserver/internal/sdk/models/components/chatmessagecitation.go + - tests/mockserver/internal/sdk/models/components/chatmessagefragment.go + - tests/mockserver/internal/sdk/models/components/chatmetadata.go + - tests/mockserver/internal/sdk/models/components/chatmetadataresult.go + - tests/mockserver/internal/sdk/models/components/chatrequest.go + - tests/mockserver/internal/sdk/models/components/chatresponse.go + - tests/mockserver/internal/sdk/models/components/chatrestrictionfilters.go + - tests/mockserver/internal/sdk/models/components/chatresult.go + - tests/mockserver/internal/sdk/models/components/chatzerostatesuggestionoptions.go + - tests/mockserver/internal/sdk/models/components/checkdocumentaccessrequest.go + - tests/mockserver/internal/sdk/models/components/checkdocumentaccessresponse.go + - tests/mockserver/internal/sdk/models/components/clustergroup.go + - tests/mockserver/internal/sdk/models/components/clustertypeenum.go + - tests/mockserver/internal/sdk/models/components/code.go + - tests/mockserver/internal/sdk/models/components/codeline.go + - tests/mockserver/internal/sdk/models/components/collection.go + - tests/mockserver/internal/sdk/models/components/collectionerror.go + - tests/mockserver/internal/sdk/models/components/collectionitem.go + - tests/mockserver/internal/sdk/models/components/collectionitemdescriptor.go + - tests/mockserver/internal/sdk/models/components/collectionpinmetadata.go + - tests/mockserver/internal/sdk/models/components/collectionpinnablecategories.go + - tests/mockserver/internal/sdk/models/components/collectionpinnabletargets.go + - tests/mockserver/internal/sdk/models/components/collectionpinnedmetadata.go + - tests/mockserver/internal/sdk/models/components/collectionpintarget.go + - tests/mockserver/internal/sdk/models/components/commentdefinition.go + - tests/mockserver/internal/sdk/models/components/communicationchannel.go + - tests/mockserver/internal/sdk/models/components/company.go + - tests/mockserver/internal/sdk/models/components/conferencedata.go + - tests/mockserver/internal/sdk/models/components/connectortype.go + - tests/mockserver/internal/sdk/models/components/contentdefinition.go + - tests/mockserver/internal/sdk/models/components/contentinsightsresponse.go + - tests/mockserver/internal/sdk/models/components/contenttype.go + - tests/mockserver/internal/sdk/models/components/countinfo.go + - tests/mockserver/internal/sdk/models/components/createannouncementrequest.go + - tests/mockserver/internal/sdk/models/components/createanswerrequest.go + - tests/mockserver/internal/sdk/models/components/createauthtokenresponse.go + - tests/mockserver/internal/sdk/models/components/createcollectionrequest.go + - tests/mockserver/internal/sdk/models/components/createcollectionresponse.go + - tests/mockserver/internal/sdk/models/components/createdlpreportrequest.go + - tests/mockserver/internal/sdk/models/components/createdlpreportresponse.go + - tests/mockserver/internal/sdk/models/components/createshortcutrequest.go + - tests/mockserver/internal/sdk/models/components/createshortcutresponse.go + - tests/mockserver/internal/sdk/models/components/customdatasourceconfig.go + - tests/mockserver/internal/sdk/models/components/customdatavalue.go + - tests/mockserver/internal/sdk/models/components/customentity.go + - tests/mockserver/internal/sdk/models/components/customentitymetadata.go + - tests/mockserver/internal/sdk/models/components/customer.go + - tests/mockserver/internal/sdk/models/components/customermetadata.go + - tests/mockserver/internal/sdk/models/components/customfielddata.go + - tests/mockserver/internal/sdk/models/components/customfieldvalue.go + - tests/mockserver/internal/sdk/models/components/customfieldvaluehyperlink.go + - tests/mockserver/internal/sdk/models/components/customfieldvalueperson.go + - tests/mockserver/internal/sdk/models/components/customfieldvaluestr.go + - tests/mockserver/internal/sdk/models/components/customproperty.go + - tests/mockserver/internal/sdk/models/components/datasourcebulkmembershipdefinition.go + - tests/mockserver/internal/sdk/models/components/datasourcegroupdefinition.go + - tests/mockserver/internal/sdk/models/components/datasourcemembershipdefinition.go + - tests/mockserver/internal/sdk/models/components/datasourceobjecttypedocumentcountentry.go + - tests/mockserver/internal/sdk/models/components/datasourceprofile.go + - tests/mockserver/internal/sdk/models/components/datasourceuserdefinition.go + - tests/mockserver/internal/sdk/models/components/debugdatasourcestatusidentityresponsecomponent.go + - tests/mockserver/internal/sdk/models/components/debugdatasourcestatusresponse.go + - tests/mockserver/internal/sdk/models/components/debugdocumentrequest.go + - tests/mockserver/internal/sdk/models/components/debugdocumentresponse.go + - tests/mockserver/internal/sdk/models/components/debugdocumentsrequest.go + - tests/mockserver/internal/sdk/models/components/debugdocumentsresponse.go + - tests/mockserver/internal/sdk/models/components/debugdocumentsresponseitem.go + - tests/mockserver/internal/sdk/models/components/debuguserrequest.go + - tests/mockserver/internal/sdk/models/components/debuguserresponse.go + - tests/mockserver/internal/sdk/models/components/deleteannouncementrequest.go + - tests/mockserver/internal/sdk/models/components/deleteanswerrequest.go + - tests/mockserver/internal/sdk/models/components/deletechatfilesrequest.go + - tests/mockserver/internal/sdk/models/components/deletechatsrequest.go + - tests/mockserver/internal/sdk/models/components/deletecollectionitemrequest.go + - tests/mockserver/internal/sdk/models/components/deletecollectionitemresponse.go + - tests/mockserver/internal/sdk/models/components/deletecollectionrequest.go + - tests/mockserver/internal/sdk/models/components/deletedocumentrequest.go + - tests/mockserver/internal/sdk/models/components/deleteemployeerequest.go + - tests/mockserver/internal/sdk/models/components/deletegrouprequest.go + - tests/mockserver/internal/sdk/models/components/deletemembershiprequest.go + - tests/mockserver/internal/sdk/models/components/deleteshortcutrequest.go + - tests/mockserver/internal/sdk/models/components/deleteteamrequest.go + - tests/mockserver/internal/sdk/models/components/deleteuserrequest.go + - tests/mockserver/internal/sdk/models/components/disambiguation.go + - tests/mockserver/internal/sdk/models/components/displayablelistitemuiconfig.go + - tests/mockserver/internal/sdk/models/components/dlpconfig.go + - tests/mockserver/internal/sdk/models/components/dlpfrequency.go + - tests/mockserver/internal/sdk/models/components/dlpperson.go + - tests/mockserver/internal/sdk/models/components/dlppersonmetadata.go + - tests/mockserver/internal/sdk/models/components/dlpreport.go + - tests/mockserver/internal/sdk/models/components/dlpreportstatus.go + - tests/mockserver/internal/sdk/models/components/dlpsimpleresult.go + - tests/mockserver/internal/sdk/models/components/document.go + - tests/mockserver/internal/sdk/models/components/documentcontent.go + - tests/mockserver/internal/sdk/models/components/documentdefinition.go + - tests/mockserver/internal/sdk/models/components/documentinsight.go + - tests/mockserver/internal/sdk/models/components/documentinteractions.go + - tests/mockserver/internal/sdk/models/components/documentinteractionsdefinition.go + - tests/mockserver/internal/sdk/models/components/documentmetadata.go + - tests/mockserver/internal/sdk/models/components/documentorerrorunion.go + - tests/mockserver/internal/sdk/models/components/documentpermissionsdefinition.go + - tests/mockserver/internal/sdk/models/components/documentsection.go + - tests/mockserver/internal/sdk/models/components/documentspecunion.go + - tests/mockserver/internal/sdk/models/components/documentstatusresponse.go + - tests/mockserver/internal/sdk/models/components/documentvisibility.go + - tests/mockserver/internal/sdk/models/components/documentvisibilityoverride.go + - tests/mockserver/internal/sdk/models/components/documentvisibilityupdateresult.go + - tests/mockserver/internal/sdk/models/components/editanswerrequest.go + - tests/mockserver/internal/sdk/models/components/editcollectionitemrequest.go + - tests/mockserver/internal/sdk/models/components/editcollectionitemresponse.go + - tests/mockserver/internal/sdk/models/components/editcollectionrequest.go + - tests/mockserver/internal/sdk/models/components/editcollectionresponse.go + - tests/mockserver/internal/sdk/models/components/editpinrequest.go + - tests/mockserver/internal/sdk/models/components/employeeinfodefinition.go + - tests/mockserver/internal/sdk/models/components/employeeteaminfo.go + - tests/mockserver/internal/sdk/models/components/entitiessortorder.go + - tests/mockserver/internal/sdk/models/components/entityrelationship.go + - tests/mockserver/internal/sdk/models/components/entitytype.go + - tests/mockserver/internal/sdk/models/components/errormessage.go + - tests/mockserver/internal/sdk/models/components/eventclassification.go + - tests/mockserver/internal/sdk/models/components/eventclassificationname.go + - tests/mockserver/internal/sdk/models/components/eventstrategyname.go + - tests/mockserver/internal/sdk/models/components/externalsharingoptions.go + - tests/mockserver/internal/sdk/models/components/externalshortcut.go + - tests/mockserver/internal/sdk/models/components/extractedqna.go + - tests/mockserver/internal/sdk/models/components/facetbucket.go + - tests/mockserver/internal/sdk/models/components/facetbucketfilter.go + - tests/mockserver/internal/sdk/models/components/facetfilter.go + - tests/mockserver/internal/sdk/models/components/facetfilterset.go + - tests/mockserver/internal/sdk/models/components/facetfiltervalue.go + - tests/mockserver/internal/sdk/models/components/facetresult.go + - tests/mockserver/internal/sdk/models/components/facetvalue.go + - tests/mockserver/internal/sdk/models/components/favoriteinfo.go + - tests/mockserver/internal/sdk/models/components/feedback.go + - tests/mockserver/internal/sdk/models/components/feedbackchatexchange.go + - tests/mockserver/internal/sdk/models/components/feedentry.go + - tests/mockserver/internal/sdk/models/components/feedrequest.go + - tests/mockserver/internal/sdk/models/components/feedrequestoptions.go + - tests/mockserver/internal/sdk/models/components/feedresponse.go + - tests/mockserver/internal/sdk/models/components/feedresult.go + - tests/mockserver/internal/sdk/models/components/followupaction.go + - tests/mockserver/internal/sdk/models/components/generatedattachment.go + - tests/mockserver/internal/sdk/models/components/generatedattachmentcontent.go + - tests/mockserver/internal/sdk/models/components/generatedqna.go + - tests/mockserver/internal/sdk/models/components/getanswererror.go + - tests/mockserver/internal/sdk/models/components/getanswerrequest.go + - tests/mockserver/internal/sdk/models/components/getanswerresponse.go + - tests/mockserver/internal/sdk/models/components/getchatapplicationrequest.go + - tests/mockserver/internal/sdk/models/components/getchatapplicationresponse.go + - tests/mockserver/internal/sdk/models/components/getchatfilesrequest.go + - tests/mockserver/internal/sdk/models/components/getchatfilesresponse.go + - tests/mockserver/internal/sdk/models/components/getchatrequest.go + - tests/mockserver/internal/sdk/models/components/getchatresponse.go + - tests/mockserver/internal/sdk/models/components/getcollectionrequest.go + - tests/mockserver/internal/sdk/models/components/getcollectionresponse.go + - tests/mockserver/internal/sdk/models/components/getdatasourceconfigrequest.go + - tests/mockserver/internal/sdk/models/components/getdlpreportresponse.go + - tests/mockserver/internal/sdk/models/components/getdocpermissionsrequest.go + - tests/mockserver/internal/sdk/models/components/getdocpermissionsresponse.go + - tests/mockserver/internal/sdk/models/components/getdocumentcountrequest.go + - tests/mockserver/internal/sdk/models/components/getdocumentcountresponse.go + - tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsrequest.go + - tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsresponse.go + - tests/mockserver/internal/sdk/models/components/getdocumentsrequest.go + - tests/mockserver/internal/sdk/models/components/getdocumentsresponse.go + - tests/mockserver/internal/sdk/models/components/getdocumentstatusrequest.go + - tests/mockserver/internal/sdk/models/components/getdocumentstatusresponse.go + - tests/mockserver/internal/sdk/models/components/getdocumentvisibilityoverridesresponse.go + - tests/mockserver/internal/sdk/models/components/getpinrequest.go + - tests/mockserver/internal/sdk/models/components/getpinresponse.go + - tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go + - tests/mockserver/internal/sdk/models/components/getshortcutresponse.go + - tests/mockserver/internal/sdk/models/components/getusercountrequest.go + - tests/mockserver/internal/sdk/models/components/getusercountresponse.go + - tests/mockserver/internal/sdk/models/components/gleanassistinsightsresponse.go + - tests/mockserver/internal/sdk/models/components/gleandataerror.go + - tests/mockserver/internal/sdk/models/components/grantpermission.go + - tests/mockserver/internal/sdk/models/components/greenlistusersrequest.go + - tests/mockserver/internal/sdk/models/components/group.go + - tests/mockserver/internal/sdk/models/components/grouptype.go + - tests/mockserver/internal/sdk/models/components/hotword.go + - tests/mockserver/internal/sdk/models/components/hotwordproximity.go + - tests/mockserver/internal/sdk/models/components/httpmetadata.go + - tests/mockserver/internal/sdk/models/components/iconconfig.go + - tests/mockserver/internal/sdk/models/components/indexdocumentrequest.go + - tests/mockserver/internal/sdk/models/components/indexdocumentsrequest.go + - tests/mockserver/internal/sdk/models/components/indexemployeerequest.go + - tests/mockserver/internal/sdk/models/components/indexgrouprequest.go + - tests/mockserver/internal/sdk/models/components/indexingshortcut.go + - tests/mockserver/internal/sdk/models/components/indexmembershiprequest.go + - tests/mockserver/internal/sdk/models/components/indexstatus.go + - tests/mockserver/internal/sdk/models/components/indexteamrequest.go + - tests/mockserver/internal/sdk/models/components/indexuserrequest.go + - tests/mockserver/internal/sdk/models/components/inputoptions.go + - tests/mockserver/internal/sdk/models/components/insightsagentsrequestoptions.go + - tests/mockserver/internal/sdk/models/components/insightsaiapprequestoptions.go + - tests/mockserver/internal/sdk/models/components/insightsrequest.go + - tests/mockserver/internal/sdk/models/components/insightsresponse.go + - tests/mockserver/internal/sdk/models/components/invalidoperatorvalueerror.go + - tests/mockserver/internal/sdk/models/components/inviteinfo.go + - tests/mockserver/internal/sdk/models/components/labeledcountinfo.go + - tests/mockserver/internal/sdk/models/components/listanswersrequest.go + - tests/mockserver/internal/sdk/models/components/listanswersresponse.go + - tests/mockserver/internal/sdk/models/components/listchatsresponse.go + - tests/mockserver/internal/sdk/models/components/listcollectionsrequest.go + - tests/mockserver/internal/sdk/models/components/listcollectionsresponse.go + - tests/mockserver/internal/sdk/models/components/listdlpreportsresponse.go + - tests/mockserver/internal/sdk/models/components/listentitiesrequest.go + - tests/mockserver/internal/sdk/models/components/listentitiesresponse.go + - tests/mockserver/internal/sdk/models/components/listpinsresponse.go + - tests/mockserver/internal/sdk/models/components/listshortcutspaginatedrequest.go + - tests/mockserver/internal/sdk/models/components/listshortcutspaginatedresponse.go + - tests/mockserver/internal/sdk/models/components/manualfeedbackinfo.go + - tests/mockserver/internal/sdk/models/components/meeting.go + - tests/mockserver/internal/sdk/models/components/message.go + - tests/mockserver/internal/sdk/models/components/messagesrequest.go + - tests/mockserver/internal/sdk/models/components/messagesresponse.go + - tests/mockserver/internal/sdk/models/components/objectdefinition.go + - tests/mockserver/internal/sdk/models/components/objectpermissions.go + - tests/mockserver/internal/sdk/models/components/operatormetadata.go + - tests/mockserver/internal/sdk/models/components/operatorscope.go + - tests/mockserver/internal/sdk/models/components/peoplerequest.go + - tests/mockserver/internal/sdk/models/components/peopleresponse.go + - tests/mockserver/internal/sdk/models/components/period.go + - tests/mockserver/internal/sdk/models/components/permissions.go + - tests/mockserver/internal/sdk/models/components/permissionsgroupintersectiondefinition.go + - tests/mockserver/internal/sdk/models/components/person.go + - tests/mockserver/internal/sdk/models/components/persondistance.go + - tests/mockserver/internal/sdk/models/components/personmetadata.go + - tests/mockserver/internal/sdk/models/components/personobject.go + - tests/mockserver/internal/sdk/models/components/personteam.go + - tests/mockserver/internal/sdk/models/components/persontoteamrelationship.go + - tests/mockserver/internal/sdk/models/components/pindocument.go + - tests/mockserver/internal/sdk/models/components/pinrequest.go + - tests/mockserver/internal/sdk/models/components/possiblevalue.go + - tests/mockserver/internal/sdk/models/components/processalldocumentsrequest.go + - tests/mockserver/internal/sdk/models/components/processallmembershipsrequest.go + - tests/mockserver/internal/sdk/models/components/processinghistoryevent.go + - tests/mockserver/internal/sdk/models/components/prompttemplate.go + - tests/mockserver/internal/sdk/models/components/prompttemplateresult.go + - tests/mockserver/internal/sdk/models/components/propertydefinition.go + - tests/mockserver/internal/sdk/models/components/propertygroup.go + - tests/mockserver/internal/sdk/models/components/queryinsight.go + - tests/mockserver/internal/sdk/models/components/queryinsightsresponse.go + - tests/mockserver/internal/sdk/models/components/querysuggestion.go + - tests/mockserver/internal/sdk/models/components/querysuggestionlist.go + - tests/mockserver/internal/sdk/models/components/quicklink.go + - tests/mockserver/internal/sdk/models/components/reaction.go + - tests/mockserver/internal/sdk/models/components/readpermission.go + - tests/mockserver/internal/sdk/models/components/recommendationsrequest.go + - tests/mockserver/internal/sdk/models/components/recommendationsrequestoptions.go + - tests/mockserver/internal/sdk/models/components/referencerange.go + - tests/mockserver/internal/sdk/models/components/relateddocuments.go + - tests/mockserver/internal/sdk/models/components/relatedobject.go + - tests/mockserver/internal/sdk/models/components/relatedobjectedge.go + - tests/mockserver/internal/sdk/models/components/relatedquestion.go + - tests/mockserver/internal/sdk/models/components/reminder.go + - tests/mockserver/internal/sdk/models/components/reminderrequest.go + - tests/mockserver/internal/sdk/models/components/reportstatusresponse.go + - tests/mockserver/internal/sdk/models/components/restrictionfilters.go + - tests/mockserver/internal/sdk/models/components/resultsdescription.go + - tests/mockserver/internal/sdk/models/components/resultsresponse.go + - tests/mockserver/internal/sdk/models/components/resulttab.go + - tests/mockserver/internal/sdk/models/components/rotatetokenresponse.go + - tests/mockserver/internal/sdk/models/components/scopetype.go + - tests/mockserver/internal/sdk/models/components/searchagentsrequest.go + - tests/mockserver/internal/sdk/models/components/searchagentsresponse.go + - tests/mockserver/internal/sdk/models/components/searchproviderinfo.go + - tests/mockserver/internal/sdk/models/components/searchrequest.go + - tests/mockserver/internal/sdk/models/components/searchrequestinputdetails.go + - tests/mockserver/internal/sdk/models/components/searchrequestoptions.go + - tests/mockserver/internal/sdk/models/components/searchresponse.go + - tests/mockserver/internal/sdk/models/components/searchresponsemetadata.go + - tests/mockserver/internal/sdk/models/components/searchresult.go + - tests/mockserver/internal/sdk/models/components/searchresultprominenceenum.go + - tests/mockserver/internal/sdk/models/components/searchresultsnippet.go + - tests/mockserver/internal/sdk/models/components/searchwarning.go + - tests/mockserver/internal/sdk/models/components/security.go + - tests/mockserver/internal/sdk/models/components/seenfeedbackinfo.go + - tests/mockserver/internal/sdk/models/components/sensitivecontentoptions.go + - tests/mockserver/internal/sdk/models/components/sensitiveexpression.go + - tests/mockserver/internal/sdk/models/components/sensitiveinfotype.go + - tests/mockserver/internal/sdk/models/components/sessioninfo.go + - tests/mockserver/internal/sdk/models/components/share.go + - tests/mockserver/internal/sdk/models/components/sharingoptions.go + - tests/mockserver/internal/sdk/models/components/shortcut.go + - tests/mockserver/internal/sdk/models/components/shortcuterror.go + - tests/mockserver/internal/sdk/models/components/shortcutinsight.go + - tests/mockserver/internal/sdk/models/components/shortcutinsightsresponse.go + - tests/mockserver/internal/sdk/models/components/shortcutmutableproperties.go + - tests/mockserver/internal/sdk/models/components/shortcutspaginationmetadata.go + - tests/mockserver/internal/sdk/models/components/socialnetwork.go + - tests/mockserver/internal/sdk/models/components/socialnetworkdefinition.go + - tests/mockserver/internal/sdk/models/components/sortoptions.go + - tests/mockserver/internal/sdk/models/components/structuredlink.go + - tests/mockserver/internal/sdk/models/components/structuredlocation.go + - tests/mockserver/internal/sdk/models/components/structuredresult.go + - tests/mockserver/internal/sdk/models/components/structuredtext.go + - tests/mockserver/internal/sdk/models/components/structuredtextitem.go + - tests/mockserver/internal/sdk/models/components/structuredtextmutableproperties.go + - tests/mockserver/internal/sdk/models/components/summarizerequest.go + - tests/mockserver/internal/sdk/models/components/summarizeresponse.go + - tests/mockserver/internal/sdk/models/components/summary.go + - tests/mockserver/internal/sdk/models/components/team.go + - tests/mockserver/internal/sdk/models/components/teamemail.go + - tests/mockserver/internal/sdk/models/components/teaminfodefinition.go + - tests/mockserver/internal/sdk/models/components/teammember.go + - tests/mockserver/internal/sdk/models/components/textrange.go + - tests/mockserver/internal/sdk/models/components/thumbnail.go + - tests/mockserver/internal/sdk/models/components/timeinterval.go + - tests/mockserver/internal/sdk/models/components/timepoint.go + - tests/mockserver/internal/sdk/models/components/timerange.go + - tests/mockserver/internal/sdk/models/components/tool.go + - tests/mockserver/internal/sdk/models/components/toolinfo.go + - tests/mockserver/internal/sdk/models/components/toolmetadata.go + - tests/mockserver/internal/sdk/models/components/toolparameter.go + - tests/mockserver/internal/sdk/models/components/toolscallparameter.go + - tests/mockserver/internal/sdk/models/components/toolscallrequest.go + - tests/mockserver/internal/sdk/models/components/toolscallresponse.go + - tests/mockserver/internal/sdk/models/components/toolslistresponse.go + - tests/mockserver/internal/sdk/models/components/ugctype.go + - tests/mockserver/internal/sdk/models/components/unpin.go + - tests/mockserver/internal/sdk/models/components/updateannouncementrequest.go + - tests/mockserver/internal/sdk/models/components/updatedlpconfigrequest.go + - tests/mockserver/internal/sdk/models/components/updatedlpconfigresponse.go + - tests/mockserver/internal/sdk/models/components/updatedlpreportrequest.go + - tests/mockserver/internal/sdk/models/components/updatedlpreportresponse.go + - tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesrequest.go + - tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesresponse.go + - tests/mockserver/internal/sdk/models/components/updatepermissionsrequest.go + - tests/mockserver/internal/sdk/models/components/updateshortcutrequest.go + - tests/mockserver/internal/sdk/models/components/updateshortcutresponse.go + - tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go + - tests/mockserver/internal/sdk/models/components/uploadchatfilesresponse.go + - tests/mockserver/internal/sdk/models/components/uploadshortcutsrequest.go + - tests/mockserver/internal/sdk/models/components/uploadstatusenum.go + - tests/mockserver/internal/sdk/models/components/user.go + - tests/mockserver/internal/sdk/models/components/useractivity.go + - tests/mockserver/internal/sdk/models/components/useractivityinsight.go + - tests/mockserver/internal/sdk/models/components/usergeneratedcontentid.go + - tests/mockserver/internal/sdk/models/components/userinsightsresponse.go + - tests/mockserver/internal/sdk/models/components/userreferencedefinition.go + - tests/mockserver/internal/sdk/models/components/userrole.go + - tests/mockserver/internal/sdk/models/components/userrolespecification.go + - tests/mockserver/internal/sdk/models/components/userstatusresponse.go + - tests/mockserver/internal/sdk/models/components/userviewinfo.go + - tests/mockserver/internal/sdk/models/components/verification.go + - tests/mockserver/internal/sdk/models/components/verificationfeed.go + - tests/mockserver/internal/sdk/models/components/verificationmetadata.go + - tests/mockserver/internal/sdk/models/components/verifyrequest.go + - tests/mockserver/internal/sdk/models/components/viewerinfo.go + - tests/mockserver/internal/sdk/models/components/workflow.go + - tests/mockserver/internal/sdk/models/components/workflowfeedbackinfo.go + - tests/mockserver/internal/sdk/models/components/workflowresult.go + - tests/mockserver/internal/sdk/models/components/writeactionparameter.go + - tests/mockserver/internal/sdk/models/components/writepermission.go + - tests/mockserver/internal/sdk/models/operations/activity.go + - tests/mockserver/internal/sdk/models/operations/addcollectionitems.go + - tests/mockserver/internal/sdk/models/operations/addverificationreminder.go + - tests/mockserver/internal/sdk/models/operations/adminsearch.go + - tests/mockserver/internal/sdk/models/operations/autocomplete.go + - tests/mockserver/internal/sdk/models/operations/chat.go + - tests/mockserver/internal/sdk/models/operations/chatstream.go + - tests/mockserver/internal/sdk/models/operations/createandstreamrun.go + - tests/mockserver/internal/sdk/models/operations/createandwaitrun.go + - tests/mockserver/internal/sdk/models/operations/createannouncement.go + - tests/mockserver/internal/sdk/models/operations/createanswer.go + - tests/mockserver/internal/sdk/models/operations/createauthtoken.go + - tests/mockserver/internal/sdk/models/operations/createcollection.go + - tests/mockserver/internal/sdk/models/operations/createpolicy.go + - tests/mockserver/internal/sdk/models/operations/createreport.go + - tests/mockserver/internal/sdk/models/operations/createshortcut.go + - tests/mockserver/internal/sdk/models/operations/deleteallchats.go + - tests/mockserver/internal/sdk/models/operations/deleteannouncement.go + - tests/mockserver/internal/sdk/models/operations/deleteanswer.go + - tests/mockserver/internal/sdk/models/operations/deletechatfiles.go + - tests/mockserver/internal/sdk/models/operations/deletechats.go + - tests/mockserver/internal/sdk/models/operations/deletecollection.go + - tests/mockserver/internal/sdk/models/operations/deletecollectionitem.go + - tests/mockserver/internal/sdk/models/operations/deleteshortcut.go + - tests/mockserver/internal/sdk/models/operations/downloadpolicycsv.go + - tests/mockserver/internal/sdk/models/operations/downloadreportcsv.go + - tests/mockserver/internal/sdk/models/operations/editanswer.go + - tests/mockserver/internal/sdk/models/operations/editcollection.go + - tests/mockserver/internal/sdk/models/operations/editcollectionitem.go + - tests/mockserver/internal/sdk/models/operations/editpin.go + - tests/mockserver/internal/sdk/models/operations/feed.go + - tests/mockserver/internal/sdk/models/operations/feedback.go + - tests/mockserver/internal/sdk/models/operations/getagent.go + - tests/mockserver/internal/sdk/models/operations/getagentschemas.go + - tests/mockserver/internal/sdk/models/operations/getanswer.go + - tests/mockserver/internal/sdk/models/operations/getchat.go + - tests/mockserver/internal/sdk/models/operations/getchatapplication.go + - tests/mockserver/internal/sdk/models/operations/getchatfiles.go + - tests/mockserver/internal/sdk/models/operations/getcollection.go + - tests/mockserver/internal/sdk/models/operations/getdocpermissions.go + - tests/mockserver/internal/sdk/models/operations/getdocuments.go + - tests/mockserver/internal/sdk/models/operations/getdocumentsbyfacets.go + - tests/mockserver/internal/sdk/models/operations/getdocvisibility.go + - tests/mockserver/internal/sdk/models/operations/getpin.go + - tests/mockserver/internal/sdk/models/operations/getpolicy.go + - tests/mockserver/internal/sdk/models/operations/getreportstatus.go + - tests/mockserver/internal/sdk/models/operations/getrestapiv1toolslist.go + - tests/mockserver/internal/sdk/models/operations/getshortcut.go + - tests/mockserver/internal/sdk/models/operations/insights.go + - tests/mockserver/internal/sdk/models/operations/listanswers.go + - tests/mockserver/internal/sdk/models/operations/listchats.go + - tests/mockserver/internal/sdk/models/operations/listcollections.go + - tests/mockserver/internal/sdk/models/operations/listentities.go + - tests/mockserver/internal/sdk/models/operations/listpins.go + - tests/mockserver/internal/sdk/models/operations/listpolicies.go + - tests/mockserver/internal/sdk/models/operations/listshortcuts.go + - tests/mockserver/internal/sdk/models/operations/listverifications.go + - tests/mockserver/internal/sdk/models/operations/messages.go + - tests/mockserver/internal/sdk/models/operations/people.go + - tests/mockserver/internal/sdk/models/operations/pin.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1betausers.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexdocuments.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexemployees.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexgroups.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexmemberships.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexshortcuts.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexteams.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexusers.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1checkdocumentaccess.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocument.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocuments.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcestatus.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourceuser.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1deletedocument.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteemployee.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1deletegroup.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1deletemembership.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteteam.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteuser.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1getdatasourceconfig.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentcount.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentstatus.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1getusercount.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocument.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocuments.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1indexemployee.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1indexgroup.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1indexmembership.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1indexteam.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1indexuser.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1processalldocuments.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1processallemployeesandteams.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1processallmemberships.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1rotatetoken.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1updatepermissions.go + - tests/mockserver/internal/sdk/models/operations/postapiindexv1uploadshortcuts.go + - tests/mockserver/internal/sdk/models/operations/postrestapiv1toolscall.go + - tests/mockserver/internal/sdk/models/operations/recommendations.go + - tests/mockserver/internal/sdk/models/operations/search.go + - tests/mockserver/internal/sdk/models/operations/searchagents.go + - tests/mockserver/internal/sdk/models/operations/setdocvisibility.go + - tests/mockserver/internal/sdk/models/operations/summarize.go + - tests/mockserver/internal/sdk/models/operations/unpin.go + - tests/mockserver/internal/sdk/models/operations/updateannouncement.go + - tests/mockserver/internal/sdk/models/operations/updatepolicy.go + - tests/mockserver/internal/sdk/models/operations/updateshortcut.go + - tests/mockserver/internal/sdk/models/operations/uploadchatfiles.go + - tests/mockserver/internal/sdk/models/operations/verify.go + - tests/mockserver/internal/sdk/models/sdkerrors/collectionerror.go + - tests/mockserver/internal/sdk/models/sdkerrors/gleandataerror.go + - tests/mockserver/internal/sdk/types/bigint.go + - tests/mockserver/internal/sdk/types/date.go + - tests/mockserver/internal/sdk/types/datetime.go + - tests/mockserver/internal/sdk/types/decimal.go + - tests/mockserver/internal/sdk/types/jsonl/jsonl.go + - tests/mockserver/internal/sdk/types/pointers.go + - tests/mockserver/internal/sdk/utils/json.go + - tests/mockserver/internal/sdk/utils/reflect.go + - tests/mockserver/internal/sdk/utils/sort.go + - tests/mockserver/internal/server/doc.go + - tests/mockserver/internal/server/generated_handlers.go + - tests/mockserver/internal/server/internal_handlers.go + - tests/mockserver/internal/server/server.go + - tests/mockserver/internal/server/server_option.go + - tests/mockserver/internal/server/templates/log/index.html.tmpl + - tests/mockserver/internal/server/templates/log/operation.html.tmpl + - tests/mockserver/internal/server/templates/log/style.css.tmpl + - tests/mockserver/internal/tracking/requesttracker.go + - tests/mockserver/main.go examples: activity: speakeasy-default-activity: @@ -1824,17 +2585,17 @@ examples: createAndStreamRun: speakeasy-default-create-and-stream-run: requestBody: - application/json: {"agent_id": ""} + application/json: {"agent_id": "", "messages": [{"role": "USER"}]} responses: "200": text/event-stream: "" createAndWaitRun: speakeasy-default-create-and-wait-run: requestBody: - application/json: {"agent_id": ""} + application/json: {"agent_id": "", "messages": [{"role": "USER"}]} responses: "200": - application/json: {} + application/json: {"run": {"agent_id": "", "messages": [{"role": "USER"}]}, "messages": [{"role": "USER"}]} addcollectionitems: speakeasy-default-addcollectionitems: requestBody: @@ -2009,7 +2770,7 @@ examples: listentities: speakeasy-default-listentities: requestBody: - application/json: {"filter": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "entityType": "PEOPLE", "pageSize": 100} + application/json: {"filter": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "entityType": "PEOPLE", "pageSize": 100, "requestType": "STANDARD"} responses: "200": application/json: {"results": [{"name": "George Clooney", "obfuscatedId": "abc123"}], "teamResults": [{"id": "", "name": "", "members": [{"person": {"name": "George Clooney", "obfuscatedId": "abc123", "relatedDocuments": [{"querySuggestion": {"query": "app:github type:pull author:mortimer", "searchProviderInfo": {"name": "Google", "searchLinkUrlTemplate": "https://www.google.com/search?q={query}&hl=en"}, "label": "Mortimer's PRs", "datasource": "github", "requestOptions": {"datasourceFilter": "JIRA", "datasourcesFilter": ["JIRA"], "queryOverridesFacetFilters": true, "facetFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "facetFilterSets": [{"filters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}]}], "facetBucketSize": 444698, "authTokens": [{"accessToken": "123abc", "datasource": "gmail", "scope": "email profile https://www.googleapis.com/auth/gmail.readonly", "tokenType": "Bearer", "authUser": "1"}]}, "ranges": [{"startIndex": 287671, "document": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "components": ["Backend", "Networking"], "status": "[\"Done\"]", "pins": [{"audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "documentId": ""}], "collections": [{"name": "", "description": "recount underneath and but by oof trivial pfft finally", "addedRoles": [{"role": "ANSWER_MODERATOR"}], "removedRoles": [{"role": "VERIFIER"}, {"role": "VERIFIER"}], "audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "id": 515069, "items": [{"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}, {"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}]}], "interactions": {"reacts": [{}, {}, {}], "shares": [{"numDaysAgo": 881619}, {"numDaysAgo": 881619}, {"numDaysAgo": 881619}]}, "verification": {"state": "DEPRECATED", "metadata": {"reminders": [{"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 106868}], "lastReminder": {"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 520851}}}, "shortcuts": [{"inputAlias": ""}, {"inputAlias": ""}, {"inputAlias": ""}], "customData": {"someCustomField": {}}}}}, {"startIndex": 287671, "document": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "components": ["Backend", "Networking"], "status": "[\"Done\"]", "pins": [{"audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "documentId": ""}], "collections": [{"name": "", "description": "recount underneath and but by oof trivial pfft finally", "addedRoles": [{"role": "ANSWER_MODERATOR"}], "removedRoles": [{"role": "VERIFIER"}, {"role": "VERIFIER"}], "audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "id": 515069, "items": [{"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}, {"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}]}], "interactions": {"reacts": [{}, {}, {}], "shares": [{"numDaysAgo": 881619}, {"numDaysAgo": 881619}, {"numDaysAgo": 881619}]}, "verification": {"state": "DEPRECATED", "metadata": {"reminders": [{"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 106868}], "lastReminder": {"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 520851}}}, "shortcuts": [{"inputAlias": ""}, {"inputAlias": ""}, {"inputAlias": ""}], "customData": {"someCustomField": {}}}}}], "inputDetails": {"hasCopyPaste": true}}, "results": [{"title": "title", "url": "https://example.com/foo/bar", "nativeAppUrl": "slack://foo/bar", "snippets": [{"snippet": "snippet", "mimeType": "mimeType"}]}]}, {"querySuggestion": {"query": "app:github type:pull author:mortimer", "searchProviderInfo": {"name": "Google", "searchLinkUrlTemplate": "https://www.google.com/search?q={query}&hl=en"}, "label": "Mortimer's PRs", "datasource": "github", "requestOptions": {"datasourceFilter": "JIRA", "datasourcesFilter": ["JIRA"], "queryOverridesFacetFilters": true, "facetFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "facetFilterSets": [{"filters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}]}], "facetBucketSize": 444698, "authTokens": [{"accessToken": "123abc", "datasource": "gmail", "scope": "email profile https://www.googleapis.com/auth/gmail.readonly", "tokenType": "Bearer", "authUser": "1"}]}, "ranges": [{"startIndex": 287671, "document": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "components": ["Backend", "Networking"], "status": "[\"Done\"]", "pins": [{"audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "documentId": ""}], "collections": [{"name": "", "description": "recount underneath and but by oof trivial pfft finally", "addedRoles": [{"role": "ANSWER_MODERATOR"}], "removedRoles": [{"role": "VERIFIER"}, {"role": "VERIFIER"}], "audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "id": 515069, "items": [{"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}, {"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}]}], "interactions": {"reacts": [{}, {}, {}], "shares": [{"numDaysAgo": 881619}, {"numDaysAgo": 881619}, {"numDaysAgo": 881619}]}, "verification": {"state": "DEPRECATED", "metadata": {"reminders": [{"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 106868}], "lastReminder": {"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 520851}}}, "shortcuts": [{"inputAlias": ""}, {"inputAlias": ""}, {"inputAlias": ""}], "customData": {"someCustomField": {}}}}}, {"startIndex": 287671, "document": {"metadata": {"datasource": "datasource", "objectType": "Feature Request", "container": "container", "parentId": "JIRA_EN-1337", "mimeType": "mimeType", "documentId": "documentId", "createTime": "2000-01-23T04:56:07.000Z", "updateTime": "2000-01-23T04:56:07.000Z", "components": ["Backend", "Networking"], "status": "[\"Done\"]", "pins": [{"audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "documentId": ""}], "collections": [{"name": "", "description": "recount underneath and but by oof trivial pfft finally", "addedRoles": [{"role": "ANSWER_MODERATOR"}], "removedRoles": [{"role": "VERIFIER"}, {"role": "VERIFIER"}], "audienceFilters": [{"fieldName": "type", "values": [{"value": "Spreadsheet", "relationType": "EQUALS"}, {"value": "Presentation", "relationType": "EQUALS"}]}], "id": 515069, "items": [{"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}, {"collectionId": 765291, "shortcut": {"inputAlias": "", "roles": [{"role": "EDITOR"}]}, "itemType": "TEXT"}]}], "interactions": {"reacts": [{}, {}, {}], "shares": [{"numDaysAgo": 881619}, {"numDaysAgo": 881619}, {"numDaysAgo": 881619}]}, "verification": {"state": "DEPRECATED", "metadata": {"reminders": [{"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 106868}], "lastReminder": {"assignee": {"name": "George Clooney", "obfuscatedId": "abc123"}, "remindAt": 520851}}}, "shortcuts": [{"inputAlias": ""}, {"inputAlias": ""}, {"inputAlias": ""}], "customData": {"someCustomField": {}}}}}], "inputDetails": {"hasCopyPaste": true}}, "results": [{"title": "title", "url": "https://example.com/foo/bar", "nativeAppUrl": "slack://foo/bar", "snippets": [{"snippet": "snippet", "mimeType": "mimeType"}]}]}], "metadata": {"type": "FULL_TIME", "title": "Actor", "department": "Movies", "email": "george@example.com", "location": "Hollywood, CA", "phone": "6505551234", "photoUrl": "https://example.com/george.jpg", "startDate": "2000-01-23", "datasourceProfile": [{"datasource": "github", "handle": ""}, {"datasource": "github", "handle": ""}], "querySuggestions": {"suggestions": [{"query": "app:github type:pull author:mortimer", "label": "Mortimer's PRs", "datasource": "github"}]}, "inviteInfo": {"invites": [{}, {}]}, "customFields": [{"label": "", "values": [{}], "displayable": true}, {"label": "", "values": [{}], "displayable": true}], "badges": [{"key": "deployment_name_new_hire", "displayName": "New hire", "iconConfig": {"color": "#343CED", "key": "person_icon", "iconType": "GLYPH", "name": "user"}}]}}, "relationship": "MEMBER"}], "datasourceProfiles": [{"datasource": "github", "handle": ""}, {"datasource": "github", "handle": ""}, {"datasource": "github", "handle": ""}], "status": "PROCESSED", "canBeDeleted": true}], "customEntityResults": [{}, {}], "facetResults": [{"sourceName": "container_name", "operatorName": "SelectMultiple", "buckets": [{"count": 1, "datasource": "jira", "percentage": 5, "value": {"stringValue": "engineering", "integerValue": 5, "displayLabel": "engineering", "iconConfig": {"color": "#343CED", "key": "person_icon", "iconType": "GLYPH", "name": "user"}}}], "hasMoreBuckets": false, "groupName": "Service Cloud"}]} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ece1e152..f3125228 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,8 +16,12 @@ generation: auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false java: - version: 0.5.6 + version: 0.6.0 additionalDependencies: [] additionalPlugins: [] artifactID: glean-api-client @@ -41,6 +45,7 @@ java: shared: models/components webhooks: models/webhooks inputModelSuffix: input + languageVersion: 11 license: name: The MIT License (MIT) shortName: MIT diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 04a2a3cc..e41f9253 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -1795,7 +1795,7 @@ paths: tags: - Entities summary: List entities - description: List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint. + description: List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. operationId: listentities x-visibility: Public x-codegen-request-body-name: payload @@ -4122,6 +4122,7 @@ components: - ID_EQUALS - LT - GT + - NOT_EQUALS example: EQUALS isNegated: type: boolean @@ -4868,7 +4869,8 @@ components: example: From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. boardId: type: integer - description: The parent board ID of this Answer, or 0 if it's a floating Answer. + description: The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + deprecated: true audienceFilters: type: array description: Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. @@ -5640,11 +5642,13 @@ components: - ATTACHMENT - CANONICAL - CASE + - contact - CONTACT - CONVERSATION_MESSAGES - EXPERT - FROM - HIGHLIGHT + - opportunity - OPPORTUNITY - RECENT - SOURCE @@ -7523,6 +7527,7 @@ components: type: string title: Role description: The role of the message. + example: USER content: title: Content description: The content of the message. @@ -8415,6 +8420,7 @@ components: - COPYPASTED_QUOTES - INVALID_OPERATOR - MAYBE_INVALID_FACET_QUERY + - TOO_MANY_DATASOURCE_GROUPS description: The type of the warning. lastUsedTerm: type: string @@ -9058,6 +9064,7 @@ components: - DISPLAYABLE_LIST - SOCIAL_LINK - EXTERNAL_TASKS + - WORKFLOW_COLLECTIONS - ZERO_STATE_CHAT_SUGGESTION - ZERO_STATE_CHAT_TOOL_SUGGESTION - ZERO_STATE_WORKFLOW_CREATED_BY_ME @@ -9632,6 +9639,16 @@ components: source: type: string description: A string denoting the search surface from which the endpoint is called. + requestType: + type: string + default: STANDARD + description: The type of request being made. + x-enumDescriptions: + STANDARD: Used by default for all requests and satisfies all standard use cases for list requests. Limited to 10000 entities. + FULL_DIRECTORY: Used exclusively to return a comprehensive list of all people entities in the organization, typically for audit like purposes. The recommended approach is to sort by FIRST_NAME or LAST_NAME, and use pagination for large organizations. + enum: + - STANDARD + - FULL_DIRECTORY EntitiesSortOrder: type: string description: Different ways of sorting entities @@ -11745,6 +11762,10 @@ components: type: string description: end time of the time range, applicable for the CUSTOM type. format: date-time + lastNDaysValue: + type: integer + description: The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + format: int64 InputOptions: description: Controls which data-sources and what time-range to include in scans. properties: @@ -11779,6 +11800,7 @@ components: - PAST_YEAR - PAST_DAY - CUSTOM + - LAST_N_DAYS customTimeRange: $ref: "#/components/schemas/TimeRange" SharingOptions: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b9e3c652..c2b04e02 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,12 +1,12 @@ -speakeasyVersion: 1.563.2 +speakeasyVersion: 1.576.1 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:766f374184dd7d6b119aef718a826e26e7e690a65bd8edd8e326c75699c9c0f5 - sourceBlobDigest: sha256:b566588e295fa760c08dc3e5f61f4026e3b295999709bbec5a3f434f51316f89 + sourceRevisionDigest: sha256:57fc6af98e6e9e98c92547985293be8fafd52d2a1d1ef88d4b24636743b9f119 + sourceBlobDigest: sha256:01cf4577ff2f15ba160b16bba410571a8ba0c5fefa7e6dd7101edef7ef7c68dc tags: - latest - - speakeasy-sdk-regen-1749670145 + - speakeasy-sdk-regen-1750453706 Glean-OAS: sourceNamespace: glean-oas sourceRevisionDigest: sha256:8841834dd58ddd4e2dcf98fc90fbd06fbf3626a29df941503cce55b9548a5317 @@ -18,10 +18,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:766f374184dd7d6b119aef718a826e26e7e690a65bd8edd8e326c75699c9c0f5 - sourceBlobDigest: sha256:b566588e295fa760c08dc3e5f61f4026e3b295999709bbec5a3f434f51316f89 + sourceRevisionDigest: sha256:57fc6af98e6e9e98c92547985293be8fafd52d2a1d1ef88d4b24636743b9f119 + sourceBlobDigest: sha256:01cf4577ff2f15ba160b16bba410571a8ba0c5fefa7e6dd7101edef7ef7c68dc codeSamplesNamespace: glean-api-specs-java-code-samples - codeSamplesRevisionDigest: sha256:d644e6736c249dfb5aab7f2f6899ae480a6fbebde39c8bb385cf233f3b5689d4 + codeSamplesRevisionDigest: sha256:0b38a88f263a55a5ce1d7a0938446b8192c36e32ab974acc6c9dff2a62fc28d1 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 407d1980..b2f63454 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.glean.api-client:glean-api-client:0.5.6' +implementation 'com.glean.api-client:glean-api-client:0.6.0' ``` Maven: @@ -70,7 +70,7 @@ Maven: com.glean.api-client glean-api-client - 0.5.6 + 0.6.0 ``` @@ -91,9 +91,11 @@ gradlew.bat publishToMavenLocal -Pskip.signing ### Logging A logging framework/facade has not yet been adopted but is under consideration. -For request and response logging (especially json bodies) use: +For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so: ```java -SpeakeasyHTTPClient.setDebugLogging(true); // experimental API only (may change without warning) +SDK.builder() + .enableHTTPDebugLogging(true) + .build(); ``` Example output: ``` @@ -107,7 +109,9 @@ Response body: "token": "global" } ``` -WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`. +__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`. + +__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting. Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies. @@ -131,7 +135,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ChatResponse res = sdk.client().chat().create() @@ -169,7 +173,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ChatStreamResponse res = sdk.client().chat().createStream() @@ -219,7 +223,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); Activity req = Activity.builder() @@ -526,7 +530,7 @@ public class Application { public static void main(String[] args) throws CollectionError, Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CreateCollectionRequest req = CreateCollectionRequest.builder() @@ -1169,7 +1173,7 @@ public class Application { Glean sdk = Glean.builder() .instance("") - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); Activity req = Activity.builder() @@ -1226,7 +1230,7 @@ public class Application { Glean sdk = Glean.builder() .serverURL("https://instance-name-be.glean.com") - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); Activity req = Activity.builder() diff --git a/RELEASES.md b/RELEASES.md index 6380fdf0..e72a2ba6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -158,4 +158,14 @@ Based on: ### Generated - [java v0.5.6] . ### Releases -- [Maven Central v0.5.6] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.5.6 - . \ No newline at end of file +- [Maven Central v0.5.6] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.5.6 - . + +## 2025-07-07 23:17:04 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.576.1 (2.651.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.6.0] . +### Releases +- [Maven Central v0.6.0] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.6.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index b2b2f3fd..7b772ec3 100644 --- a/USAGE.md +++ b/USAGE.md @@ -13,7 +13,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ChatResponse res = sdk.client().chat().create() @@ -49,7 +49,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ChatStreamResponse res = sdk.client().chat().createStream() diff --git a/build.gradle b/build.gradle index 0cc3fc94..89f1cab4 100644 --- a/build.gradle +++ b/build.gradle @@ -28,8 +28,6 @@ repositories { } java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 withSourcesJar() withJavadocJar() } @@ -66,6 +64,10 @@ tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') } +tasks.withType(JavaCompile).configureEach { + options.release = 11 +} + sourcesJar { archiveBaseName = "${artifactId}" } @@ -104,11 +106,15 @@ publishing { // https://github.com/gradle/gradle/issues/18619 groupId = "com.glean.api-client" artifactId = "glean-api-client" - version = "0.5.6" + version = "0.6.0" from components.java pom { + properties = [ + 'maven.compiler.source': '11', + 'maven.compiler.target': '11', + ] name = 'Glean Java SDK' description = 'SDK enabling Java developers to easily integrate with the Glean API.' url = 'https://github.com/gleanwork/api-client-java' @@ -201,4 +207,4 @@ dependencies { antJUnit 'org.apache.ant:ant-junit:1.9.7' } -apply from: 'build-extras.gradle' +apply from: 'build-extras.gradle' \ No newline at end of file diff --git a/docs/models/components/Answer.md b/docs/models/components/Answer.md index e01baa0b..97265e6b 100644 --- a/docs/models/components/Answer.md +++ b/docs/models/components/Answer.md @@ -3,29 +3,29 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *long* | :heavy_check_mark: | The opaque ID of the Answer. | 3 | -| `docId` | *Optional\* | :heavy_minus_sign: | Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. | ANSWERS_answer_3 | -| `question` | *Optional\* | :heavy_minus_sign: | N/A | Why is the sky blue? | -| `questionVariations` | List\<*String*> | :heavy_minus_sign: | Additional ways of phrasing this question. | | -| `bodyText` | *Optional\* | :heavy_minus_sign: | The plain text answer to the question. | From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. | -| `boardId` | *Optional\* | :heavy_minus_sign: | The parent board ID of this Answer, or 0 if it's a floating Answer. | | -| `audienceFilters` | List\<[FacetFilter](../../models/components/FacetFilter.md)> | :heavy_minus_sign: | Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. | | -| `addedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer added by the owner. | | -| `removedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer removed by the owner. | | -| `roles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of roles for this answer explicitly granted by an owner, editor, or admin. | | -| `sourceDocumentSpec` | [Optional\](../../models/components/DocumentSpecUnion.md) | :heavy_minus_sign: | N/A | | -| `sourceType` | [Optional\](../../models/components/AnswerSourceType.md) | :heavy_minus_sign: | N/A | | -| `permissions` | [Optional\](../../models/components/ObjectPermissions.md) | :heavy_minus_sign: | N/A | | -| `combinedAnswerText` | [Optional\](../../models/components/StructuredText.md) | :heavy_minus_sign: | N/A | | -| `likes` | [Optional\](../../models/components/AnswerLikes.md) | :heavy_minus_sign: | N/A | | -| `author` | [Optional\](../../models/components/Person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | -| `createTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time the answer was created in ISO format (ISO 8601). | | -| `updateTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time the answer was last updated in ISO format (ISO 8601). | | -| `updatedBy` | [Optional\](../../models/components/Person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | -| `verification` | [Optional\](../../models/components/Verification.md) | :heavy_minus_sign: | N/A | | -| `board` | [Optional\](../../models/components/AnswerBoard.md) | :heavy_minus_sign: | N/A | | -| `collections` | List\<[Collection](../../models/components/Collection.md)> | :heavy_minus_sign: | The collections to which the answer belongs. | | -| `documentCategory` | *Optional\* | :heavy_minus_sign: | The document's document_category(.proto). | | -| `sourceDocument` | [Optional\](../../models/components/Document.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *long* | :heavy_check_mark: | The opaque ID of the Answer. | 3 | +| `docId` | *Optional\* | :heavy_minus_sign: | Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. | ANSWERS_answer_3 | +| `question` | *Optional\* | :heavy_minus_sign: | N/A | Why is the sky blue? | +| `questionVariations` | List\<*String*> | :heavy_minus_sign: | Additional ways of phrasing this question. | | +| `bodyText` | *Optional\* | :heavy_minus_sign: | The plain text answer to the question. | From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. | +| ~~`boardId`~~ | *Optional\* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. | | +| `audienceFilters` | List\<[FacetFilter](../../models/components/FacetFilter.md)> | :heavy_minus_sign: | Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. | | +| `addedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer added by the owner. | | +| `removedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer removed by the owner. | | +| `roles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of roles for this answer explicitly granted by an owner, editor, or admin. | | +| `sourceDocumentSpec` | [Optional\](../../models/components/DocumentSpecUnion.md) | :heavy_minus_sign: | N/A | | +| `sourceType` | [Optional\](../../models/components/AnswerSourceType.md) | :heavy_minus_sign: | N/A | | +| `permissions` | [Optional\](../../models/components/ObjectPermissions.md) | :heavy_minus_sign: | N/A | | +| `combinedAnswerText` | [Optional\](../../models/components/StructuredText.md) | :heavy_minus_sign: | N/A | | +| `likes` | [Optional\](../../models/components/AnswerLikes.md) | :heavy_minus_sign: | N/A | | +| `author` | [Optional\](../../models/components/Person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | +| `createTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time the answer was created in ISO format (ISO 8601). | | +| `updateTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The time the answer was last updated in ISO format (ISO 8601). | | +| `updatedBy` | [Optional\](../../models/components/Person.md) | :heavy_minus_sign: | N/A | {
"name": "George Clooney",
"obfuscatedId": "abc123"
} | +| `verification` | [Optional\](../../models/components/Verification.md) | :heavy_minus_sign: | N/A | | +| `board` | [Optional\](../../models/components/AnswerBoard.md) | :heavy_minus_sign: | N/A | | +| `collections` | List\<[Collection](../../models/components/Collection.md)> | :heavy_minus_sign: | The collections to which the answer belongs. | | +| `documentCategory` | *Optional\* | :heavy_minus_sign: | The document's document_category(.proto). | | +| `sourceDocument` | [Optional\](../../models/components/Document.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/AnswerCreationData.md b/docs/models/components/AnswerCreationData.md index 612364c3..4b91cad6 100644 --- a/docs/models/components/AnswerCreationData.md +++ b/docs/models/components/AnswerCreationData.md @@ -3,17 +3,17 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `question` | *Optional\* | :heavy_minus_sign: | N/A | Why is the sky blue? | -| `questionVariations` | List\<*String*> | :heavy_minus_sign: | Additional ways of phrasing this question. | | -| `bodyText` | *Optional\* | :heavy_minus_sign: | The plain text answer to the question. | From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. | -| `boardId` | *Optional\* | :heavy_minus_sign: | The parent board ID of this Answer, or 0 if it's a floating Answer. | | -| `audienceFilters` | List\<[FacetFilter](../../models/components/FacetFilter.md)> | :heavy_minus_sign: | Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. | | -| `addedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer added by the owner. | | -| `removedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer removed by the owner. | | -| `roles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of roles for this answer explicitly granted by an owner, editor, or admin. | | -| `sourceDocumentSpec` | [Optional\](../../models/components/DocumentSpecUnion.md) | :heavy_minus_sign: | N/A | | -| `sourceType` | [Optional\](../../models/components/AnswerCreationDataSourceType.md) | :heavy_minus_sign: | N/A | | -| `addedCollections` | List\<*long*> | :heavy_minus_sign: | IDs of Collections to which a document is added. | | -| `combinedAnswerText` | [Optional\](../../models/components/StructuredTextMutableProperties.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `question` | *Optional\* | :heavy_minus_sign: | N/A | Why is the sky blue? | +| `questionVariations` | List\<*String*> | :heavy_minus_sign: | Additional ways of phrasing this question. | | +| `bodyText` | *Optional\* | :heavy_minus_sign: | The plain text answer to the question. | From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. | +| ~~`boardId`~~ | *Optional\* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. | | +| `audienceFilters` | List\<[FacetFilter](../../models/components/FacetFilter.md)> | :heavy_minus_sign: | Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. | | +| `addedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer added by the owner. | | +| `removedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer removed by the owner. | | +| `roles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of roles for this answer explicitly granted by an owner, editor, or admin. | | +| `sourceDocumentSpec` | [Optional\](../../models/components/DocumentSpecUnion.md) | :heavy_minus_sign: | N/A | | +| `sourceType` | [Optional\](../../models/components/AnswerCreationDataSourceType.md) | :heavy_minus_sign: | N/A | | +| `addedCollections` | List\<*long*> | :heavy_minus_sign: | IDs of Collections to which a document is added. | | +| `combinedAnswerText` | [Optional\](../../models/components/StructuredTextMutableProperties.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/EditAnswerRequest.md b/docs/models/components/EditAnswerRequest.md index b6261912..501296f5 100644 --- a/docs/models/components/EditAnswerRequest.md +++ b/docs/models/components/EditAnswerRequest.md @@ -3,20 +3,20 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *long* | :heavy_check_mark: | The opaque ID of the Answer. | 3 | -| `docId` | *Optional\* | :heavy_minus_sign: | Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. | ANSWERS_answer_3 | -| `question` | *Optional\* | :heavy_minus_sign: | N/A | Why is the sky blue? | -| `questionVariations` | List\<*String*> | :heavy_minus_sign: | Additional ways of phrasing this question. | | -| `bodyText` | *Optional\* | :heavy_minus_sign: | The plain text answer to the question. | From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. | -| `boardId` | *Optional\* | :heavy_minus_sign: | The parent board ID of this Answer, or 0 if it's a floating Answer. | | -| `audienceFilters` | List\<[FacetFilter](../../models/components/FacetFilter.md)> | :heavy_minus_sign: | Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. | | -| `addedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer added by the owner. | | -| `removedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer removed by the owner. | | -| `roles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of roles for this answer explicitly granted by an owner, editor, or admin. | | -| `sourceDocumentSpec` | [Optional\](../../models/components/DocumentSpecUnion.md) | :heavy_minus_sign: | N/A | | -| `sourceType` | [Optional\](../../models/components/EditAnswerRequestSourceType.md) | :heavy_minus_sign: | N/A | | -| `addedCollections` | List\<*long*> | :heavy_minus_sign: | IDs of Collections to which a document is added. | | -| `removedCollections` | List\<*long*> | :heavy_minus_sign: | IDs of Collections from which a document is removed. | | -| `combinedAnswerText` | [Optional\](../../models/components/StructuredTextMutableProperties.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *long* | :heavy_check_mark: | The opaque ID of the Answer. | 3 | +| `docId` | *Optional\* | :heavy_minus_sign: | Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. | ANSWERS_answer_3 | +| `question` | *Optional\* | :heavy_minus_sign: | N/A | Why is the sky blue? | +| `questionVariations` | List\<*String*> | :heavy_minus_sign: | Additional ways of phrasing this question. | | +| `bodyText` | *Optional\* | :heavy_minus_sign: | The plain text answer to the question. | From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light. | +| ~~`boardId`~~ | *Optional\* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. | | +| `audienceFilters` | List\<[FacetFilter](../../models/components/FacetFilter.md)> | :heavy_minus_sign: | Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. | | +| `addedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer added by the owner. | | +| `removedRoles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of user roles for the answer removed by the owner. | | +| `roles` | List\<[UserRoleSpecification](../../models/components/UserRoleSpecification.md)> | :heavy_minus_sign: | A list of roles for this answer explicitly granted by an owner, editor, or admin. | | +| `sourceDocumentSpec` | [Optional\](../../models/components/DocumentSpecUnion.md) | :heavy_minus_sign: | N/A | | +| `sourceType` | [Optional\](../../models/components/EditAnswerRequestSourceType.md) | :heavy_minus_sign: | N/A | | +| `addedCollections` | List\<*long*> | :heavy_minus_sign: | IDs of Collections to which a document is added. | | +| `removedCollections` | List\<*long*> | :heavy_minus_sign: | IDs of Collections from which a document is removed. | | +| `combinedAnswerText` | [Optional\](../../models/components/StructuredTextMutableProperties.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/FeedRequestCategory.md b/docs/models/components/FeedRequestCategory.md index 4212ab55..f651bbb3 100644 --- a/docs/models/components/FeedRequestCategory.md +++ b/docs/models/components/FeedRequestCategory.md @@ -20,6 +20,7 @@ | `DISPLAYABLE_LIST` | DISPLAYABLE_LIST | | `SOCIAL_LINK` | SOCIAL_LINK | | `EXTERNAL_TASKS` | EXTERNAL_TASKS | +| `WORKFLOW_COLLECTIONS` | WORKFLOW_COLLECTIONS | | `ZERO_STATE_CHAT_SUGGESTION` | ZERO_STATE_CHAT_SUGGESTION | | `ZERO_STATE_CHAT_TOOL_SUGGESTION` | ZERO_STATE_CHAT_TOOL_SUGGESTION | | `ZERO_STATE_WORKFLOW_CREATED_BY_ME` | ZERO_STATE_WORKFLOW_CREATED_BY_ME | diff --git a/docs/models/components/ListEntitiesRequest.md b/docs/models/components/ListEntitiesRequest.md index 0d1c6b56..288662a0 100644 --- a/docs/models/components/ListEntitiesRequest.md +++ b/docs/models/components/ListEntitiesRequest.md @@ -13,4 +13,5 @@ | `includeFields` | List\<[ListEntitiesRequestIncludeField](../../models/components/ListEntitiesRequestIncludeField.md)> | :heavy_minus_sign: | List of entity fields to return (that aren't returned by default) | | | `pageSize` | *Optional\* | :heavy_minus_sign: | Hint to the server about how many results to send back. Server may return less. | 100 | | `cursor` | *Optional\* | :heavy_minus_sign: | Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. | | -| `source` | *Optional\* | :heavy_minus_sign: | A string denoting the search surface from which the endpoint is called. | | \ No newline at end of file +| `source` | *Optional\* | :heavy_minus_sign: | A string denoting the search surface from which the endpoint is called. | | +| `requestType` | [Optional\](../../models/components/RequestType.md) | :heavy_minus_sign: | The type of request being made. | | \ No newline at end of file diff --git a/docs/models/components/Message.md b/docs/models/components/Message.md index 3546d25b..ca2c7cb2 100644 --- a/docs/models/components/Message.md +++ b/docs/models/components/Message.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `role` | *Optional\* | :heavy_minus_sign: | The role of the message. | -| `content` | List\<[MessageTextBlock](../../models/components/MessageTextBlock.md)> | :heavy_minus_sign: | The content of the message. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Optional\* | :heavy_minus_sign: | The role of the message. | USER | +| `content` | List\<[MessageTextBlock](../../models/components/MessageTextBlock.md)> | :heavy_minus_sign: | The content of the message. | | \ No newline at end of file diff --git a/docs/models/components/Relation.md b/docs/models/components/Relation.md index 3e82b17b..1912e0f8 100644 --- a/docs/models/components/Relation.md +++ b/docs/models/components/Relation.md @@ -10,12 +10,14 @@ How this document relates to the including entity. | `ATTACHMENT` | ATTACHMENT | | `CANONICAL` | CANONICAL | | `CASE` | CASE | -| `CONTACT` | CONTACT | +| `CONTACT_LOWER` | contact | +| `CONTACT_UPPER` | CONTACT | | `CONVERSATION_MESSAGES` | CONVERSATION_MESSAGES | | `EXPERT` | EXPERT | | `FROM` | FROM | | `HIGHLIGHT` | HIGHLIGHT | -| `OPPORTUNITY` | OPPORTUNITY | +| `OPPORTUNITY_LOWER` | opportunity | +| `OPPORTUNITY_UPPER` | OPPORTUNITY | | `RECENT` | RECENT | | `SOURCE` | SOURCE | | `TICKET` | TICKET | diff --git a/docs/models/components/RelationType.md b/docs/models/components/RelationType.md index 7661e2ab..647876db 100644 --- a/docs/models/components/RelationType.md +++ b/docs/models/components/RelationType.md @@ -3,9 +3,10 @@ ## Values -| Name | Value | -| ----------- | ----------- | -| `EQUALS` | EQUALS | -| `ID_EQUALS` | ID_EQUALS | -| `LT` | LT | -| `GT` | GT | \ No newline at end of file +| Name | Value | +| ------------ | ------------ | +| `EQUALS` | EQUALS | +| `ID_EQUALS` | ID_EQUALS | +| `LT` | LT | +| `GT` | GT | +| `NOT_EQUALS` | NOT_EQUALS | \ No newline at end of file diff --git a/docs/models/components/RequestType.md b/docs/models/components/RequestType.md new file mode 100644 index 00000000..1859501a --- /dev/null +++ b/docs/models/components/RequestType.md @@ -0,0 +1,11 @@ +# RequestType + +The type of request being made. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `STANDARD` | STANDARD | +| `FULL_DIRECTORY` | FULL_DIRECTORY | \ No newline at end of file diff --git a/docs/models/components/TimePeriodType.md b/docs/models/components/TimePeriodType.md index 0078c02b..eb606293 100644 --- a/docs/models/components/TimePeriodType.md +++ b/docs/models/components/TimePeriodType.md @@ -5,9 +5,10 @@ Type of time period for which to run the report/policy. PAST_DAY is deprecated. ## Values -| Name | Value | -| ----------- | ----------- | -| `ALL_TIME` | ALL_TIME | -| `PAST_YEAR` | PAST_YEAR | -| `PAST_DAY` | PAST_DAY | -| `CUSTOM` | CUSTOM | \ No newline at end of file +| Name | Value | +| ------------- | ------------- | +| `ALL_TIME` | ALL_TIME | +| `PAST_YEAR` | PAST_YEAR | +| `PAST_DAY` | PAST_DAY | +| `CUSTOM` | CUSTOM | +| `LAST_N_DAYS` | LAST_N_DAYS | \ No newline at end of file diff --git a/docs/models/components/TimeRange.md b/docs/models/components/TimeRange.md index d6904dad..32e91b24 100644 --- a/docs/models/components/TimeRange.md +++ b/docs/models/components/TimeRange.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `startTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | start time of the time range, applicable for the CUSTOM type. | -| `endTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | end time of the time range, applicable for the CUSTOM type. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `startTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | start time of the time range, applicable for the CUSTOM type. | +| `endTime` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | end time of the time range, applicable for the CUSTOM type. | +| `lastNDaysValue` | *Optional\* | :heavy_minus_sign: | The number of days to look back from the current time, applicable for the LAST_N_DAYS type. | \ No newline at end of file diff --git a/docs/models/components/WarningType.md b/docs/models/components/WarningType.md index bc7850ac..e40d81ce 100644 --- a/docs/models/components/WarningType.md +++ b/docs/models/components/WarningType.md @@ -5,11 +5,12 @@ The type of the warning. ## Values -| Name | Value | -| --------------------------- | --------------------------- | -| `LONG_QUERY` | LONG_QUERY | -| `QUOTED_PUNCTUATION` | QUOTED_PUNCTUATION | -| `PUNCTUATION_ONLY` | PUNCTUATION_ONLY | -| `COPYPASTED_QUOTES` | COPYPASTED_QUOTES | -| `INVALID_OPERATOR` | INVALID_OPERATOR | -| `MAYBE_INVALID_FACET_QUERY` | MAYBE_INVALID_FACET_QUERY | \ No newline at end of file +| Name | Value | +| ---------------------------- | ---------------------------- | +| `LONG_QUERY` | LONG_QUERY | +| `QUOTED_PUNCTUATION` | QUOTED_PUNCTUATION | +| `PUNCTUATION_ONLY` | PUNCTUATION_ONLY | +| `COPYPASTED_QUOTES` | COPYPASTED_QUOTES | +| `INVALID_OPERATOR` | INVALID_OPERATOR | +| `MAYBE_INVALID_FACET_QUERY` | MAYBE_INVALID_FACET_QUERY | +| `TOO_MANY_DATASOURCE_GROUPS` | TOO_MANY_DATASOURCE_GROUPS | \ No newline at end of file diff --git a/docs/sdks/activity/README.md b/docs/sdks/activity/README.md index 684978ce..f57fd245 100644 --- a/docs/sdks/activity/README.md +++ b/docs/sdks/activity/README.md @@ -29,7 +29,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); Activity req = Activity.builder() @@ -104,7 +104,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); FeedbackResponse res = sdk.client().activity().feedback() diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index 73c26f5a..89468341 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -29,7 +29,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetAgentResponse res = sdk.client().agents().retrieve() @@ -78,7 +78,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetAgentSchemasResponse res = sdk.client().agents().retrieveSchemas() @@ -128,7 +128,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); SearchAgentsRequest req = SearchAgentsRequest.builder() @@ -173,19 +173,25 @@ package hello.world; import com.glean.api_client.glean_api_client.Glean; import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; +import com.glean.api_client.glean_api_client.models.components.Message; import com.glean.api_client.glean_api_client.models.operations.CreateAndStreamRunResponse; import java.lang.Exception; +import java.util.List; public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); AgentRunCreate req = AgentRunCreate.builder() .agentId("") + .messages(List.of( + Message.builder() + .role("USER") + .build())) .build(); CreateAndStreamRunResponse res = sdk.client().agents().runStream() @@ -226,19 +232,25 @@ package hello.world; import com.glean.api_client.glean_api_client.Glean; import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; +import com.glean.api_client.glean_api_client.models.components.Message; import com.glean.api_client.glean_api_client.models.operations.CreateAndWaitRunResponse; import java.lang.Exception; +import java.util.List; public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); AgentRunCreate req = AgentRunCreate.builder() .agentId("") + .messages(List.of( + Message.builder() + .role("USER") + .build())) .build(); CreateAndWaitRunResponse res = sdk.client().agents().run() diff --git a/docs/sdks/announcements/README.md b/docs/sdks/announcements/README.md index fa6cfb33..6b988623 100644 --- a/docs/sdks/announcements/README.md +++ b/docs/sdks/announcements/README.md @@ -32,7 +32,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CreateAnnouncementRequest req = CreateAnnouncementRequest.builder() @@ -21284,7 +21284,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteAnnouncementRequest req = DeleteAnnouncementRequest.builder() @@ -21339,7 +21339,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UpdateAnnouncementRequest req = UpdateAnnouncementRequest.builder() diff --git a/docs/sdks/answers/README.md b/docs/sdks/answers/README.md index 15a5e910..594d1b47 100644 --- a/docs/sdks/answers/README.md +++ b/docs/sdks/answers/README.md @@ -34,7 +34,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CreateAnswerRequest req = CreateAnswerRequest.builder() @@ -1329,7 +1329,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteAnswerRequest req = DeleteAnswerRequest.builder() @@ -1385,7 +1385,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); EditAnswerRequest req = EditAnswerRequest.builder() @@ -2272,7 +2272,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetAnswerRequest req = GetAnswerRequest.builder() @@ -2326,7 +2326,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListAnswersRequest req = ListAnswersRequest.builder() diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index 8c33ac62..f51c158a 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -36,7 +36,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ChatResponse res = sdk.client().chat().create() @@ -93,7 +93,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteallchatsResponse res = sdk.client().chat().deleteAll() @@ -140,7 +140,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeletechatsResponse res = sdk.client().chat().delete() @@ -190,7 +190,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetchatResponse res = sdk.client().chat().retrieve() @@ -241,7 +241,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListchatsResponse res = sdk.client().chat().list() @@ -289,7 +289,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetchatapplicationResponse res = sdk.client().chat().retrieveApplication() @@ -344,7 +344,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UploadchatfilesResponse res = sdk.client().chat().uploadFiles() @@ -401,7 +401,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetchatfilesResponse res = sdk.client().chat().retrieveFiles() @@ -455,7 +455,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeletechatfilesResponse res = sdk.client().chat().deleteFiles() @@ -509,7 +509,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ChatStreamResponse res = sdk.client().chat().createStream() diff --git a/docs/sdks/clientauthentication/README.md b/docs/sdks/clientauthentication/README.md index 080ff535..66bc1eb0 100644 --- a/docs/sdks/clientauthentication/README.md +++ b/docs/sdks/clientauthentication/README.md @@ -30,7 +30,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CreateauthtokenResponse res = sdk.client().authentication().createToken() diff --git a/docs/sdks/clientdocuments/README.md b/docs/sdks/clientdocuments/README.md index d1f1d9e1..15d82227 100644 --- a/docs/sdks/clientdocuments/README.md +++ b/docs/sdks/clientdocuments/README.md @@ -29,7 +29,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetDocPermissionsRequest req = GetDocPermissionsRequest.builder() @@ -80,7 +80,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetdocumentsResponse res = sdk.client().documents().retrieve() @@ -129,7 +129,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetDocumentsByFacetsRequest req = GetDocumentsByFacetsRequest.builder() @@ -213,7 +213,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); SummarizeRequest req = SummarizeRequest.builder() diff --git a/docs/sdks/clientshortcuts/README.md b/docs/sdks/clientshortcuts/README.md index 770c27dc..c9d4a999 100644 --- a/docs/sdks/clientshortcuts/README.md +++ b/docs/sdks/clientshortcuts/README.md @@ -34,7 +34,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CreateShortcutRequest req = CreateShortcutRequest.builder() @@ -1554,7 +1554,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteShortcutRequest req = DeleteShortcutRequest.builder() @@ -1606,7 +1606,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetShortcutRequestUnion req = GetShortcutRequestUnion.of(GetShortcutRequest.builder() @@ -1660,7 +1660,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListShortcutsPaginatedRequest req = ListShortcutsPaginatedRequest.builder() @@ -1730,7 +1730,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UpdateShortcutRequest req = UpdateShortcutRequest.builder() diff --git a/docs/sdks/collections/README.md b/docs/sdks/collections/README.md index 01a8cbb8..f2d6f10e 100644 --- a/docs/sdks/collections/README.md +++ b/docs/sdks/collections/README.md @@ -33,7 +33,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); AddCollectionItemsRequest req = AddCollectionItemsRequest.builder() @@ -91,7 +91,7 @@ public class Application { public static void main(String[] args) throws CollectionError, Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CreateCollectionRequest req = CreateCollectionRequest.builder() @@ -742,7 +742,7 @@ public class Application { public static void main(String[] args) throws CollectionError, Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteCollectionRequest req = DeleteCollectionRequest.builder() @@ -797,7 +797,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteCollectionItemRequest req = DeleteCollectionItemRequest.builder() @@ -856,7 +856,7 @@ public class Application { public static void main(String[] args) throws CollectionError, Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); EditCollectionRequest req = EditCollectionRequest.builder() @@ -1876,7 +1876,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); EditCollectionItemRequest req = EditCollectionItemRequest.builder() @@ -1930,7 +1930,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetCollectionRequest req = GetCollectionRequest.builder() @@ -1983,7 +1983,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListCollectionsRequest req = ListCollectionsRequest.builder() diff --git a/docs/sdks/datasource/README.md b/docs/sdks/datasource/README.md index 875238e9..ede28266 100644 --- a/docs/sdks/datasource/README.md +++ b/docs/sdks/datasource/README.md @@ -29,7 +29,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1DebugDatasourceStatusResponse res = sdk.indexing().datasource().status() diff --git a/docs/sdks/datasources/README.md b/docs/sdks/datasources/README.md index b990eeb8..c9259584 100644 --- a/docs/sdks/datasources/README.md +++ b/docs/sdks/datasources/README.md @@ -28,7 +28,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CustomDatasourceConfig req = CustomDatasourceConfig.builder() @@ -89,7 +89,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetDatasourceConfigRequest req = GetDatasourceConfigRequest.builder() diff --git a/docs/sdks/entities/README.md b/docs/sdks/entities/README.md index 6b01083a..aebd4a36 100644 --- a/docs/sdks/entities/README.md +++ b/docs/sdks/entities/README.md @@ -10,7 +10,7 @@ ## list -List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint. +List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. ### Example Usage @@ -28,7 +28,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListEntitiesRequest req = ListEntitiesRequest.builder() @@ -95,7 +95,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PeopleRequest req = PeopleRequest.builder() diff --git a/docs/sdks/indexingauthentication/README.md b/docs/sdks/indexingauthentication/README.md index 79d65d30..1437a081 100644 --- a/docs/sdks/indexingauthentication/README.md +++ b/docs/sdks/indexingauthentication/README.md @@ -25,7 +25,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1RotatetokenResponse res = sdk.indexing().authentication().rotateToken() diff --git a/docs/sdks/indexingdocuments/README.md b/docs/sdks/indexingdocuments/README.md index a0415252..4b94905f 100644 --- a/docs/sdks/indexingdocuments/README.md +++ b/docs/sdks/indexingdocuments/README.md @@ -38,7 +38,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); IndexDocumentRequest req = IndexDocumentRequest.builder() @@ -92,7 +92,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); IndexDocumentsRequest req = IndexDocumentsRequest.builder() @@ -145,7 +145,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); BulkIndexDocumentsRequest req = BulkIndexDocumentsRequest.builder() @@ -208,7 +208,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1ProcessalldocumentsResponse res = sdk.indexing().documents().processAll() @@ -254,7 +254,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteDocumentRequest req = DeleteDocumentRequest.builder() @@ -310,7 +310,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1DebugDatasourceDocumentResponse res = sdk.indexing().documents().debug() @@ -369,7 +369,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1DebugDatasourceDocumentsResponse res = sdk.indexing().documents().debugMany() @@ -429,7 +429,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CheckDocumentAccessRequest req = CheckDocumentAccessRequest.builder() @@ -490,7 +490,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetDocumentStatusRequest req = GetDocumentStatusRequest.builder() @@ -550,7 +550,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetDocumentCountRequest req = GetDocumentCountRequest.builder() diff --git a/docs/sdks/indexingshortcuts/README.md b/docs/sdks/indexingshortcuts/README.md index 4bfccdd6..307a5eaa 100644 --- a/docs/sdks/indexingshortcuts/README.md +++ b/docs/sdks/indexingshortcuts/README.md @@ -29,7 +29,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); BulkIndexShortcutsRequest req = BulkIndexShortcutsRequest.builder() @@ -95,7 +95,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UploadShortcutsRequest req = UploadShortcutsRequest.builder() diff --git a/docs/sdks/insights/README.md b/docs/sdks/insights/README.md index b1bd11ae..2a8985d6 100644 --- a/docs/sdks/insights/README.md +++ b/docs/sdks/insights/README.md @@ -28,7 +28,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); InsightsRequest req = InsightsRequest.builder() diff --git a/docs/sdks/messages/README.md b/docs/sdks/messages/README.md index e0ecf8ba..77cd180f 100644 --- a/docs/sdks/messages/README.md +++ b/docs/sdks/messages/README.md @@ -27,7 +27,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); MessagesRequest req = MessagesRequest.builder() diff --git a/docs/sdks/people/README.md b/docs/sdks/people/README.md index d70c3606..7d648b76 100644 --- a/docs/sdks/people/README.md +++ b/docs/sdks/people/README.md @@ -38,7 +38,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1DebugDatasourceUserResponse res = sdk.indexing().people().debug() @@ -96,7 +96,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetUserCountRequest req = GetUserCountRequest.builder() @@ -150,7 +150,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); IndexEmployeeRequest req = IndexEmployeeRequest.builder() @@ -210,7 +210,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); BulkIndexEmployeesRequest req = BulkIndexEmployeesRequest.builder() @@ -289,7 +289,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1ProcessallemployeesandteamsResponse res = sdk.indexing().people().processAllEmployeesAndTeams() @@ -329,7 +329,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteEmployeeRequest req = DeleteEmployeeRequest.builder() @@ -381,7 +381,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); IndexTeamRequest req = IndexTeamRequest.builder() @@ -452,7 +452,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteTeamRequest req = DeleteTeamRequest.builder() @@ -504,7 +504,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); BulkIndexTeamsRequest req = BulkIndexTeamsRequest.builder() diff --git a/docs/sdks/permissions/README.md b/docs/sdks/permissions/README.md index ae5902d0..197486bf 100644 --- a/docs/sdks/permissions/README.md +++ b/docs/sdks/permissions/README.md @@ -38,7 +38,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UpdatePermissionsRequest req = UpdatePermissionsRequest.builder() @@ -92,7 +92,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); IndexUserRequest req = IndexUserRequest.builder() @@ -149,7 +149,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); BulkIndexUsersRequest req = BulkIndexUsersRequest.builder() @@ -215,7 +215,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); IndexGroupRequest req = IndexGroupRequest.builder() @@ -271,7 +271,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); BulkIndexGroupsRequest req = BulkIndexGroupsRequest.builder() @@ -331,7 +331,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); IndexMembershipRequest req = IndexMembershipRequest.builder() @@ -387,7 +387,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); BulkIndexMembershipsRequest req = BulkIndexMembershipsRequest.builder() @@ -446,7 +446,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PostApiIndexV1ProcessallmembershipsResponse res = sdk.indexing().permissions().processMemberships() @@ -492,7 +492,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteUserRequest req = DeleteUserRequest.builder() @@ -544,7 +544,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteGroupRequest req = DeleteGroupRequest.builder() @@ -597,7 +597,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DeleteMembershipRequest req = DeleteMembershipRequest.builder() @@ -652,7 +652,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GreenlistUsersRequest req = GreenlistUsersRequest.builder() diff --git a/docs/sdks/pins/README.md b/docs/sdks/pins/README.md index 987eb309..b615aa95 100644 --- a/docs/sdks/pins/README.md +++ b/docs/sdks/pins/README.md @@ -31,7 +31,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); EditPinRequest req = EditPinRequest.builder() @@ -96,7 +96,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetPinRequest req = GetPinRequest.builder() @@ -148,7 +148,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListpinsRequest req = ListpinsRequest.builder() @@ -201,7 +201,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); PinRequest req = PinRequest.builder() @@ -266,7 +266,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); Unpin req = Unpin.builder() diff --git a/docs/sdks/policies/README.md b/docs/sdks/policies/README.md index fb86c8fb..bd05f9af 100644 --- a/docs/sdks/policies/README.md +++ b/docs/sdks/policies/README.md @@ -29,7 +29,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetpolicyResponse res = sdk.client().governance().data().policies().retrieve() @@ -79,7 +79,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UpdatepolicyResponse res = sdk.client().governance().data().policies().update() @@ -130,7 +130,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListpoliciesResponse res = sdk.client().governance().data().policies().list() @@ -179,7 +179,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); CreateDlpReportRequest req = CreateDlpReportRequest.builder() @@ -230,7 +230,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DownloadpolicycsvResponse res = sdk.client().governance().data().policies().download() diff --git a/docs/sdks/reports/README.md b/docs/sdks/reports/README.md index b10320ea..3e77f3d5 100644 --- a/docs/sdks/reports/README.md +++ b/docs/sdks/reports/README.md @@ -28,7 +28,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UpdateDlpConfigRequest req = UpdateDlpConfigRequest.builder() @@ -79,7 +79,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); DownloadreportcsvResponse res = sdk.client().governance().data().reports().download() @@ -127,7 +127,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetreportstatusResponse res = sdk.client().governance().data().reports().status() diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 278850c5..b774726e 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -32,7 +32,7 @@ public class Application { public static void main(String[] args) throws GleanDataError, Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); SearchRequest req = SearchRequest.builder() @@ -112,7 +112,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); AutocompleteRequest req = AutocompleteRequest.builder() @@ -168,7 +168,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); FeedRequest req = FeedRequest.builder() @@ -224,7 +224,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); RecommendationsRequest req = RecommendationsRequest.builder() @@ -466,7 +466,7 @@ public class Application { public static void main(String[] args) throws GleanDataError, Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); SearchRequest req = SearchRequest.builder() diff --git a/docs/sdks/tools/README.md b/docs/sdks/tools/README.md index 1961f820..3a77a5e2 100644 --- a/docs/sdks/tools/README.md +++ b/docs/sdks/tools/README.md @@ -26,7 +26,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetRestApiV1ToolsListResponse res = sdk.client().tools().list() @@ -76,7 +76,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ToolsCallRequest req = ToolsCallRequest.builder() diff --git a/docs/sdks/verification/README.md b/docs/sdks/verification/README.md index cde5d324..4610834b 100644 --- a/docs/sdks/verification/README.md +++ b/docs/sdks/verification/README.md @@ -28,7 +28,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ReminderRequest req = ReminderRequest.builder() @@ -80,7 +80,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); ListverificationsResponse res = sdk.client().verification().list() @@ -128,7 +128,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); VerifyRequest req = VerifyRequest.builder() diff --git a/docs/sdks/visibilityoverrides/README.md b/docs/sdks/visibilityoverrides/README.md index 9e345183..7d88ae62 100644 --- a/docs/sdks/visibilityoverrides/README.md +++ b/docs/sdks/visibilityoverrides/README.md @@ -26,7 +26,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); GetdocvisibilityResponse res = sdk.client().governance().documents().visibilityoverrides().list() @@ -74,7 +74,7 @@ public class Application { public static void main(String[] args) throws Exception { Glean sdk = Glean.builder() - .apiToken("") + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) .build(); UpdateDocumentVisibilityOverridesRequest req = UpdateDocumentVisibilityOverridesRequest.builder() diff --git a/gradle.properties b/gradle.properties index 1ab086d8..a67e3568 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ groupId=com.glean.api-client artifactId=glean-api-client -version=0.5.6 \ No newline at end of file +version=0.6.0 \ No newline at end of file diff --git a/src/main/java/com/glean/api_client/glean_api_client/Activity.java b/src/main/java/com/glean/api_client/glean_api_client/Activity.java index 09dafcbb..94f40386 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Activity.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Activity.java @@ -3,36 +3,23 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.Feedback; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.ActivityRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ActivityResponse; import com.glean.api_client.glean_api_client.models.operations.FeedbackRequest; import com.glean.api_client.glean_api_client.models.operations.FeedbackRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.FeedbackResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.ActivityOperation; +import com.glean.api_client.glean_api_client.operations.FeedbackOperation; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Activity implements - MethodCallActivity, - MethodCallFeedback { +public class Activity { private final SDKConfiguration sdkConfiguration; Activity(SDKConfiguration sdkConfiguration) { @@ -47,7 +34,7 @@ public class Activity implements * @return The call builder */ public ActivityRequestBuilder report() { - return new ActivityRequestBuilder(this); + return new ActivityRequestBuilder(sdkConfiguration); } /** @@ -55,125 +42,15 @@ public ActivityRequestBuilder report() { * *

Report user activity that occurs on indexed documents such as viewing or editing. This signal improves search quality. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public ActivityResponse report( com.glean.api_client.glean_api_client.models.components.Activity request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/activity"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "activity", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "activity", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "activity", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "activity", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ActivityResponse.Builder _resBuilder = - ActivityResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ActivityResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ActivityOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -185,7 +62,7 @@ public ActivityResponse report( * @return The call builder */ public FeedbackRequestBuilder feedback() { - return new FeedbackRequestBuilder(this); + return new FeedbackRequestBuilder(sdkConfiguration); } /** @@ -199,7 +76,7 @@ public FeedbackRequestBuilder feedback() { public FeedbackResponse feedbackDirect() throws Exception { return feedback(Optional.empty(), Optional.empty()); } - + /** * Report client activity * @@ -219,122 +96,9 @@ public FeedbackResponse feedback( .feedbackQueryParameter(feedbackQueryParameter) .feedback1(feedback1) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/feedback"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "feedback1", - "json", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - FeedbackRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "feedback", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "feedback", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "feedback", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "feedback", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - FeedbackResponse.Builder _resBuilder = - FeedbackResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - FeedbackResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new FeedbackOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Agents.java b/src/main/java/com/glean/api_client/glean_api_client/Agents.java index 3dae6c21..c000c033 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Agents.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Agents.java @@ -3,13 +3,10 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.Agent; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; -import com.glean.api_client.glean_api_client.models.components.AgentRunWaitResponse; -import com.glean.api_client.glean_api_client.models.components.AgentSchemas; import com.glean.api_client.glean_api_client.models.components.SearchAgentsRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.CreateAndStreamRunRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.CreateAndStreamRunResponse; import com.glean.api_client.glean_api_client.models.operations.CreateAndWaitRunRequestBuilder; @@ -20,34 +17,21 @@ import com.glean.api_client.glean_api_client.models.operations.GetAgentSchemasRequest; import com.glean.api_client.glean_api_client.models.operations.GetAgentSchemasRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.GetAgentSchemasResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.SearchAgentsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.SearchAgentsResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.CreateAndStreamRunOperation; +import com.glean.api_client.glean_api_client.operations.CreateAndWaitRunOperation; +import com.glean.api_client.glean_api_client.operations.GetAgentOperation; +import com.glean.api_client.glean_api_client.operations.GetAgentSchemasOperation; +import com.glean.api_client.glean_api_client.operations.SearchAgentsOperation; import java.lang.Exception; import java.lang.Long; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Agents implements - MethodCallGetAgent, - MethodCallGetAgentSchemas, - MethodCallSearchAgents, - MethodCallCreateAndStreamRun, - MethodCallCreateAndWaitRun { +public class Agents { private final SDKConfiguration sdkConfiguration; Agents(SDKConfiguration sdkConfiguration) { @@ -62,7 +46,7 @@ public class Agents implements * @return The call builder */ public GetAgentRequestBuilder retrieve() { - return new GetAgentRequestBuilder(this); + return new GetAgentRequestBuilder(sdkConfiguration); } /** @@ -74,11 +58,10 @@ public GetAgentRequestBuilder retrieve() { * @return The response from the API call * @throws Exception if the API call fails */ - public GetAgentResponse retrieve( - String agentId) throws Exception { + public GetAgentResponse retrieve(String agentId) throws Exception { return retrieve(Optional.empty(), agentId); } - + /** * Retrieve an agent * @@ -98,125 +81,9 @@ public GetAgentResponse retrieve( .timezoneOffset(timezoneOffset) .agentId(agentId) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetAgentRequest.class, - _baseUrl, - "/rest/api/v1/agents/{agent_id}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetAgentRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgent", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgent", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgent", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgent", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetAgentResponse.Builder _resBuilder = - GetAgentResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetAgentResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - Agent _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAgent(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetAgentOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -228,7 +95,7 @@ public GetAgentResponse retrieve( * @return The call builder */ public GetAgentSchemasRequestBuilder retrieveSchemas() { - return new GetAgentSchemasRequestBuilder(this); + return new GetAgentSchemasRequestBuilder(sdkConfiguration); } /** @@ -240,11 +107,10 @@ public GetAgentSchemasRequestBuilder retrieveSchemas() { * @return The response from the API call * @throws Exception if the API call fails */ - public GetAgentSchemasResponse retrieveSchemas( - String agentId) throws Exception { + public GetAgentSchemasResponse retrieveSchemas(String agentId) throws Exception { return retrieveSchemas(Optional.empty(), agentId); } - + /** * List an agent's schemas * @@ -264,125 +130,9 @@ public GetAgentSchemasResponse retrieveSchemas( .timezoneOffset(timezoneOffset) .agentId(agentId) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetAgentSchemasRequest.class, - _baseUrl, - "/rest/api/v1/agents/{agent_id}/schemas", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetAgentSchemasRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgentSchemas", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgentSchemas", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgentSchemas", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAgentSchemas", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetAgentSchemasResponse.Builder _resBuilder = - GetAgentSchemasResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetAgentSchemasResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - AgentSchemas _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAgentSchemas(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetAgentSchemasOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -394,7 +144,7 @@ public GetAgentSchemasResponse retrieveSchemas( * @return The call builder */ public SearchAgentsRequestBuilder list() { - return new SearchAgentsRequestBuilder(this); + return new SearchAgentsRequestBuilder(sdkConfiguration); } /** @@ -402,136 +152,15 @@ public SearchAgentsRequestBuilder list() { * *

Search for [agents](https://developers.glean.com/agents/agents-api) by agent name. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public SearchAgentsResponse list( SearchAgentsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/agents/search"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "searchAgents", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "searchAgents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "searchAgents", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "searchAgents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - SearchAgentsResponse.Builder _resBuilder = - SearchAgentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - SearchAgentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.SearchAgentsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withSearchAgentsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "422", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new SearchAgentsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -543,7 +172,7 @@ public SearchAgentsResponse list( * @return The call builder */ public CreateAndStreamRunRequestBuilder runStream() { - return new CreateAndStreamRunRequestBuilder(this); + return new CreateAndStreamRunRequestBuilder(sdkConfiguration); } /** @@ -551,134 +180,15 @@ public CreateAndStreamRunRequestBuilder runStream() { * *

Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreateAndStreamRunResponse runStream( AgentRunCreate request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/agents/runs/stream"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "text/event-stream") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndStreamRun", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "409", "422", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndStreamRun", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndStreamRun", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndStreamRun", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreateAndStreamRunResponse.Builder _resBuilder = - CreateAndStreamRunResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreateAndStreamRunResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "text/event-stream")) { - String _out = Utils.toUtf8AndClose(_httpRes.body()); - _res.withRes(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "409", "422", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreateAndStreamRunOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -690,7 +200,7 @@ public CreateAndStreamRunResponse runStream( * @return The call builder */ public CreateAndWaitRunRequestBuilder run() { - return new CreateAndWaitRunRequestBuilder(this); + return new CreateAndWaitRunRequestBuilder(sdkConfiguration); } /** @@ -698,136 +208,15 @@ public CreateAndWaitRunRequestBuilder run() { * *

Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreateAndWaitRunResponse run( AgentRunCreate request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/agents/runs/wait"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndWaitRun", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "409", "422", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndWaitRun", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndWaitRun", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createAndWaitRun", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreateAndWaitRunResponse.Builder _resBuilder = - CreateAndWaitRunResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreateAndWaitRunResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - AgentRunWaitResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAgentRunWaitResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "403", "404", "409", "422", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreateAndWaitRunOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Announcements.java b/src/main/java/com/glean/api_client/glean_api_client/Announcements.java index 9a486833..09431dfb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Announcements.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Announcements.java @@ -3,41 +3,26 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.Announcement; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.CreateAnnouncementRequest; import com.glean.api_client.glean_api_client.models.components.DeleteAnnouncementRequest; import com.glean.api_client.glean_api_client.models.components.UpdateAnnouncementRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.CreateannouncementRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.CreateannouncementResponse; import com.glean.api_client.glean_api_client.models.operations.DeleteannouncementRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.DeleteannouncementResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.UpdateannouncementRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.UpdateannouncementResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.CreateannouncementOperation; +import com.glean.api_client.glean_api_client.operations.DeleteannouncementOperation; +import com.glean.api_client.glean_api_client.operations.UpdateannouncementOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Announcements implements - MethodCallCreateannouncement, - MethodCallDeleteannouncement, - MethodCallUpdateannouncement { +public class Announcements { private final SDKConfiguration sdkConfiguration; Announcements(SDKConfiguration sdkConfiguration) { @@ -52,7 +37,7 @@ public class Announcements implements * @return The call builder */ public CreateannouncementRequestBuilder create() { - return new CreateannouncementRequestBuilder(this); + return new CreateannouncementRequestBuilder(sdkConfiguration); } /** @@ -60,136 +45,15 @@ public CreateannouncementRequestBuilder create() { * *

Create a textual announcement visible to some set of users based on department and location. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreateannouncementResponse create( CreateAnnouncementRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/createannouncement"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createannouncement", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createannouncement", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createannouncement", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createannouncement", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreateannouncementResponse.Builder _resBuilder = - CreateannouncementResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreateannouncementResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - Announcement _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAnnouncement(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreateannouncementOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -201,7 +65,7 @@ public CreateannouncementResponse create( * @return The call builder */ public DeleteannouncementRequestBuilder delete() { - return new DeleteannouncementRequestBuilder(this); + return new DeleteannouncementRequestBuilder(sdkConfiguration); } /** @@ -209,125 +73,15 @@ public DeleteannouncementRequestBuilder delete() { * *

Delete an existing user-generated announcement. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public DeleteannouncementResponse delete( DeleteAnnouncementRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deleteannouncement"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteannouncement", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteannouncement", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteannouncement", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteannouncement", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeleteannouncementResponse.Builder _resBuilder = - DeleteannouncementResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeleteannouncementResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeleteannouncementOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -339,7 +93,7 @@ public DeleteannouncementResponse delete( * @return The call builder */ public UpdateannouncementRequestBuilder update() { - return new UpdateannouncementRequestBuilder(this); + return new UpdateannouncementRequestBuilder(sdkConfiguration); } /** @@ -347,136 +101,15 @@ public UpdateannouncementRequestBuilder update() { * *

Update a textual announcement visible to some set of users based on department and location. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public UpdateannouncementResponse update( UpdateAnnouncementRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/updateannouncement"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateannouncement", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateannouncement", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateannouncement", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateannouncement", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UpdateannouncementResponse.Builder _resBuilder = - UpdateannouncementResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UpdateannouncementResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - Announcement _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAnnouncement(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UpdateannouncementOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Answers.java b/src/main/java/com/glean/api_client/glean_api_client/Answers.java index 8fc69b1e..e74b777f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Answers.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Answers.java @@ -3,16 +3,13 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.Answer; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.CreateAnswerRequest; import com.glean.api_client.glean_api_client.models.components.DeleteAnswerRequest; import com.glean.api_client.glean_api_client.models.components.EditAnswerRequest; import com.glean.api_client.glean_api_client.models.components.GetAnswerRequest; -import com.glean.api_client.glean_api_client.models.components.GetAnswerResponse; import com.glean.api_client.glean_api_client.models.components.ListAnswersRequest; -import com.glean.api_client.glean_api_client.models.components.ListAnswersResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.CreateanswerRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.CreateanswerResponse; import com.glean.api_client.glean_api_client.models.operations.DeleteanswerRequestBuilder; @@ -23,31 +20,17 @@ import com.glean.api_client.glean_api_client.models.operations.GetanswerResponse; import com.glean.api_client.glean_api_client.models.operations.ListanswersRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ListanswersResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.CreateanswerOperation; +import com.glean.api_client.glean_api_client.operations.DeleteanswerOperation; +import com.glean.api_client.glean_api_client.operations.EditanswerOperation; +import com.glean.api_client.glean_api_client.operations.GetanswerOperation; +import com.glean.api_client.glean_api_client.operations.ListanswersOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Answers implements - MethodCallCreateanswer, - MethodCallDeleteanswer, - MethodCallEditanswer, - MethodCallGetanswer, - MethodCallListanswers { +public class Answers { private final SDKConfiguration sdkConfiguration; Answers(SDKConfiguration sdkConfiguration) { @@ -62,7 +45,7 @@ public class Answers implements * @return The call builder */ public CreateanswerRequestBuilder create() { - return new CreateanswerRequestBuilder(this); + return new CreateanswerRequestBuilder(sdkConfiguration); } /** @@ -70,136 +53,15 @@ public CreateanswerRequestBuilder create() { * *

Create a user-generated Answer that contains a question and answer. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreateanswerResponse create( CreateAnswerRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/createanswer"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createanswer", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createanswer", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreateanswerResponse.Builder _resBuilder = - CreateanswerResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreateanswerResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - Answer _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAnswer(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreateanswerOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -211,7 +73,7 @@ public CreateanswerResponse create( * @return The call builder */ public DeleteanswerRequestBuilder delete() { - return new DeleteanswerRequestBuilder(this); + return new DeleteanswerRequestBuilder(sdkConfiguration); } /** @@ -219,125 +81,15 @@ public DeleteanswerRequestBuilder delete() { * *

Delete an existing user-generated Answer. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public DeleteanswerResponse delete( DeleteAnswerRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deleteanswer"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteanswer", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteanswer", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeleteanswerResponse.Builder _resBuilder = - DeleteanswerResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeleteanswerResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeleteanswerOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -349,7 +101,7 @@ public DeleteanswerResponse delete( * @return The call builder */ public EditanswerRequestBuilder update() { - return new EditanswerRequestBuilder(this); + return new EditanswerRequestBuilder(sdkConfiguration); } /** @@ -357,136 +109,15 @@ public EditanswerRequestBuilder update() { * *

Update an existing user-generated Answer. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public EditanswerResponse update( EditAnswerRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/editanswer"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "editanswer", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "editanswer", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - EditanswerResponse.Builder _resBuilder = - EditanswerResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - EditanswerResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - Answer _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAnswer(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new EditanswerOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -498,7 +129,7 @@ public EditanswerResponse update( * @return The call builder */ public GetanswerRequestBuilder retrieve() { - return new GetanswerRequestBuilder(this); + return new GetanswerRequestBuilder(sdkConfiguration); } /** @@ -506,136 +137,15 @@ public GetanswerRequestBuilder retrieve() { * *

Read the details of a particular Answer given its ID. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public GetanswerResponse retrieve( GetAnswerRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getanswer"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getanswer", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getanswer", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getanswer", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetanswerResponse.Builder _resBuilder = - GetanswerResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetanswerResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetAnswerResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetAnswerResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetanswerOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -647,7 +157,7 @@ public GetanswerResponse retrieve( * @return The call builder */ public ListanswersRequestBuilder list() { - return new ListanswersRequestBuilder(this); + return new ListanswersRequestBuilder(sdkConfiguration); } /** @@ -655,136 +165,15 @@ public ListanswersRequestBuilder list() { * *

List Answers created by the current user. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public ListanswersResponse list( ListAnswersRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/listanswers"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listanswers", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listanswers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listanswers", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listanswers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListanswersResponse.Builder _resBuilder = - ListanswersResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListanswersResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ListAnswersResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withListAnswersResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListanswersOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Chat.java b/src/main/java/com/glean/api_client/glean_api_client/Chat.java index 1fbb95ad..e6262e5c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Chat.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Chat.java @@ -3,20 +3,15 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.ChatRequest; import com.glean.api_client.glean_api_client.models.components.DeleteChatFilesRequest; import com.glean.api_client.glean_api_client.models.components.DeleteChatsRequest; import com.glean.api_client.glean_api_client.models.components.GetChatApplicationRequest; -import com.glean.api_client.glean_api_client.models.components.GetChatApplicationResponse; import com.glean.api_client.glean_api_client.models.components.GetChatFilesRequest; -import com.glean.api_client.glean_api_client.models.components.GetChatFilesResponse; import com.glean.api_client.glean_api_client.models.components.GetChatRequest; -import com.glean.api_client.glean_api_client.models.components.GetChatResponse; -import com.glean.api_client.glean_api_client.models.components.ListChatsResponse; import com.glean.api_client.glean_api_client.models.components.UploadChatFilesRequest; -import com.glean.api_client.glean_api_client.models.components.UploadChatFilesResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.ChatRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ChatResponse; import com.glean.api_client.glean_api_client.models.operations.ChatStreamRequest; @@ -43,40 +38,26 @@ import com.glean.api_client.glean_api_client.models.operations.ListchatsRequest; import com.glean.api_client.glean_api_client.models.operations.ListchatsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ListchatsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.UploadchatfilesRequest; import com.glean.api_client.glean_api_client.models.operations.UploadchatfilesRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.UploadchatfilesResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.ChatOperation; +import com.glean.api_client.glean_api_client.operations.ChatStreamOperation; +import com.glean.api_client.glean_api_client.operations.DeleteallchatsOperation; +import com.glean.api_client.glean_api_client.operations.DeletechatfilesOperation; +import com.glean.api_client.glean_api_client.operations.DeletechatsOperation; +import com.glean.api_client.glean_api_client.operations.GetchatOperation; +import com.glean.api_client.glean_api_client.operations.GetchatapplicationOperation; +import com.glean.api_client.glean_api_client.operations.GetchatfilesOperation; +import com.glean.api_client.glean_api_client.operations.ListchatsOperation; +import com.glean.api_client.glean_api_client.operations.UploadchatfilesOperation; import java.lang.Exception; import java.lang.Long; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Chat implements - MethodCallChat, - MethodCallDeleteallchats, - MethodCallDeletechats, - MethodCallGetchat, - MethodCallListchats, - MethodCallGetchatapplication, - MethodCallUploadchatfiles, - MethodCallGetchatfiles, - MethodCallDeletechatfiles, - MethodCallChatStream { +public class Chat { private final SDKConfiguration sdkConfiguration; Chat(SDKConfiguration sdkConfiguration) { @@ -91,7 +72,7 @@ public class Chat implements * @return The call builder */ public ChatRequestBuilder create() { - return new ChatRequestBuilder(this); + return new ChatRequestBuilder(sdkConfiguration); } /** @@ -103,11 +84,10 @@ public ChatRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public ChatResponse create( - ChatRequest chatRequest) throws Exception { + public ChatResponse create(ChatRequest chatRequest) throws Exception { return create(Optional.empty(), chatRequest); } - + /** * Chat * @@ -127,136 +107,9 @@ public ChatResponse create( .timezoneOffset(timezoneOffset) .chatRequest(chatRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/chat"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "chatRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - com.glean.api_client.glean_api_client.models.operations.ChatRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "chat", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "408", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "chat", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "chat", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "chat", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ChatResponse.Builder _resBuilder = - ChatResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ChatResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.ChatResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withChatResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "408", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ChatOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -268,7 +121,7 @@ public ChatResponse create( * @return The call builder */ public DeleteallchatsRequestBuilder deleteAll() { - return new DeleteallchatsRequestBuilder(this); + return new DeleteallchatsRequestBuilder(sdkConfiguration); } /** @@ -282,7 +135,7 @@ public DeleteallchatsRequestBuilder deleteAll() { public DeleteallchatsResponse deleteAllDirect() throws Exception { return deleteAll(Optional.empty()); } - + /** * Deletes all saved Chats owned by a user * @@ -299,112 +152,9 @@ public DeleteallchatsResponse deleteAll( .builder() .timezoneOffset(timezoneOffset) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deleteallchats"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - DeleteallchatsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteallchats", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteallchats", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteallchats", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteallchats", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeleteallchatsResponse.Builder _resBuilder = - DeleteallchatsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeleteallchatsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeleteallchatsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -416,7 +166,7 @@ public DeleteallchatsResponse deleteAll( * @return The call builder */ public DeletechatsRequestBuilder delete() { - return new DeletechatsRequestBuilder(this); + return new DeletechatsRequestBuilder(sdkConfiguration); } /** @@ -428,11 +178,10 @@ public DeletechatsRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public DeletechatsResponse delete( - DeleteChatsRequest deleteChatsRequest) throws Exception { + public DeletechatsResponse delete(DeleteChatsRequest deleteChatsRequest) throws Exception { return delete(Optional.empty(), deleteChatsRequest); } - + /** * Deletes saved Chats * @@ -452,125 +201,9 @@ public DeletechatsResponse delete( .timezoneOffset(timezoneOffset) .deleteChatsRequest(deleteChatsRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deletechats"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "deleteChatsRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - DeletechatsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechats", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechats", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechats", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechats", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeletechatsResponse.Builder _resBuilder = - DeletechatsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeletechatsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeletechatsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -582,7 +215,7 @@ public DeletechatsResponse delete( * @return The call builder */ public GetchatRequestBuilder retrieve() { - return new GetchatRequestBuilder(this); + return new GetchatRequestBuilder(sdkConfiguration); } /** @@ -594,11 +227,10 @@ public GetchatRequestBuilder retrieve() { * @return The response from the API call * @throws Exception if the API call fails */ - public GetchatResponse retrieve( - GetChatRequest getChatRequest) throws Exception { + public GetchatResponse retrieve(GetChatRequest getChatRequest) throws Exception { return retrieve(Optional.empty(), getChatRequest); } - + /** * Retrieves a Chat * @@ -618,136 +250,9 @@ public GetchatResponse retrieve( .timezoneOffset(timezoneOffset) .getChatRequest(getChatRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getchat"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "getChatRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetchatRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchat", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchat", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchat", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchat", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetchatResponse.Builder _resBuilder = - GetchatResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetchatResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetChatResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetChatResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetchatOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -759,7 +264,7 @@ public GetchatResponse retrieve( * @return The call builder */ public ListchatsRequestBuilder list() { - return new ListchatsRequestBuilder(this); + return new ListchatsRequestBuilder(sdkConfiguration); } /** @@ -773,7 +278,7 @@ public ListchatsRequestBuilder list() { public ListchatsResponse listDirect() throws Exception { return list(Optional.empty()); } - + /** * Retrieves all saved Chats * @@ -790,123 +295,9 @@ public ListchatsResponse list( .builder() .timezoneOffset(timezoneOffset) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/listchats"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - ListchatsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listchats", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listchats", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listchats", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listchats", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListchatsResponse.Builder _resBuilder = - ListchatsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListchatsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ListChatsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withListChatsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListchatsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -918,7 +309,7 @@ public ListchatsResponse list( * @return The call builder */ public GetchatapplicationRequestBuilder retrieveApplication() { - return new GetchatapplicationRequestBuilder(this); + return new GetchatapplicationRequestBuilder(sdkConfiguration); } /** @@ -930,11 +321,10 @@ public GetchatapplicationRequestBuilder retrieveApplication() { * @return The response from the API call * @throws Exception if the API call fails */ - public GetchatapplicationResponse retrieveApplication( - GetChatApplicationRequest getChatApplicationRequest) throws Exception { + public GetchatapplicationResponse retrieveApplication(GetChatApplicationRequest getChatApplicationRequest) throws Exception { return retrieveApplication(Optional.empty(), getChatApplicationRequest); } - + /** * Gets the metadata for a custom Chat application * @@ -954,136 +344,9 @@ public GetchatapplicationResponse retrieveApplication( .timezoneOffset(timezoneOffset) .getChatApplicationRequest(getChatApplicationRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getchatapplication"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "getChatApplicationRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetchatapplicationRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatapplication", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatapplication", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatapplication", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatapplication", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetchatapplicationResponse.Builder _resBuilder = - GetchatapplicationResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetchatapplicationResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetChatApplicationResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetChatApplicationResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetchatapplicationOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1095,7 +358,7 @@ public GetchatapplicationResponse retrieveApplication( * @return The call builder */ public UploadchatfilesRequestBuilder uploadFiles() { - return new UploadchatfilesRequestBuilder(this); + return new UploadchatfilesRequestBuilder(sdkConfiguration); } /** @@ -1107,11 +370,10 @@ public UploadchatfilesRequestBuilder uploadFiles() { * @return The response from the API call * @throws Exception if the API call fails */ - public UploadchatfilesResponse uploadFiles( - UploadChatFilesRequest uploadChatFilesRequest) throws Exception { + public UploadchatfilesResponse uploadFiles(UploadChatFilesRequest uploadChatFilesRequest) throws Exception { return uploadFiles(Optional.empty(), uploadChatFilesRequest); } - + /** * Upload files for Chat. * @@ -1131,136 +393,9 @@ public UploadchatfilesResponse uploadFiles( .timezoneOffset(timezoneOffset) .uploadChatFilesRequest(uploadChatFilesRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/uploadchatfiles"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "uploadChatFilesRequest", - "multipart", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - UploadchatfilesRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UploadchatfilesResponse.Builder _resBuilder = - UploadchatfilesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UploadchatfilesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UploadChatFilesResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withUploadChatFilesResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UploadchatfilesOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1272,7 +407,7 @@ public UploadchatfilesResponse uploadFiles( * @return The call builder */ public GetchatfilesRequestBuilder retrieveFiles() { - return new GetchatfilesRequestBuilder(this); + return new GetchatfilesRequestBuilder(sdkConfiguration); } /** @@ -1284,11 +419,10 @@ public GetchatfilesRequestBuilder retrieveFiles() { * @return The response from the API call * @throws Exception if the API call fails */ - public GetchatfilesResponse retrieveFiles( - GetChatFilesRequest getChatFilesRequest) throws Exception { + public GetchatfilesResponse retrieveFiles(GetChatFilesRequest getChatFilesRequest) throws Exception { return retrieveFiles(Optional.empty(), getChatFilesRequest); } - + /** * Get files uploaded by a user for Chat. * @@ -1308,136 +442,9 @@ public GetchatfilesResponse retrieveFiles( .timezoneOffset(timezoneOffset) .getChatFilesRequest(getChatFilesRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getchatfiles"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "getChatFilesRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetchatfilesRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getchatfiles", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetchatfilesResponse.Builder _resBuilder = - GetchatfilesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetchatfilesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetChatFilesResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetChatFilesResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetchatfilesOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1449,7 +456,7 @@ public GetchatfilesResponse retrieveFiles( * @return The call builder */ public DeletechatfilesRequestBuilder deleteFiles() { - return new DeletechatfilesRequestBuilder(this); + return new DeletechatfilesRequestBuilder(sdkConfiguration); } /** @@ -1461,11 +468,10 @@ public DeletechatfilesRequestBuilder deleteFiles() { * @return The response from the API call * @throws Exception if the API call fails */ - public DeletechatfilesResponse deleteFiles( - DeleteChatFilesRequest deleteChatFilesRequest) throws Exception { + public DeletechatfilesResponse deleteFiles(DeleteChatFilesRequest deleteChatFilesRequest) throws Exception { return deleteFiles(Optional.empty(), deleteChatFilesRequest); } - + /** * Delete files uploaded by a user for chat. * @@ -1485,125 +491,9 @@ public DeletechatfilesResponse deleteFiles( .timezoneOffset(timezoneOffset) .deleteChatFilesRequest(deleteChatFilesRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deletechatfiles"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "deleteChatFilesRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - DeletechatfilesRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechatfiles", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechatfiles", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechatfiles", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletechatfiles", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeletechatfilesResponse.Builder _resBuilder = - DeletechatfilesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeletechatfilesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeletechatfilesOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1615,7 +505,7 @@ public DeletechatfilesResponse deleteFiles( * @return The call builder */ public ChatStreamRequestBuilder createStream() { - return new ChatStreamRequestBuilder(this); + return new ChatStreamRequestBuilder(sdkConfiguration); } /** @@ -1627,11 +517,10 @@ public ChatStreamRequestBuilder createStream() { * @return The response from the API call * @throws Exception if the API call fails */ - public ChatStreamResponse createStream( - ChatRequest chatRequest) throws Exception { + public ChatStreamResponse createStream(ChatRequest chatRequest) throws Exception { return createStream(Optional.empty(), chatRequest); } - + /** * Chat * @@ -1651,134 +540,9 @@ public ChatStreamResponse createStream( .timezoneOffset(timezoneOffset) .chatRequest(chatRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/chat#stream"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "chatRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "text/plain") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - ChatStreamRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "chatStream", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "408", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "chatStream", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "chatStream", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "chatStream", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ChatStreamResponse.Builder _resBuilder = - ChatStreamResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ChatStreamResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "text/plain")) { - String _out = Utils.toUtf8AndClose(_httpRes.body()); - _res.withChatRequestStream(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "408", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ChatStreamOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Client.java b/src/main/java/com/glean/api_client/glean_api_client/Client.java index c672562b..fb350ae8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Client.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Client.java @@ -2,26 +2,26 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package com.glean.api_client.glean_api_client; -public class Client { +public class Client { private final SDKConfiguration sdkConfiguration; - private final Activity activity; - private final Announcements announcements; - private final Answers answers; - private final ClientAuthentication authentication; - private final Chat chat; - private final Agents agents; - private final Collections collections; - private final ClientDocuments documents; - private final Insights insights; - private final Messages messages; - private final Pins pins; - private final Search search; - private final Entities entities; - private final ClientShortcuts shortcuts; - private final Verification verification; - private final Tools tools; - private final Governance governance; +private final Activity activity; +private final Announcements announcements; +private final Answers answers; +private final ClientAuthentication authentication; +private final Chat chat; +private final Agents agents; +private final Collections collections; +private final ClientDocuments documents; +private final Insights insights; +private final Messages messages; +private final Pins pins; +private final Search search; +private final Entities entities; +private final ClientShortcuts shortcuts; +private final Verification verification; +private final Tools tools; +private final Governance governance; Client(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; @@ -43,72 +43,55 @@ public class Client { this.tools = new Tools(this.sdkConfiguration); this.governance = new Governance(this.sdkConfiguration); } - - public final Activity activity() { +public final Activity activity() { return activity; } - - public final Announcements announcements() { +public final Announcements announcements() { return announcements; } - - public final Answers answers() { +public final Answers answers() { return answers; } - - public final ClientAuthentication authentication() { +public final ClientAuthentication authentication() { return authentication; } - - public final Chat chat() { +public final Chat chat() { return chat; } - - public final Agents agents() { +public final Agents agents() { return agents; } - - public final Collections collections() { +public final Collections collections() { return collections; } - - public final ClientDocuments documents() { +public final ClientDocuments documents() { return documents; } - - public final Insights insights() { +public final Insights insights() { return insights; } - - public final Messages messages() { +public final Messages messages() { return messages; } - - public final Pins pins() { +public final Pins pins() { return pins; } - - public final Search search() { +public final Search search() { return search; } - - public final Entities entities() { +public final Entities entities() { return entities; } - - public final ClientShortcuts shortcuts() { +public final ClientShortcuts shortcuts() { return shortcuts; } - - public final Verification verification() { +public final Verification verification() { return verification; } - - public final Tools tools() { +public final Tools tools() { return tools; } - - public final Governance governance() { +public final Governance governance() { return governance; } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java b/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java index 3fc3e054..ee7d79fe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java +++ b/src/main/java/com/glean/api_client/glean_api_client/ClientAuthentication.java @@ -3,29 +3,17 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.CreateAuthTokenResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + import com.glean.api_client.glean_api_client.models.operations.CreateauthtokenRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.CreateauthtokenResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.CreateauthtokenOperation; import java.lang.Exception; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class ClientAuthentication implements - MethodCallCreateauthtoken { +public class ClientAuthentication { private final SDKConfiguration sdkConfiguration; ClientAuthentication(SDKConfiguration sdkConfiguration) { @@ -44,7 +32,7 @@ public class ClientAuthentication implements * @return The call builder */ public CreateauthtokenRequestBuilder createToken() { - return new CreateauthtokenRequestBuilder(this); + return new CreateauthtokenRequestBuilder(sdkConfiguration); } /** @@ -60,117 +48,9 @@ public CreateauthtokenRequestBuilder createToken() { * @throws Exception if the API call fails */ public CreateauthtokenResponse createTokenDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/createauthtoken"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createauthtoken", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createauthtoken", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createauthtoken", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createauthtoken", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreateauthtokenResponse.Builder _resBuilder = - CreateauthtokenResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreateauthtokenResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CreateAuthTokenResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withCreateAuthTokenResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new CreateauthtokenOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java b/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java index 33a82d50..79dde632 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java +++ b/src/main/java/com/glean/api_client/glean_api_client/ClientDocuments.java @@ -3,47 +3,30 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.GetDocPermissionsRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocPermissionsResponse; import com.glean.api_client.glean_api_client.models.components.GetDocumentsByFacetsRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentsByFacetsResponse; import com.glean.api_client.glean_api_client.models.components.GetDocumentsRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentsResponse; import com.glean.api_client.glean_api_client.models.components.SummarizeRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.GetdocpermissionsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.GetdocpermissionsResponse; import com.glean.api_client.glean_api_client.models.operations.GetdocumentsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.GetdocumentsResponse; import com.glean.api_client.glean_api_client.models.operations.GetdocumentsbyfacetsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.GetdocumentsbyfacetsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.SummarizeRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.SummarizeResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.GetdocpermissionsOperation; +import com.glean.api_client.glean_api_client.operations.GetdocumentsOperation; +import com.glean.api_client.glean_api_client.operations.GetdocumentsbyfacetsOperation; +import com.glean.api_client.glean_api_client.operations.SummarizeOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class ClientDocuments implements - MethodCallGetdocpermissions, - MethodCallGetdocuments, - MethodCallGetdocumentsbyfacets, - MethodCallSummarize { +public class ClientDocuments { private final SDKConfiguration sdkConfiguration; ClientDocuments(SDKConfiguration sdkConfiguration) { @@ -58,7 +41,7 @@ public class ClientDocuments implements * @return The call builder */ public GetdocpermissionsRequestBuilder retrievePermissions() { - return new GetdocpermissionsRequestBuilder(this); + return new GetdocpermissionsRequestBuilder(sdkConfiguration); } /** @@ -66,136 +49,15 @@ public GetdocpermissionsRequestBuilder retrievePermissions() { * *

Read the emails of all users who have access to the given document. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public GetdocpermissionsResponse retrievePermissions( GetDocPermissionsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getdocpermissions"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocpermissions", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocpermissions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocpermissions", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocpermissions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetdocpermissionsResponse.Builder _resBuilder = - GetdocpermissionsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetdocpermissionsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDocPermissionsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetDocPermissionsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetdocpermissionsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -207,7 +69,7 @@ public GetdocpermissionsResponse retrievePermissions( * @return The call builder */ public GetdocumentsRequestBuilder retrieve() { - return new GetdocumentsRequestBuilder(this); + return new GetdocumentsRequestBuilder(sdkConfiguration); } /** @@ -221,139 +83,21 @@ public GetdocumentsRequestBuilder retrieve() { public GetdocumentsResponse retrieveDirect() throws Exception { return retrieve(Optional.empty()); } - + /** * Read documents * *

Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) for the given list of Glean Document IDs or URLs specified in the request. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public GetdocumentsResponse retrieve( Optional request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getdocuments"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference>() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocuments", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocuments", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetdocumentsResponse.Builder _resBuilder = - GetdocumentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetdocumentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDocumentsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetDocumentsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation, GetdocumentsResponse> operation + = new GetdocumentsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -365,7 +109,7 @@ public GetdocumentsResponse retrieve( * @return The call builder */ public GetdocumentsbyfacetsRequestBuilder retrieveByFacets() { - return new GetdocumentsbyfacetsRequestBuilder(this); + return new GetdocumentsbyfacetsRequestBuilder(sdkConfiguration); } /** @@ -379,139 +123,21 @@ public GetdocumentsbyfacetsRequestBuilder retrieveByFacets() { public GetdocumentsbyfacetsResponse retrieveByFacetsDirect() throws Exception { return retrieveByFacets(Optional.empty()); } - + /** * Read documents by facets * *

Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) macthing the given facet conditions. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public GetdocumentsbyfacetsResponse retrieveByFacets( Optional request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getdocumentsbyfacets"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference>() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocumentsbyfacets", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocumentsbyfacets", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocumentsbyfacets", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocumentsbyfacets", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetdocumentsbyfacetsResponse.Builder _resBuilder = - GetdocumentsbyfacetsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetdocumentsbyfacetsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDocumentsByFacetsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetDocumentsByFacetsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation, GetdocumentsbyfacetsResponse> operation + = new GetdocumentsbyfacetsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -523,7 +149,7 @@ public GetdocumentsbyfacetsResponse retrieveByFacets( * @return The call builder */ public SummarizeRequestBuilder summarize() { - return new SummarizeRequestBuilder(this); + return new SummarizeRequestBuilder(sdkConfiguration); } /** @@ -531,136 +157,15 @@ public SummarizeRequestBuilder summarize() { * *

Generate an AI summary of the requested documents. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public SummarizeResponse summarize( SummarizeRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/summarize"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "summarize", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "summarize", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "summarize", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "summarize", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - SummarizeResponse.Builder _resBuilder = - SummarizeResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - SummarizeResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.SummarizeResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withSummarizeResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new SummarizeOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java b/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java index fc23aebe..8f329af2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java +++ b/src/main/java/com/glean/api_client/glean_api_client/ClientShortcuts.java @@ -3,17 +3,13 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.CreateShortcutRequest; -import com.glean.api_client.glean_api_client.models.components.CreateShortcutResponse; import com.glean.api_client.glean_api_client.models.components.DeleteShortcutRequest; import com.glean.api_client.glean_api_client.models.components.GetShortcutRequestUnion; -import com.glean.api_client.glean_api_client.models.components.GetShortcutResponse; import com.glean.api_client.glean_api_client.models.components.ListShortcutsPaginatedRequest; -import com.glean.api_client.glean_api_client.models.components.ListShortcutsPaginatedResponse; import com.glean.api_client.glean_api_client.models.components.UpdateShortcutRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateShortcutResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.CreateshortcutRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.CreateshortcutResponse; import com.glean.api_client.glean_api_client.models.operations.DeleteshortcutRequestBuilder; @@ -22,33 +18,19 @@ import com.glean.api_client.glean_api_client.models.operations.GetshortcutResponse; import com.glean.api_client.glean_api_client.models.operations.ListshortcutsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ListshortcutsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.UpdateshortcutRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.UpdateshortcutResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.CreateshortcutOperation; +import com.glean.api_client.glean_api_client.operations.DeleteshortcutOperation; +import com.glean.api_client.glean_api_client.operations.GetshortcutOperation; +import com.glean.api_client.glean_api_client.operations.ListshortcutsOperation; +import com.glean.api_client.glean_api_client.operations.UpdateshortcutOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class ClientShortcuts implements - MethodCallCreateshortcut, - MethodCallDeleteshortcut, - MethodCallGetshortcut, - MethodCallListshortcuts, - MethodCallUpdateshortcut { +public class ClientShortcuts { private final SDKConfiguration sdkConfiguration; ClientShortcuts(SDKConfiguration sdkConfiguration) { @@ -63,7 +45,7 @@ public class ClientShortcuts implements * @return The call builder */ public CreateshortcutRequestBuilder create() { - return new CreateshortcutRequestBuilder(this); + return new CreateshortcutRequestBuilder(sdkConfiguration); } /** @@ -71,136 +53,15 @@ public CreateshortcutRequestBuilder create() { * *

Create a user-generated shortcut that contains an alias and destination URL. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreateshortcutResponse create( CreateShortcutRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/createshortcut"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreateshortcutResponse.Builder _resBuilder = - CreateshortcutResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreateshortcutResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CreateShortcutResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withCreateShortcutResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreateshortcutOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -212,7 +73,7 @@ public CreateshortcutResponse create( * @return The call builder */ public DeleteshortcutRequestBuilder delete() { - return new DeleteshortcutRequestBuilder(this); + return new DeleteshortcutRequestBuilder(sdkConfiguration); } /** @@ -220,125 +81,15 @@ public DeleteshortcutRequestBuilder delete() { * *

Delete an existing user-generated shortcut. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public DeleteshortcutResponse delete( DeleteShortcutRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deleteshortcut"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeleteshortcutResponse.Builder _resBuilder = - DeleteshortcutResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeleteshortcutResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeleteshortcutOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -350,7 +101,7 @@ public DeleteshortcutResponse delete( * @return The call builder */ public GetshortcutRequestBuilder retrieve() { - return new GetshortcutRequestBuilder(this); + return new GetshortcutRequestBuilder(sdkConfiguration); } /** @@ -358,136 +109,15 @@ public GetshortcutRequestBuilder retrieve() { * *

Read a particular shortcut's details given its ID. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public GetshortcutResponse retrieve( GetShortcutRequestUnion request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getshortcut"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetshortcutResponse.Builder _resBuilder = - GetshortcutResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetshortcutResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetShortcutResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetShortcutResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetshortcutOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -499,7 +129,7 @@ public GetshortcutResponse retrieve( * @return The call builder */ public ListshortcutsRequestBuilder list() { - return new ListshortcutsRequestBuilder(this); + return new ListshortcutsRequestBuilder(sdkConfiguration); } /** @@ -507,136 +137,15 @@ public ListshortcutsRequestBuilder list() { * *

List shortcuts editable/owned by the currently authenticated user. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public ListshortcutsResponse list( ListShortcutsPaginatedRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/listshortcuts"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListshortcutsResponse.Builder _resBuilder = - ListshortcutsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListshortcutsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ListShortcutsPaginatedResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withListShortcutsPaginatedResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListshortcutsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -648,7 +157,7 @@ public ListshortcutsResponse list( * @return The call builder */ public UpdateshortcutRequestBuilder update() { - return new UpdateshortcutRequestBuilder(this); + return new UpdateshortcutRequestBuilder(sdkConfiguration); } /** @@ -656,136 +165,15 @@ public UpdateshortcutRequestBuilder update() { * *

Updates the shortcut with the given ID. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public UpdateshortcutResponse update( UpdateShortcutRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/updateshortcut"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateshortcut", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updateshortcut", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UpdateshortcutResponse.Builder _resBuilder = - UpdateshortcutResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UpdateshortcutResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UpdateShortcutResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withUpdateShortcutResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UpdateshortcutOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Collections.java b/src/main/java/com/glean/api_client/glean_api_client/Collections.java index 45674e07..bac53f5e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Collections.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Collections.java @@ -3,24 +3,16 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.AddCollectionItemsRequest; -import com.glean.api_client.glean_api_client.models.components.AddCollectionItemsResponse; import com.glean.api_client.glean_api_client.models.components.CreateCollectionRequest; -import com.glean.api_client.glean_api_client.models.components.CreateCollectionResponse; import com.glean.api_client.glean_api_client.models.components.DeleteCollectionItemRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteCollectionItemResponse; import com.glean.api_client.glean_api_client.models.components.DeleteCollectionRequest; import com.glean.api_client.glean_api_client.models.components.EditCollectionItemRequest; -import com.glean.api_client.glean_api_client.models.components.EditCollectionItemResponse; import com.glean.api_client.glean_api_client.models.components.EditCollectionRequest; -import com.glean.api_client.glean_api_client.models.components.EditCollectionResponse; import com.glean.api_client.glean_api_client.models.components.GetCollectionRequest; -import com.glean.api_client.glean_api_client.models.components.GetCollectionResponse; import com.glean.api_client.glean_api_client.models.components.ListCollectionsRequest; -import com.glean.api_client.glean_api_client.models.components.ListCollectionsResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; -import com.glean.api_client.glean_api_client.models.errors.CollectionError; import com.glean.api_client.glean_api_client.models.operations.AddcollectionitemsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.AddcollectionitemsResponse; import com.glean.api_client.glean_api_client.models.operations.CreatecollectionRequestBuilder; @@ -37,34 +29,20 @@ import com.glean.api_client.glean_api_client.models.operations.GetcollectionResponse; import com.glean.api_client.glean_api_client.models.operations.ListcollectionsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ListcollectionsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.AddcollectionitemsOperation; +import com.glean.api_client.glean_api_client.operations.CreatecollectionOperation; +import com.glean.api_client.glean_api_client.operations.DeletecollectionOperation; +import com.glean.api_client.glean_api_client.operations.DeletecollectionitemOperation; +import com.glean.api_client.glean_api_client.operations.EditcollectionOperation; +import com.glean.api_client.glean_api_client.operations.EditcollectionitemOperation; +import com.glean.api_client.glean_api_client.operations.GetcollectionOperation; +import com.glean.api_client.glean_api_client.operations.ListcollectionsOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Collections implements - MethodCallAddcollectionitems, - MethodCallCreatecollection, - MethodCallDeletecollection, - MethodCallDeletecollectionitem, - MethodCallEditcollection, - MethodCallEditcollectionitem, - MethodCallGetcollection, - MethodCallListcollections { +public class Collections { private final SDKConfiguration sdkConfiguration; Collections(SDKConfiguration sdkConfiguration) { @@ -79,7 +57,7 @@ public class Collections implements * @return The call builder */ public AddcollectionitemsRequestBuilder addItems() { - return new AddcollectionitemsRequestBuilder(this); + return new AddcollectionitemsRequestBuilder(sdkConfiguration); } /** @@ -87,136 +65,15 @@ public AddcollectionitemsRequestBuilder addItems() { * *

Add items to a Collection. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public AddcollectionitemsResponse addItems( AddCollectionItemsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/addcollectionitems"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "addcollectionitems", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "addcollectionitems", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "addcollectionitems", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "addcollectionitems", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - AddcollectionitemsResponse.Builder _resBuilder = - AddcollectionitemsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - AddcollectionitemsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - AddCollectionItemsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAddCollectionItemsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new AddcollectionitemsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -228,7 +85,7 @@ public AddcollectionitemsResponse addItems( * @return The call builder */ public CreatecollectionRequestBuilder create() { - return new CreatecollectionRequestBuilder(this); + return new CreatecollectionRequestBuilder(sdkConfiguration); } /** @@ -236,150 +93,15 @@ public CreatecollectionRequestBuilder create() { * *

Create a publicly visible (empty) Collection of documents. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreatecollectionResponse create( CreateCollectionRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/createcollection"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createcollection", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createcollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createcollection", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createcollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreatecollectionResponse.Builder _resBuilder = - CreatecollectionResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreatecollectionResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CreateCollectionResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withCreateCollectionResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "422")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CollectionError _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - throw _out; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreatecollectionOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -391,7 +113,7 @@ public CreatecollectionResponse create( * @return The call builder */ public DeletecollectionRequestBuilder delete() { - return new DeletecollectionRequestBuilder(this); + return new DeletecollectionRequestBuilder(sdkConfiguration); } /** @@ -399,139 +121,15 @@ public DeletecollectionRequestBuilder delete() { * *

Delete a Collection given the Collection's ID. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public DeletecollectionResponse delete( DeleteCollectionRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deletecollection"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollection", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollection", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeletecollectionResponse.Builder _resBuilder = - DeletecollectionResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeletecollectionResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "422")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CollectionError _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - throw _out; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeletecollectionOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -543,7 +141,7 @@ public DeletecollectionResponse delete( * @return The call builder */ public DeletecollectionitemRequestBuilder deleteItem() { - return new DeletecollectionitemRequestBuilder(this); + return new DeletecollectionitemRequestBuilder(sdkConfiguration); } /** @@ -551,136 +149,15 @@ public DeletecollectionitemRequestBuilder deleteItem() { * *

Delete a single item from a Collection. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public DeletecollectionitemResponse deleteItem( DeleteCollectionItemRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/deletecollectionitem"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletecollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeletecollectionitemResponse.Builder _resBuilder = - DeletecollectionitemResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeletecollectionitemResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - DeleteCollectionItemResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withDeleteCollectionItemResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeletecollectionitemOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -692,7 +169,7 @@ public DeletecollectionitemResponse deleteItem( * @return The call builder */ public EditcollectionRequestBuilder update() { - return new EditcollectionRequestBuilder(this); + return new EditcollectionRequestBuilder(sdkConfiguration); } /** @@ -700,150 +177,15 @@ public EditcollectionRequestBuilder update() { * *

Update the properties of an existing Collection. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public EditcollectionResponse update( EditCollectionRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/editcollection"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollection", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollection", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - EditcollectionResponse.Builder _resBuilder = - EditcollectionResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - EditcollectionResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - EditCollectionResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withEditCollectionResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "422")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CollectionError _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - throw _out; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new EditcollectionOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -855,7 +197,7 @@ public EditcollectionResponse update( * @return The call builder */ public EditcollectionitemRequestBuilder updateItem() { - return new EditcollectionitemRequestBuilder(this); + return new EditcollectionitemRequestBuilder(sdkConfiguration); } /** @@ -863,136 +205,15 @@ public EditcollectionitemRequestBuilder updateItem() { * *

Update the URL, Glean Document ID, description of an item within a Collection given its ID. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public EditcollectionitemResponse updateItem( EditCollectionItemRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/editcollectionitem"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editcollectionitem", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - EditcollectionitemResponse.Builder _resBuilder = - EditcollectionitemResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - EditcollectionitemResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - EditCollectionItemResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withEditCollectionItemResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new EditcollectionitemOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1004,7 +225,7 @@ public EditcollectionitemResponse updateItem( * @return The call builder */ public GetcollectionRequestBuilder retrieve() { - return new GetcollectionRequestBuilder(this); + return new GetcollectionRequestBuilder(sdkConfiguration); } /** @@ -1012,136 +233,15 @@ public GetcollectionRequestBuilder retrieve() { * *

Read the details of a Collection given its ID. Does not fetch items in this Collection. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public GetcollectionResponse retrieve( GetCollectionRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getcollection"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getcollection", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getcollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getcollection", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getcollection", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetcollectionResponse.Builder _resBuilder = - GetcollectionResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetcollectionResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetCollectionResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetCollectionResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetcollectionOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1153,7 +253,7 @@ public GetcollectionResponse retrieve( * @return The call builder */ public ListcollectionsRequestBuilder list() { - return new ListcollectionsRequestBuilder(this); + return new ListcollectionsRequestBuilder(sdkConfiguration); } /** @@ -1161,136 +261,15 @@ public ListcollectionsRequestBuilder list() { * *

List all existing Collections. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public ListcollectionsResponse list( ListCollectionsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/listcollections"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listcollections", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listcollections", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listcollections", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listcollections", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListcollectionsResponse.Builder _resBuilder = - ListcollectionsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListcollectionsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ListCollectionsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withListCollectionsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListcollectionsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Data.java b/src/main/java/com/glean/api_client/glean_api_client/Data.java index 6462ec1d..26d1f16f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Data.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Data.java @@ -2,23 +2,21 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package com.glean.api_client.glean_api_client; -public class Data { +public class Data { private final SDKConfiguration sdkConfiguration; - private final Policies policies; - private final Reports reports; +private final Policies policies; +private final Reports reports; Data(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; this.policies = new Policies(this.sdkConfiguration); this.reports = new Reports(this.sdkConfiguration); } - - public final Policies policies() { +public final Policies policies() { return policies; } - - public final Reports reports() { +public final Reports reports() { return reports; } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Datasource.java b/src/main/java/com/glean/api_client/glean_api_client/Datasource.java index 1b0ba89a..0acef9e3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Datasource.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Datasource.java @@ -3,30 +3,19 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.DebugDatasourceStatusResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceStatusRequest; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceStatusRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceStatusResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceStatusOperation; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Datasource implements - MethodCallPostApiIndexV1DebugDatasourceStatus { +public class Datasource { private final SDKConfiguration sdkConfiguration; Datasource(SDKConfiguration sdkConfiguration) { @@ -43,7 +32,7 @@ public class Datasource implements * @return The call builder */ public PostApiIndexV1DebugDatasourceStatusRequestBuilder status() { - return new PostApiIndexV1DebugDatasourceStatusRequestBuilder(this); + return new PostApiIndexV1DebugDatasourceStatusRequestBuilder(sdkConfiguration); } /** @@ -64,120 +53,9 @@ public PostApiIndexV1DebugDatasourceStatusResponse status( .builder() .datasource(datasource) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - PostApiIndexV1DebugDatasourceStatusRequest.class, - _baseUrl, - "/api/index/v1/debug/{datasource}/status", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/status", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/status", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/status", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/status", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DebugDatasourceStatusResponse.Builder _resBuilder = - PostApiIndexV1DebugDatasourceStatusResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DebugDatasourceStatusResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - DebugDatasourceStatusResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withDebugDatasourceStatusResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DebugDatasourceStatusOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Datasources.java b/src/main/java/com/glean/api_client/glean_api_client/Datasources.java index 59ee1ea2..7e438565 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Datasources.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Datasources.java @@ -3,36 +3,22 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.CustomDatasourceConfig; import com.glean.api_client.glean_api_client.models.components.GetDatasourceConfigRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1AdddatasourceRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1AdddatasourceResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetdatasourceconfigRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetdatasourceconfigResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1AdddatasourceOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetdatasourceconfigOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Datasources implements - MethodCallPostApiIndexV1Adddatasource, - MethodCallPostApiIndexV1Getdatasourceconfig { +public class Datasources { private final SDKConfiguration sdkConfiguration; Datasources(SDKConfiguration sdkConfiguration) { @@ -47,7 +33,7 @@ public class Datasources implements * @return The call builder */ public PostApiIndexV1AdddatasourceRequestBuilder add() { - return new PostApiIndexV1AdddatasourceRequestBuilder(this); + return new PostApiIndexV1AdddatasourceRequestBuilder(sdkConfiguration); } /** @@ -55,125 +41,15 @@ public PostApiIndexV1AdddatasourceRequestBuilder add() { * *

Add or update a custom datasource and its schema. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1AdddatasourceResponse add( CustomDatasourceConfig request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/adddatasource"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/adddatasource", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/adddatasource", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/adddatasource", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/adddatasource", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1AdddatasourceResponse.Builder _resBuilder = - PostApiIndexV1AdddatasourceResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1AdddatasourceResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1AdddatasourceOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -185,7 +61,7 @@ public PostApiIndexV1AdddatasourceResponse add( * @return The call builder */ public PostApiIndexV1GetdatasourceconfigRequestBuilder retrieveConfig() { - return new PostApiIndexV1GetdatasourceconfigRequestBuilder(this); + return new PostApiIndexV1GetdatasourceconfigRequestBuilder(sdkConfiguration); } /** @@ -193,136 +69,15 @@ public PostApiIndexV1GetdatasourceconfigRequestBuilder retrieveConfig() { * *

Fetches the datasource config for the specified custom datasource. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1GetdatasourceconfigResponse retrieveConfig( GetDatasourceConfigRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/getdatasourceconfig"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdatasourceconfig", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdatasourceconfig", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdatasourceconfig", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdatasourceconfig", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1GetdatasourceconfigResponse.Builder _resBuilder = - PostApiIndexV1GetdatasourceconfigResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1GetdatasourceconfigResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CustomDatasourceConfig _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withCustomDatasourceConfig(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1GetdatasourceconfigOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Entities.java b/src/main/java/com/glean/api_client/glean_api_client/Entities.java index 0bf9b9fd..ea54fc45 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Entities.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Entities.java @@ -3,37 +3,22 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.ListEntitiesRequest; -import com.glean.api_client.glean_api_client.models.components.ListEntitiesResponse; import com.glean.api_client.glean_api_client.models.components.PeopleRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.ListentitiesRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ListentitiesResponse; import com.glean.api_client.glean_api_client.models.operations.PeopleRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PeopleResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.ListentitiesOperation; +import com.glean.api_client.glean_api_client.operations.PeopleOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Entities implements - MethodCallListentities, - MethodCallPeople { +public class Entities { private final SDKConfiguration sdkConfiguration; Entities(SDKConfiguration sdkConfiguration) { @@ -43,149 +28,28 @@ public class Entities implements /** * List entities * - *

List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint. + *

List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. * * @return The call builder */ public ListentitiesRequestBuilder list() { - return new ListentitiesRequestBuilder(this); + return new ListentitiesRequestBuilder(sdkConfiguration); } /** * List entities * - *

List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint. + *

List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public ListentitiesResponse list( ListEntitiesRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/listentities"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listentities", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listentities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listentities", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listentities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListentitiesResponse.Builder _resBuilder = - ListentitiesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListentitiesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ListEntitiesResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withListEntitiesResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListentitiesOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -197,7 +61,7 @@ public ListentitiesResponse list( * @return The call builder */ public PeopleRequestBuilder readPeople() { - return new PeopleRequestBuilder(this); + return new PeopleRequestBuilder(sdkConfiguration); } /** @@ -205,136 +69,15 @@ public PeopleRequestBuilder readPeople() { * *

Read people details for the given IDs. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PeopleResponse readPeople( PeopleRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/people"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "people", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "people", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "people", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "people", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PeopleResponse.Builder _resBuilder = - PeopleResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PeopleResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.PeopleResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withPeopleResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PeopleOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Glean.java b/src/main/java/com/glean/api_client/glean_api_client/Glean.java index 70161fc6..5522cbcc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Glean.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Glean.java @@ -6,6 +6,7 @@ import com.glean.api_client.glean_api_client.utils.HTTPClient; import com.glean.api_client.glean_api_client.utils.Hook.SdkInitData; import com.glean.api_client.glean_api_client.utils.RetryConfig; +import com.glean.api_client.glean_api_client.utils.SpeakeasyHTTPClient; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.String; import java.util.Map; @@ -40,6 +41,8 @@ public class Glean { "https://{instance}-be.glean.com", }; + + private final Client client; private final Indexing indexing; @@ -51,7 +54,6 @@ public Client client() { public Indexing indexing() { return indexing; } - private SDKConfiguration sdkConfiguration; /** @@ -147,6 +149,21 @@ public Builder retryConfig(RetryConfig retryConfig) { this.sdkConfiguration.setRetryConfig(Optional.of(retryConfig)); return this; } + + /** + * Enables debug logging for HTTP requests and responses, including JSON body content. + * + * Convenience method that calls {@link HTTPClient#enableDebugLogging(boolean)}. + * {@link SpeakeasyHTTPClient} honors this setting. If you are using a custom HTTP client, + * it is up to the custom client to honor this setting. + * + * @return The builder instance. + */ + public Builder enableHTTPDebugLogging(boolean enabled) { + this.sdkConfiguration.client().enableDebugLogging(enabled); + return this; + } + /** * Sets the instance variable for url substitution. * diff --git a/src/main/java/com/glean/api_client/glean_api_client/Governance.java b/src/main/java/com/glean/api_client/glean_api_client/Governance.java index 1ceca919..4d3f0707 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Governance.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Governance.java @@ -2,23 +2,21 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package com.glean.api_client.glean_api_client; -public class Governance { +public class Governance { private final SDKConfiguration sdkConfiguration; - private final Data data; - private final GovernanceDocuments documents; +private final Data data; +private final GovernanceDocuments documents; Governance(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; this.data = new Data(this.sdkConfiguration); this.documents = new GovernanceDocuments(this.sdkConfiguration); } - - public final Data data() { +public final Data data() { return data; } - - public final GovernanceDocuments documents() { +public final GovernanceDocuments documents() { return documents; } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/GovernanceDocuments.java b/src/main/java/com/glean/api_client/glean_api_client/GovernanceDocuments.java index b5ed3e52..fc8ca9f9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/GovernanceDocuments.java +++ b/src/main/java/com/glean/api_client/glean_api_client/GovernanceDocuments.java @@ -2,17 +2,16 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package com.glean.api_client.glean_api_client; -public class GovernanceDocuments { +public class GovernanceDocuments { private final SDKConfiguration sdkConfiguration; - private final Visibilityoverrides visibilityoverrides; +private final Visibilityoverrides visibilityoverrides; GovernanceDocuments(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; this.visibilityoverrides = new Visibilityoverrides(this.sdkConfiguration); } - - public final Visibilityoverrides visibilityoverrides() { +public final Visibilityoverrides visibilityoverrides() { return visibilityoverrides; } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Indexing.java b/src/main/java/com/glean/api_client/glean_api_client/Indexing.java index c1430c77..61199883 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Indexing.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Indexing.java @@ -2,16 +2,16 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package com.glean.api_client.glean_api_client; -public class Indexing { +public class Indexing { private final SDKConfiguration sdkConfiguration; - private final IndexingDocuments documents; - private final Permissions permissions; - private final Datasource datasource; - private final People people; - private final Datasources datasources; - private final IndexingAuthentication authentication; - private final IndexingShortcuts shortcuts; +private final IndexingDocuments documents; +private final Permissions permissions; +private final Datasource datasource; +private final People people; +private final Datasources datasources; +private final IndexingAuthentication authentication; +private final IndexingShortcuts shortcuts; Indexing(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; @@ -23,32 +23,25 @@ public class Indexing { this.authentication = new IndexingAuthentication(this.sdkConfiguration); this.shortcuts = new IndexingShortcuts(this.sdkConfiguration); } - - public final IndexingDocuments documents() { +public final IndexingDocuments documents() { return documents; } - - public final Permissions permissions() { +public final Permissions permissions() { return permissions; } - - public final Datasource datasource() { +public final Datasource datasource() { return datasource; } - - public final People people() { +public final People people() { return people; } - - public final Datasources datasources() { +public final Datasources datasources() { return datasources; } - - public final IndexingAuthentication authentication() { +public final IndexingAuthentication authentication() { return authentication; } - - public final IndexingShortcuts shortcuts() { +public final IndexingShortcuts shortcuts() { return shortcuts; } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java b/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java index 74103237..813234ef 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java +++ b/src/main/java/com/glean/api_client/glean_api_client/IndexingAuthentication.java @@ -3,29 +3,17 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.RotateTokenResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1RotatetokenRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1RotatetokenResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1RotatetokenOperation; import java.lang.Exception; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class IndexingAuthentication implements - MethodCallPostApiIndexV1Rotatetoken { +public class IndexingAuthentication { private final SDKConfiguration sdkConfiguration; IndexingAuthentication(SDKConfiguration sdkConfiguration) { @@ -40,7 +28,7 @@ public class IndexingAuthentication implements * @return The call builder */ public PostApiIndexV1RotatetokenRequestBuilder rotateToken() { - return new PostApiIndexV1RotatetokenRequestBuilder(this); + return new PostApiIndexV1RotatetokenRequestBuilder(sdkConfiguration); } /** @@ -52,117 +40,9 @@ public PostApiIndexV1RotatetokenRequestBuilder rotateToken() { * @throws Exception if the API call fails */ public PostApiIndexV1RotatetokenResponse rotateTokenDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/rotatetoken"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/rotatetoken", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/rotatetoken", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/rotatetoken", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/rotatetoken", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1RotatetokenResponse.Builder _resBuilder = - PostApiIndexV1RotatetokenResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1RotatetokenResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - RotateTokenResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withRotateTokenResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new PostApiIndexV1RotatetokenOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java b/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java index 6a0e2d6b..988ae428 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java +++ b/src/main/java/com/glean/api_client/glean_api_client/IndexingDocuments.java @@ -3,23 +3,18 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.BulkIndexDocumentsRequest; import com.glean.api_client.glean_api_client.models.components.CheckDocumentAccessRequest; -import com.glean.api_client.glean_api_client.models.components.CheckDocumentAccessResponse; import com.glean.api_client.glean_api_client.models.components.DebugDocumentRequest; -import com.glean.api_client.glean_api_client.models.components.DebugDocumentResponse; import com.glean.api_client.glean_api_client.models.components.DebugDocumentsRequest; -import com.glean.api_client.glean_api_client.models.components.DebugDocumentsResponse; import com.glean.api_client.glean_api_client.models.components.DeleteDocumentRequest; import com.glean.api_client.glean_api_client.models.components.GetDocumentCountRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentCountResponse; import com.glean.api_client.glean_api_client.models.components.GetDocumentStatusRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentStatusResponse; import com.glean.api_client.glean_api_client.models.components.IndexDocumentRequest; import com.glean.api_client.glean_api_client.models.components.IndexDocumentsRequest; import com.glean.api_client.glean_api_client.models.components.ProcessAllDocumentsRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexdocumentsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexdocumentsResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1CheckdocumentaccessRequestBuilder; @@ -42,37 +37,24 @@ import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexdocumentsResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessalldocumentsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessalldocumentsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexdocumentsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1CheckdocumentaccessOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceDocumentOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceDocumentsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeletedocumentOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetdocumentcountOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetdocumentstatusOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexdocumentOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexdocumentsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1ProcessalldocumentsOperation; import java.lang.Deprecated; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class IndexingDocuments implements - MethodCallPostApiIndexV1Indexdocument, - MethodCallPostApiIndexV1Indexdocuments, - MethodCallPostApiIndexV1Bulkindexdocuments, - MethodCallPostApiIndexV1Processalldocuments, - MethodCallPostApiIndexV1Deletedocument, - MethodCallPostApiIndexV1DebugDatasourceDocument, - MethodCallPostApiIndexV1DebugDatasourceDocuments, - MethodCallPostApiIndexV1Checkdocumentaccess, - MethodCallPostApiIndexV1Getdocumentstatus, - MethodCallPostApiIndexV1Getdocumentcount { +public class IndexingDocuments { private final SDKConfiguration sdkConfiguration; IndexingDocuments(SDKConfiguration sdkConfiguration) { @@ -87,7 +69,7 @@ public class IndexingDocuments implements * @return The call builder */ public PostApiIndexV1IndexdocumentRequestBuilder addOrUpdate() { - return new PostApiIndexV1IndexdocumentRequestBuilder(this); + return new PostApiIndexV1IndexdocumentRequestBuilder(sdkConfiguration); } /** @@ -95,125 +77,15 @@ public PostApiIndexV1IndexdocumentRequestBuilder addOrUpdate() { * *

Adds a document to the index or updates an existing document. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1IndexdocumentResponse addOrUpdate( IndexDocumentRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/indexdocument"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocument", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocument", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocument", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocument", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1IndexdocumentResponse.Builder _resBuilder = - PostApiIndexV1IndexdocumentResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1IndexdocumentResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1IndexdocumentOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -225,7 +97,7 @@ public PostApiIndexV1IndexdocumentResponse addOrUpdate( * @return The call builder */ public PostApiIndexV1IndexdocumentsRequestBuilder index() { - return new PostApiIndexV1IndexdocumentsRequestBuilder(this); + return new PostApiIndexV1IndexdocumentsRequestBuilder(sdkConfiguration); } /** @@ -233,125 +105,15 @@ public PostApiIndexV1IndexdocumentsRequestBuilder index() { * *

Adds or updates multiple documents in the index. Please refer to the [bulk indexing](https://developers.glean.com/docs/indexing_api_bulk_indexing/#choosing-indexdocuments-vs-bulkindexdocuments) documentation for an explanation of when to use this endpoint. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1IndexdocumentsResponse index( IndexDocumentsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/indexdocuments"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1IndexdocumentsResponse.Builder _resBuilder = - PostApiIndexV1IndexdocumentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1IndexdocumentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1IndexdocumentsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -363,7 +125,7 @@ public PostApiIndexV1IndexdocumentsResponse index( * @return The call builder */ public PostApiIndexV1BulkindexdocumentsRequestBuilder bulkIndex() { - return new PostApiIndexV1BulkindexdocumentsRequestBuilder(this); + return new PostApiIndexV1BulkindexdocumentsRequestBuilder(sdkConfiguration); } /** @@ -371,125 +133,15 @@ public PostApiIndexV1BulkindexdocumentsRequestBuilder bulkIndex() { * *

Replaces the documents in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/docs/indexing_api_bulk_indexing/#bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BulkindexdocumentsResponse bulkIndex( BulkIndexDocumentsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/bulkindexdocuments"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexdocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BulkindexdocumentsResponse.Builder _resBuilder = - PostApiIndexV1BulkindexdocumentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BulkindexdocumentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BulkindexdocumentsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -511,7 +163,7 @@ public PostApiIndexV1BulkindexdocumentsResponse bulkIndex( * @return The call builder */ public PostApiIndexV1ProcessalldocumentsRequestBuilder processAll() { - return new PostApiIndexV1ProcessalldocumentsRequestBuilder(this); + return new PostApiIndexV1ProcessalldocumentsRequestBuilder(sdkConfiguration); } /** @@ -535,7 +187,7 @@ public PostApiIndexV1ProcessalldocumentsRequestBuilder processAll() { public PostApiIndexV1ProcessalldocumentsResponse processAllDirect() throws Exception { return processAll(Optional.empty()); } - + /** * Schedules the processing of uploaded documents * @@ -551,122 +203,15 @@ public PostApiIndexV1ProcessalldocumentsResponse processAllDirect() throws Excep * *

For more frequent document processing, contact Glean support. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1ProcessalldocumentsResponse processAll( Optional request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/processalldocuments"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference>() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processalldocuments", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processalldocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processalldocuments", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processalldocuments", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1ProcessalldocumentsResponse.Builder _resBuilder = - PostApiIndexV1ProcessalldocumentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1ProcessalldocumentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation, PostApiIndexV1ProcessalldocumentsResponse> operation + = new PostApiIndexV1ProcessalldocumentsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -678,7 +223,7 @@ public PostApiIndexV1ProcessalldocumentsResponse processAll( * @return The call builder */ public PostApiIndexV1DeletedocumentRequestBuilder delete() { - return new PostApiIndexV1DeletedocumentRequestBuilder(this); + return new PostApiIndexV1DeletedocumentRequestBuilder(sdkConfiguration); } /** @@ -686,125 +231,15 @@ public PostApiIndexV1DeletedocumentRequestBuilder delete() { * *

Deletes the specified document from the index. Succeeds if document is not present. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1DeletedocumentResponse delete( DeleteDocumentRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/deletedocument"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletedocument", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletedocument", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletedocument", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletedocument", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DeletedocumentResponse.Builder _resBuilder = - PostApiIndexV1DeletedocumentResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DeletedocumentResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DeletedocumentOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -818,7 +253,7 @@ public PostApiIndexV1DeletedocumentResponse delete( * @return The call builder */ public PostApiIndexV1DebugDatasourceDocumentRequestBuilder debug() { - return new PostApiIndexV1DebugDatasourceDocumentRequestBuilder(this); + return new PostApiIndexV1DebugDatasourceDocumentRequestBuilder(sdkConfiguration); } /** @@ -842,133 +277,9 @@ public PostApiIndexV1DebugDatasourceDocumentResponse debug( .datasource(datasource) .debugDocumentRequest(debugDocumentRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - PostApiIndexV1DebugDatasourceDocumentRequest.class, - _baseUrl, - "/api/index/v1/debug/{datasource}/document", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "debugDocumentRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/document", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/document", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/document", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/document", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DebugDatasourceDocumentResponse.Builder _resBuilder = - PostApiIndexV1DebugDatasourceDocumentResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DebugDatasourceDocumentResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - DebugDocumentResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withDebugDocumentResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DebugDatasourceDocumentOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -982,7 +293,7 @@ public PostApiIndexV1DebugDatasourceDocumentResponse debug( * @return The call builder */ public PostApiIndexV1DebugDatasourceDocumentsRequestBuilder debugMany() { - return new PostApiIndexV1DebugDatasourceDocumentsRequestBuilder(this); + return new PostApiIndexV1DebugDatasourceDocumentsRequestBuilder(sdkConfiguration); } /** @@ -1006,133 +317,9 @@ public PostApiIndexV1DebugDatasourceDocumentsResponse debugMany( .datasource(datasource) .debugDocumentsRequest(debugDocumentsRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - PostApiIndexV1DebugDatasourceDocumentsRequest.class, - _baseUrl, - "/api/index/v1/debug/{datasource}/documents", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "debugDocumentsRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/documents", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/documents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/documents", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/documents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DebugDatasourceDocumentsResponse.Builder _resBuilder = - PostApiIndexV1DebugDatasourceDocumentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DebugDatasourceDocumentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - DebugDocumentsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withDebugDocumentsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DebugDatasourceDocumentsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1146,7 +333,7 @@ public PostApiIndexV1DebugDatasourceDocumentsResponse debugMany( * @return The call builder */ public PostApiIndexV1CheckdocumentaccessRequestBuilder checkAccess() { - return new PostApiIndexV1CheckdocumentaccessRequestBuilder(this); + return new PostApiIndexV1CheckdocumentaccessRequestBuilder(sdkConfiguration); } /** @@ -1156,136 +343,15 @@ public PostApiIndexV1CheckdocumentaccessRequestBuilder checkAccess() { * *

Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/docs/indexing_api/indexing_api_troubleshooting/) for more information. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1CheckdocumentaccessResponse checkAccess( CheckDocumentAccessRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/checkdocumentaccess"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/checkdocumentaccess", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/checkdocumentaccess", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/checkdocumentaccess", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/checkdocumentaccess", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1CheckdocumentaccessResponse.Builder _resBuilder = - PostApiIndexV1CheckdocumentaccessResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1CheckdocumentaccessResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CheckDocumentAccessResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withCheckDocumentAccessResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1CheckdocumentaccessOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1301,7 +367,7 @@ public PostApiIndexV1CheckdocumentaccessResponse checkAccess( */ @Deprecated public PostApiIndexV1GetdocumentstatusRequestBuilder status() { - return new PostApiIndexV1GetdocumentstatusRequestBuilder(this); + return new PostApiIndexV1GetdocumentstatusRequestBuilder(sdkConfiguration); } /** @@ -1311,7 +377,7 @@ public PostApiIndexV1GetdocumentstatusRequestBuilder status() { * *

Tip: Use [/debug/{datasource}/document](https://developers.glean.com/docs/indexing_api/indexing_api_troubleshooting/#debug-datasource-document) for richer information. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. @@ -1319,130 +385,9 @@ public PostApiIndexV1GetdocumentstatusRequestBuilder status() { @Deprecated public PostApiIndexV1GetdocumentstatusResponse status( GetDocumentStatusRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/getdocumentstatus"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentstatus", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentstatus", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentstatus", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentstatus", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1GetdocumentstatusResponse.Builder _resBuilder = - PostApiIndexV1GetdocumentstatusResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1GetdocumentstatusResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDocumentStatusResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetDocumentStatusResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1GetdocumentstatusOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1458,7 +403,7 @@ public PostApiIndexV1GetdocumentstatusResponse status( */ @Deprecated public PostApiIndexV1GetdocumentcountRequestBuilder count() { - return new PostApiIndexV1GetdocumentcountRequestBuilder(this); + return new PostApiIndexV1GetdocumentcountRequestBuilder(sdkConfiguration); } /** @@ -1468,7 +413,7 @@ public PostApiIndexV1GetdocumentcountRequestBuilder count() { * *

Tip: Use [/debug/{datasource}/status](https://developers.glean.com/docs/indexing_api/indexing_api_troubleshooting/#debug-datasource-status) for richer information. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. @@ -1476,130 +421,9 @@ public PostApiIndexV1GetdocumentcountRequestBuilder count() { @Deprecated public PostApiIndexV1GetdocumentcountResponse count( GetDocumentCountRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/getdocumentcount"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentcount", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentcount", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentcount", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getdocumentcount", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1GetdocumentcountResponse.Builder _resBuilder = - PostApiIndexV1GetdocumentcountResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1GetdocumentcountResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDocumentCountResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetDocumentCountResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1GetdocumentcountOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java b/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java index 8a803f4c..13ada1bd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java +++ b/src/main/java/com/glean/api_client/glean_api_client/IndexingShortcuts.java @@ -3,36 +3,22 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.BulkIndexShortcutsRequest; import com.glean.api_client.glean_api_client.models.components.UploadShortcutsRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexshortcutsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexshortcutsResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1UploadshortcutsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1UploadshortcutsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexshortcutsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1UploadshortcutsOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class IndexingShortcuts implements - MethodCallPostApiIndexV1Bulkindexshortcuts, - MethodCallPostApiIndexV1Uploadshortcuts { +public class IndexingShortcuts { private final SDKConfiguration sdkConfiguration; IndexingShortcuts(SDKConfiguration sdkConfiguration) { @@ -47,7 +33,7 @@ public class IndexingShortcuts implements * @return The call builder */ public PostApiIndexV1BulkindexshortcutsRequestBuilder bulkIndex() { - return new PostApiIndexV1BulkindexshortcutsRequestBuilder(this); + return new PostApiIndexV1BulkindexshortcutsRequestBuilder(sdkConfiguration); } /** @@ -55,125 +41,15 @@ public PostApiIndexV1BulkindexshortcutsRequestBuilder bulkIndex() { * *

Replaces all the currently indexed shortcuts using paginated batch API calls. Note that this endpoint is used for indexing shortcuts not hosted by Glean. If you want to upload shortcuts that would be hosted by Glean, please use the `/uploadshortcuts` endpoint. For information on what you can do with Golinks, which are Glean-hosted shortcuts, please refer to [this](https://help.glean.com/en/articles/5628838-how-go-links-work) page. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BulkindexshortcutsResponse bulkIndex( BulkIndexShortcutsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/bulkindexshortcuts"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BulkindexshortcutsResponse.Builder _resBuilder = - PostApiIndexV1BulkindexshortcutsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BulkindexshortcutsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BulkindexshortcutsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -185,7 +61,7 @@ public PostApiIndexV1BulkindexshortcutsResponse bulkIndex( * @return The call builder */ public PostApiIndexV1UploadshortcutsRequestBuilder upload() { - return new PostApiIndexV1UploadshortcutsRequestBuilder(this); + return new PostApiIndexV1UploadshortcutsRequestBuilder(sdkConfiguration); } /** @@ -193,125 +69,15 @@ public PostApiIndexV1UploadshortcutsRequestBuilder upload() { * *

Creates glean shortcuts for uploaded shortcuts info. Glean would host the shortcuts, and they can be managed in the knowledge tab once uploaded. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1UploadshortcutsResponse upload( UploadShortcutsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/uploadshortcuts"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/uploadshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/uploadshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/uploadshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/uploadshortcuts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1UploadshortcutsResponse.Builder _resBuilder = - PostApiIndexV1UploadshortcutsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1UploadshortcutsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1UploadshortcutsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Insights.java b/src/main/java/com/glean/api_client/glean_api_client/Insights.java index fac2b935..20a6a796 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Insights.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Insights.java @@ -3,32 +3,18 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.InsightsRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.InsightsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.InsightsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.InsightsOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Insights implements - MethodCallInsights { +public class Insights { private final SDKConfiguration sdkConfiguration; Insights(SDKConfiguration sdkConfiguration) { @@ -43,7 +29,7 @@ public class Insights implements * @return The call builder */ public InsightsRequestBuilder retrieve() { - return new InsightsRequestBuilder(this); + return new InsightsRequestBuilder(sdkConfiguration); } /** @@ -51,136 +37,15 @@ public InsightsRequestBuilder retrieve() { * *

Reads the aggregate information for each user, query, and content. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public InsightsResponse retrieve( InsightsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/insights"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "insights", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "insights", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "insights", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "insights", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - InsightsResponse.Builder _resBuilder = - InsightsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - InsightsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.InsightsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withInsightsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new InsightsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Messages.java b/src/main/java/com/glean/api_client/glean_api_client/Messages.java index 4d5bea29..395200a5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Messages.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Messages.java @@ -3,32 +3,18 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.MessagesRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.MessagesRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.MessagesResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.MessagesOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Messages implements - MethodCallMessages { +public class Messages { private final SDKConfiguration sdkConfiguration; Messages(SDKConfiguration sdkConfiguration) { @@ -43,7 +29,7 @@ public class Messages implements * @return The call builder */ public MessagesRequestBuilder retrieve() { - return new MessagesRequestBuilder(this); + return new MessagesRequestBuilder(sdkConfiguration); } /** @@ -51,136 +37,15 @@ public MessagesRequestBuilder retrieve() { * *

Retrieves list of messages from messaging/chat datasources (e.g. Slack, Teams). * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public MessagesResponse retrieve( MessagesRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/messages"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "messages", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "messages", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "messages", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "messages", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - MessagesResponse.Builder _resBuilder = - MessagesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - MessagesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.MessagesResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withMessagesResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new MessagesOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/People.java b/src/main/java/com/glean/api_client/glean_api_client/People.java index 1bde8144..3b368b8e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/People.java +++ b/src/main/java/com/glean/api_client/glean_api_client/People.java @@ -3,18 +3,17 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + import com.glean.api_client.glean_api_client.models.components.BulkIndexEmployeesRequest; import com.glean.api_client.glean_api_client.models.components.BulkIndexTeamsRequest; import com.glean.api_client.glean_api_client.models.components.DebugUserRequest; -import com.glean.api_client.glean_api_client.models.components.DebugUserResponse; import com.glean.api_client.glean_api_client.models.components.DeleteEmployeeRequest; import com.glean.api_client.glean_api_client.models.components.DeleteTeamRequest; import com.glean.api_client.glean_api_client.models.components.GetUserCountRequest; -import com.glean.api_client.glean_api_client.models.components.GetUserCountResponse; import com.glean.api_client.glean_api_client.models.components.IndexEmployeeRequest; import com.glean.api_client.glean_api_client.models.components.IndexTeamRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexemployeesRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexemployeesResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexteamsRequestBuilder; @@ -34,36 +33,23 @@ import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexteamResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessallemployeesandteamsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessallemployeesandteamsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexemployeesOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexteamsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceUserOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeleteemployeeOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeleteteamOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetusercountOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexemployeeOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexteamOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1ProcessallemployeesandteamsOperation; import java.lang.Deprecated; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class People implements - MethodCallPostApiIndexV1DebugDatasourceUser, - MethodCallPostApiIndexV1Getusercount, - MethodCallPostApiIndexV1Indexemployee, - MethodCallPostApiIndexV1Bulkindexemployees, - MethodCallPostApiIndexV1Processallemployeesandteams, - MethodCallPostApiIndexV1Deleteemployee, - MethodCallPostApiIndexV1Indexteam, - MethodCallPostApiIndexV1Deleteteam, - MethodCallPostApiIndexV1Bulkindexteams { +public class People { private final SDKConfiguration sdkConfiguration; People(SDKConfiguration sdkConfiguration) { @@ -80,7 +66,7 @@ public class People implements * @return The call builder */ public PostApiIndexV1DebugDatasourceUserRequestBuilder debug() { - return new PostApiIndexV1DebugDatasourceUserRequestBuilder(this); + return new PostApiIndexV1DebugDatasourceUserRequestBuilder(sdkConfiguration); } /** @@ -104,133 +90,9 @@ public PostApiIndexV1DebugDatasourceUserResponse debug( .datasource(datasource) .debugUserRequest(debugUserRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - PostApiIndexV1DebugDatasourceUserRequest.class, - _baseUrl, - "/api/index/v1/debug/{datasource}/user", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "debugUserRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/user", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/user", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/user", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/debug/{datasource}/user", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DebugDatasourceUserResponse.Builder _resBuilder = - PostApiIndexV1DebugDatasourceUserResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DebugDatasourceUserResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - DebugUserResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withDebugUserResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DebugDatasourceUserOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -246,7 +108,7 @@ public PostApiIndexV1DebugDatasourceUserResponse debug( */ @Deprecated public PostApiIndexV1GetusercountRequestBuilder count() { - return new PostApiIndexV1GetusercountRequestBuilder(this); + return new PostApiIndexV1GetusercountRequestBuilder(sdkConfiguration); } /** @@ -256,7 +118,7 @@ public PostApiIndexV1GetusercountRequestBuilder count() { * *

Tip: Use [/debug/{datasource}/status](https://developers.glean.com/docs/indexing_api/indexing_api_troubleshooting/#debug-datasource-status) for richer information. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. @@ -264,130 +126,9 @@ public PostApiIndexV1GetusercountRequestBuilder count() { @Deprecated public PostApiIndexV1GetusercountResponse count( GetUserCountRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/getusercount"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getusercount", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getusercount", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getusercount", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/getusercount", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1GetusercountResponse.Builder _resBuilder = - PostApiIndexV1GetusercountResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1GetusercountResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUserCountResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetUserCountResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1GetusercountOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -399,7 +140,7 @@ public PostApiIndexV1GetusercountResponse count( * @return The call builder */ public PostApiIndexV1IndexemployeeRequestBuilder index() { - return new PostApiIndexV1IndexemployeeRequestBuilder(this); + return new PostApiIndexV1IndexemployeeRequestBuilder(sdkConfiguration); } /** @@ -407,125 +148,15 @@ public PostApiIndexV1IndexemployeeRequestBuilder index() { * *

Adds an employee or updates information about an employee * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1IndexemployeeResponse index( IndexEmployeeRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/indexemployee"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexemployee", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexemployee", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexemployee", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexemployee", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1IndexemployeeResponse.Builder _resBuilder = - PostApiIndexV1IndexemployeeResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1IndexemployeeResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1IndexemployeeOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -537,7 +168,7 @@ public PostApiIndexV1IndexemployeeResponse index( * @return The call builder */ public PostApiIndexV1BulkindexemployeesRequestBuilder bulkIndex() { - return new PostApiIndexV1BulkindexemployeesRequestBuilder(this); + return new PostApiIndexV1BulkindexemployeesRequestBuilder(sdkConfiguration); } /** @@ -545,125 +176,15 @@ public PostApiIndexV1BulkindexemployeesRequestBuilder bulkIndex() { * *

Replaces all the currently indexed employees using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/docs/indexing_api_bulk_indexing/#bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BulkindexemployeesResponse bulkIndex( BulkIndexEmployeesRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/bulkindexemployees"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexemployees", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexemployees", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexemployees", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexemployees", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BulkindexemployeesResponse.Builder _resBuilder = - PostApiIndexV1BulkindexemployeesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BulkindexemployeesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BulkindexemployeesOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -675,7 +196,7 @@ public PostApiIndexV1BulkindexemployeesResponse bulkIndex( * @return The call builder */ public PostApiIndexV1ProcessallemployeesandteamsRequestBuilder processAllEmployeesAndTeams() { - return new PostApiIndexV1ProcessallemployeesandteamsRequestBuilder(this); + return new PostApiIndexV1ProcessallemployeesandteamsRequestBuilder(sdkConfiguration); } /** @@ -687,106 +208,9 @@ public PostApiIndexV1ProcessallemployeesandteamsRequestBuilder processAllEmploye * @throws Exception if the API call fails */ public PostApiIndexV1ProcessallemployeesandteamsResponse processAllEmployeesAndTeamsDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/processallemployeesandteams"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallemployeesandteams", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallemployeesandteams", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallemployeesandteams", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallemployeesandteams", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1ProcessallemployeesandteamsResponse.Builder _resBuilder = - PostApiIndexV1ProcessallemployeesandteamsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1ProcessallemployeesandteamsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new PostApiIndexV1ProcessallemployeesandteamsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } @@ -798,7 +222,7 @@ public PostApiIndexV1ProcessallemployeesandteamsResponse processAllEmployeesAndT * @return The call builder */ public PostApiIndexV1DeleteemployeeRequestBuilder delete() { - return new PostApiIndexV1DeleteemployeeRequestBuilder(this); + return new PostApiIndexV1DeleteemployeeRequestBuilder(sdkConfiguration); } /** @@ -806,125 +230,15 @@ public PostApiIndexV1DeleteemployeeRequestBuilder delete() { * *

Delete an employee. Silently succeeds if employee is not present. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1DeleteemployeeResponse delete( DeleteEmployeeRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/deleteemployee"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteemployee", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteemployee", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteemployee", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteemployee", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DeleteemployeeResponse.Builder _resBuilder = - PostApiIndexV1DeleteemployeeResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DeleteemployeeResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DeleteemployeeOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -936,7 +250,7 @@ public PostApiIndexV1DeleteemployeeResponse delete( * @return The call builder */ public PostApiIndexV1IndexteamRequestBuilder indexTeam() { - return new PostApiIndexV1IndexteamRequestBuilder(this); + return new PostApiIndexV1IndexteamRequestBuilder(sdkConfiguration); } /** @@ -944,125 +258,15 @@ public PostApiIndexV1IndexteamRequestBuilder indexTeam() { * *

Adds a team or updates information about a team * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1IndexteamResponse indexTeam( IndexTeamRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/indexteam"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexteam", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexteam", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexteam", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexteam", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1IndexteamResponse.Builder _resBuilder = - PostApiIndexV1IndexteamResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1IndexteamResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1IndexteamOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1074,7 +278,7 @@ public PostApiIndexV1IndexteamResponse indexTeam( * @return The call builder */ public PostApiIndexV1DeleteteamRequestBuilder deleteTeam() { - return new PostApiIndexV1DeleteteamRequestBuilder(this); + return new PostApiIndexV1DeleteteamRequestBuilder(sdkConfiguration); } /** @@ -1082,125 +286,15 @@ public PostApiIndexV1DeleteteamRequestBuilder deleteTeam() { * *

Delete a team based on provided id. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1DeleteteamResponse deleteTeam( DeleteTeamRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/deleteteam"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteteam", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteteam", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteteam", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteteam", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DeleteteamResponse.Builder _resBuilder = - PostApiIndexV1DeleteteamResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DeleteteamResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DeleteteamOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1212,7 +306,7 @@ public PostApiIndexV1DeleteteamResponse deleteTeam( * @return The call builder */ public PostApiIndexV1BulkindexteamsRequestBuilder bulkIndexTeams() { - return new PostApiIndexV1BulkindexteamsRequestBuilder(this); + return new PostApiIndexV1BulkindexteamsRequestBuilder(sdkConfiguration); } /** @@ -1220,125 +314,15 @@ public PostApiIndexV1BulkindexteamsRequestBuilder bulkIndexTeams() { * *

Replaces all the currently indexed teams using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/docs/indexing_api_bulk_indexing/#bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BulkindexteamsResponse bulkIndexTeams( BulkIndexTeamsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/bulkindexteams"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexteams", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexteams", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexteams", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexteams", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BulkindexteamsResponse.Builder _resBuilder = - PostApiIndexV1BulkindexteamsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BulkindexteamsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BulkindexteamsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Permissions.java b/src/main/java/com/glean/api_client/glean_api_client/Permissions.java index be4f4c6e..6cb38702 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Permissions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Permissions.java @@ -3,7 +3,8 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.BulkIndexGroupsRequest; import com.glean.api_client.glean_api_client.models.components.BulkIndexMembershipsRequest; import com.glean.api_client.glean_api_client.models.components.BulkIndexUsersRequest; @@ -16,7 +17,6 @@ import com.glean.api_client.glean_api_client.models.components.IndexUserRequest; import com.glean.api_client.glean_api_client.models.components.ProcessAllMembershipsRequest; import com.glean.api_client.glean_api_client.models.components.UpdatePermissionsRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BetausersRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BetausersResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexgroupsRequestBuilder; @@ -41,38 +41,24 @@ import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessallmembershipsResponse; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1UpdatepermissionsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1UpdatepermissionsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BetausersOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexgroupsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexmembershipsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexusersOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeletegroupOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeletemembershipOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeleteuserOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexgroupOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexmembershipOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexuserOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1ProcessallmembershipsOperation; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1UpdatepermissionsOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Permissions implements - MethodCallPostApiIndexV1Updatepermissions, - MethodCallPostApiIndexV1Indexuser, - MethodCallPostApiIndexV1Bulkindexusers, - MethodCallPostApiIndexV1Indexgroup, - MethodCallPostApiIndexV1Bulkindexgroups, - MethodCallPostApiIndexV1Indexmembership, - MethodCallPostApiIndexV1Bulkindexmemberships, - MethodCallPostApiIndexV1Processallmemberships, - MethodCallPostApiIndexV1Deleteuser, - MethodCallPostApiIndexV1Deletegroup, - MethodCallPostApiIndexV1Deletemembership, - MethodCallPostApiIndexV1Betausers { +public class Permissions { private final SDKConfiguration sdkConfiguration; Permissions(SDKConfiguration sdkConfiguration) { @@ -87,7 +73,7 @@ public class Permissions implements * @return The call builder */ public PostApiIndexV1UpdatepermissionsRequestBuilder updatePermissions() { - return new PostApiIndexV1UpdatepermissionsRequestBuilder(this); + return new PostApiIndexV1UpdatepermissionsRequestBuilder(sdkConfiguration); } /** @@ -95,125 +81,15 @@ public PostApiIndexV1UpdatepermissionsRequestBuilder updatePermissions() { * *

Updates the permissions for a given document without modifying document content. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1UpdatepermissionsResponse updatePermissions( UpdatePermissionsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/updatepermissions"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/updatepermissions", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/updatepermissions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/updatepermissions", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/updatepermissions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1UpdatepermissionsResponse.Builder _resBuilder = - PostApiIndexV1UpdatepermissionsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1UpdatepermissionsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1UpdatepermissionsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -225,7 +101,7 @@ public PostApiIndexV1UpdatepermissionsResponse updatePermissions( * @return The call builder */ public PostApiIndexV1IndexuserRequestBuilder indexUser() { - return new PostApiIndexV1IndexuserRequestBuilder(this); + return new PostApiIndexV1IndexuserRequestBuilder(sdkConfiguration); } /** @@ -233,125 +109,15 @@ public PostApiIndexV1IndexuserRequestBuilder indexUser() { * *

Adds a datasource user or updates an existing user. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1IndexuserResponse indexUser( IndexUserRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/indexuser"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexuser", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexuser", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexuser", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexuser", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1IndexuserResponse.Builder _resBuilder = - PostApiIndexV1IndexuserResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1IndexuserResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1IndexuserOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -363,7 +129,7 @@ public PostApiIndexV1IndexuserResponse indexUser( * @return The call builder */ public PostApiIndexV1BulkindexusersRequestBuilder bulkIndexUsers() { - return new PostApiIndexV1BulkindexusersRequestBuilder(this); + return new PostApiIndexV1BulkindexusersRequestBuilder(sdkConfiguration); } /** @@ -371,125 +137,15 @@ public PostApiIndexV1BulkindexusersRequestBuilder bulkIndexUsers() { * *

Replaces the users in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/docs/indexing_api_bulk_indexing/#bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BulkindexusersResponse bulkIndexUsers( BulkIndexUsersRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/bulkindexusers"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexusers", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexusers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexusers", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexusers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BulkindexusersResponse.Builder _resBuilder = - PostApiIndexV1BulkindexusersResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BulkindexusersResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BulkindexusersOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -501,7 +157,7 @@ public PostApiIndexV1BulkindexusersResponse bulkIndexUsers( * @return The call builder */ public PostApiIndexV1IndexgroupRequestBuilder indexGroup() { - return new PostApiIndexV1IndexgroupRequestBuilder(this); + return new PostApiIndexV1IndexgroupRequestBuilder(sdkConfiguration); } /** @@ -509,125 +165,15 @@ public PostApiIndexV1IndexgroupRequestBuilder indexGroup() { * *

Add or update a group in the datasource. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1IndexgroupResponse indexGroup( IndexGroupRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/indexgroup"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexgroup", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexgroup", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexgroup", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexgroup", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1IndexgroupResponse.Builder _resBuilder = - PostApiIndexV1IndexgroupResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1IndexgroupResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1IndexgroupOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -639,7 +185,7 @@ public PostApiIndexV1IndexgroupResponse indexGroup( * @return The call builder */ public PostApiIndexV1BulkindexgroupsRequestBuilder bulkIndexGroups() { - return new PostApiIndexV1BulkindexgroupsRequestBuilder(this); + return new PostApiIndexV1BulkindexgroupsRequestBuilder(sdkConfiguration); } /** @@ -647,125 +193,15 @@ public PostApiIndexV1BulkindexgroupsRequestBuilder bulkIndexGroups() { * *

Replaces the groups in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/docs/indexing_api_bulk_indexing/#bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BulkindexgroupsResponse bulkIndexGroups( BulkIndexGroupsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/bulkindexgroups"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexgroups", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexgroups", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexgroups", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexgroups", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BulkindexgroupsResponse.Builder _resBuilder = - PostApiIndexV1BulkindexgroupsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BulkindexgroupsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BulkindexgroupsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -777,7 +213,7 @@ public PostApiIndexV1BulkindexgroupsResponse bulkIndexGroups( * @return The call builder */ public PostApiIndexV1IndexmembershipRequestBuilder indexMembership() { - return new PostApiIndexV1IndexmembershipRequestBuilder(this); + return new PostApiIndexV1IndexmembershipRequestBuilder(sdkConfiguration); } /** @@ -785,125 +221,15 @@ public PostApiIndexV1IndexmembershipRequestBuilder indexMembership() { * *

Add the memberships of a group in the datasource. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1IndexmembershipResponse indexMembership( IndexMembershipRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/indexmembership"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexmembership", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexmembership", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexmembership", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/indexmembership", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1IndexmembershipResponse.Builder _resBuilder = - PostApiIndexV1IndexmembershipResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1IndexmembershipResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1IndexmembershipOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -915,7 +241,7 @@ public PostApiIndexV1IndexmembershipResponse indexMembership( * @return The call builder */ public PostApiIndexV1BulkindexmembershipsRequestBuilder bulkIndexMemberships() { - return new PostApiIndexV1BulkindexmembershipsRequestBuilder(this); + return new PostApiIndexV1BulkindexmembershipsRequestBuilder(sdkConfiguration); } /** @@ -923,125 +249,15 @@ public PostApiIndexV1BulkindexmembershipsRequestBuilder bulkIndexMemberships() { * *

Replaces the memberships for a group in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/docs/indexing_api_bulk_indexing/#bulk-upload-model) documentation for an explanation of how to use bulk endpoints. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BulkindexmembershipsResponse bulkIndexMemberships( BulkIndexMembershipsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/bulkindexmemberships"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexmemberships", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexmemberships", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexmemberships", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/bulkindexmemberships", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BulkindexmembershipsResponse.Builder _resBuilder = - PostApiIndexV1BulkindexmembershipsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BulkindexmembershipsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BulkindexmembershipsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1053,7 +269,7 @@ public PostApiIndexV1BulkindexmembershipsResponse bulkIndexMemberships( * @return The call builder */ public PostApiIndexV1ProcessallmembershipsRequestBuilder processMemberships() { - return new PostApiIndexV1ProcessallmembershipsRequestBuilder(this); + return new PostApiIndexV1ProcessallmembershipsRequestBuilder(sdkConfiguration); } /** @@ -1067,128 +283,21 @@ public PostApiIndexV1ProcessallmembershipsRequestBuilder processMemberships() { public PostApiIndexV1ProcessallmembershipsResponse processMembershipsDirect() throws Exception { return processMemberships(Optional.empty()); } - + /** * Schedules the processing of group memberships * *

Schedules the immediate processing of all group memberships uploaded through the indexing API. By default the uploaded group memberships will be processed asynchronously but this API can be used to schedule processing of all memberships on demand. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1ProcessallmembershipsResponse processMemberships( Optional request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/processallmemberships"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference>() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallmemberships", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallmemberships", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallmemberships", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/processallmemberships", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1ProcessallmembershipsResponse.Builder _resBuilder = - PostApiIndexV1ProcessallmembershipsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1ProcessallmembershipsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation, PostApiIndexV1ProcessallmembershipsResponse> operation + = new PostApiIndexV1ProcessallmembershipsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1200,7 +309,7 @@ public PostApiIndexV1ProcessallmembershipsResponse processMemberships( * @return The call builder */ public PostApiIndexV1DeleteuserRequestBuilder deleteUser() { - return new PostApiIndexV1DeleteuserRequestBuilder(this); + return new PostApiIndexV1DeleteuserRequestBuilder(sdkConfiguration); } /** @@ -1208,125 +317,15 @@ public PostApiIndexV1DeleteuserRequestBuilder deleteUser() { * *

Delete the user from the datasource. Silently succeeds if user is not present. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1DeleteuserResponse deleteUser( DeleteUserRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/deleteuser"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteuser", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteuser", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteuser", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deleteuser", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DeleteuserResponse.Builder _resBuilder = - PostApiIndexV1DeleteuserResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DeleteuserResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DeleteuserOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1338,7 +337,7 @@ public PostApiIndexV1DeleteuserResponse deleteUser( * @return The call builder */ public PostApiIndexV1DeletegroupRequestBuilder deleteGroup() { - return new PostApiIndexV1DeletegroupRequestBuilder(this); + return new PostApiIndexV1DeletegroupRequestBuilder(sdkConfiguration); } /** @@ -1346,125 +345,15 @@ public PostApiIndexV1DeletegroupRequestBuilder deleteGroup() { * *

Delete group from the datasource. Silently succeeds if group is not present. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1DeletegroupResponse deleteGroup( DeleteGroupRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/deletegroup"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletegroup", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletegroup", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletegroup", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletegroup", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DeletegroupResponse.Builder _resBuilder = - PostApiIndexV1DeletegroupResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DeletegroupResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DeletegroupOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1476,7 +365,7 @@ public PostApiIndexV1DeletegroupResponse deleteGroup( * @return The call builder */ public PostApiIndexV1DeletemembershipRequestBuilder deleteMembership() { - return new PostApiIndexV1DeletemembershipRequestBuilder(this); + return new PostApiIndexV1DeletemembershipRequestBuilder(sdkConfiguration); } /** @@ -1484,125 +373,15 @@ public PostApiIndexV1DeletemembershipRequestBuilder deleteMembership() { * *

Delete membership to a group in the specified datasource. Silently succeeds if membership is not present. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1DeletemembershipResponse deleteMembership( DeleteMembershipRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/deletemembership"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletemembership", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletemembership", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletemembership", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/deletemembership", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1DeletemembershipResponse.Builder _resBuilder = - PostApiIndexV1DeletemembershipResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1DeletemembershipResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1DeletemembershipOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -1614,7 +393,7 @@ public PostApiIndexV1DeletemembershipResponse deleteMembership( * @return The call builder */ public PostApiIndexV1BetausersRequestBuilder authorizeBetaUsers() { - return new PostApiIndexV1BetausersRequestBuilder(this); + return new PostApiIndexV1BetausersRequestBuilder(sdkConfiguration); } /** @@ -1622,125 +401,15 @@ public PostApiIndexV1BetausersRequestBuilder authorizeBetaUsers() { * *

Allow the datasource be visible to the specified beta users. The default behaviour is datasource being visible to all users if it is enabled and not visible to any user if it is not enabled. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostApiIndexV1BetausersResponse authorizeBetaUsers( GreenlistUsersRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/api/index/v1/betausers"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/betausers", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/betausers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/betausers", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/api/index/v1/betausers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostApiIndexV1BetausersResponse.Builder _resBuilder = - PostApiIndexV1BetausersResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostApiIndexV1BetausersResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "409", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostApiIndexV1BetausersOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Pins.java b/src/main/java/com/glean/api_client/glean_api_client/Pins.java index 1af44be8..b2dd4011 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Pins.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Pins.java @@ -3,15 +3,12 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.EditPinRequest; import com.glean.api_client.glean_api_client.models.components.GetPinRequest; -import com.glean.api_client.glean_api_client.models.components.GetPinResponse; -import com.glean.api_client.glean_api_client.models.components.ListPinsResponse; -import com.glean.api_client.glean_api_client.models.components.PinDocument; import com.glean.api_client.glean_api_client.models.components.PinRequest; import com.glean.api_client.glean_api_client.models.components.Unpin; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.EditpinRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.EditpinResponse; import com.glean.api_client.glean_api_client.models.operations.GetpinRequestBuilder; @@ -21,33 +18,19 @@ import com.glean.api_client.glean_api_client.models.operations.ListpinsResponse; import com.glean.api_client.glean_api_client.models.operations.PinRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PinResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.UnpinRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.UnpinResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.EditpinOperation; +import com.glean.api_client.glean_api_client.operations.GetpinOperation; +import com.glean.api_client.glean_api_client.operations.ListpinsOperation; +import com.glean.api_client.glean_api_client.operations.PinOperation; +import com.glean.api_client.glean_api_client.operations.UnpinOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Pins implements - MethodCallEditpin, - MethodCallGetpin, - MethodCallListpins, - MethodCallPin, - MethodCallUnpin { +public class Pins { private final SDKConfiguration sdkConfiguration; Pins(SDKConfiguration sdkConfiguration) { @@ -62,7 +45,7 @@ public class Pins implements * @return The call builder */ public EditpinRequestBuilder update() { - return new EditpinRequestBuilder(this); + return new EditpinRequestBuilder(sdkConfiguration); } /** @@ -70,136 +53,15 @@ public EditpinRequestBuilder update() { * *

Update an existing user-generated pin. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public EditpinResponse update( EditPinRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/editpin"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "editpin", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editpin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "editpin", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "editpin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - EditpinResponse.Builder _resBuilder = - EditpinResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - EditpinResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PinDocument _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withPinDocument(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new EditpinOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -211,7 +73,7 @@ public EditpinResponse update( * @return The call builder */ public GetpinRequestBuilder retrieve() { - return new GetpinRequestBuilder(this); + return new GetpinRequestBuilder(sdkConfiguration); } /** @@ -219,136 +81,15 @@ public GetpinRequestBuilder retrieve() { * *

Read pin details given its ID. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public GetpinResponse retrieve( GetPinRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/getpin"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpin", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpin", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetpinResponse.Builder _resBuilder = - GetpinResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetpinResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPinResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetPinResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetpinOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -360,7 +101,7 @@ public GetpinResponse retrieve( * @return The call builder */ public ListpinsRequestBuilder list() { - return new ListpinsRequestBuilder(this); + return new ListpinsRequestBuilder(sdkConfiguration); } /** @@ -368,136 +109,15 @@ public ListpinsRequestBuilder list() { * *

Lists all pins. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public ListpinsResponse list( ListpinsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/listpins"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpins", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpins", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpins", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpins", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListpinsResponse.Builder _resBuilder = - ListpinsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListpinsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ListPinsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withListPinsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListpinsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -509,7 +129,7 @@ public ListpinsResponse list( * @return The call builder */ public PinRequestBuilder create() { - return new PinRequestBuilder(this); + return new PinRequestBuilder(sdkConfiguration); } /** @@ -517,136 +137,15 @@ public PinRequestBuilder create() { * *

Pin a document as a result for a given search query.Pin results that are known to be a good match. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PinResponse create( PinRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/pin"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "pin", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "pin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "pin", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "pin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PinResponse.Builder _resBuilder = - PinResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PinResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PinDocument _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withPinDocument(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PinOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -658,7 +157,7 @@ public PinResponse create( * @return The call builder */ public UnpinRequestBuilder remove() { - return new UnpinRequestBuilder(this); + return new UnpinRequestBuilder(sdkConfiguration); } /** @@ -666,125 +165,15 @@ public UnpinRequestBuilder remove() { * *

Unpin a previously pinned result. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public UnpinResponse remove( Unpin request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/unpin"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "unpin", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "unpin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "unpin", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "unpin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UnpinResponse.Builder _resBuilder = - UnpinResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UnpinResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UnpinOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Policies.java b/src/main/java/com/glean/api_client/glean_api_client/Policies.java index 469f8e09..f3df6563 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Policies.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Policies.java @@ -3,14 +3,10 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.CreateDlpReportRequest; -import com.glean.api_client.glean_api_client.models.components.CreateDlpReportResponse; -import com.glean.api_client.glean_api_client.models.components.GetDlpReportResponse; -import com.glean.api_client.glean_api_client.models.components.ListDlpReportsResponse; import com.glean.api_client.glean_api_client.models.components.UpdateDlpReportRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateDlpReportResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.CreatepolicyRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.CreatepolicyResponse; import com.glean.api_client.glean_api_client.models.operations.DownloadpolicycsvRequest; @@ -22,36 +18,23 @@ import com.glean.api_client.glean_api_client.models.operations.ListpoliciesRequest; import com.glean.api_client.glean_api_client.models.operations.ListpoliciesRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ListpoliciesResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.UpdatepolicyRequest; import com.glean.api_client.glean_api_client.models.operations.UpdatepolicyRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.UpdatepolicyResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.CreatepolicyOperation; +import com.glean.api_client.glean_api_client.operations.DownloadpolicycsvOperation; +import com.glean.api_client.glean_api_client.operations.GetpolicyOperation; +import com.glean.api_client.glean_api_client.operations.ListpoliciesOperation; +import com.glean.api_client.glean_api_client.operations.UpdatepolicyOperation; import java.lang.Boolean; import java.lang.Exception; import java.lang.Long; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Policies implements - MethodCallGetpolicy, - MethodCallUpdatepolicy, - MethodCallListpolicies, - MethodCallCreatepolicy, - MethodCallDownloadpolicycsv { +public class Policies { private final SDKConfiguration sdkConfiguration; Policies(SDKConfiguration sdkConfiguration) { @@ -66,7 +49,7 @@ public class Policies implements * @return The call builder */ public GetpolicyRequestBuilder retrieve() { - return new GetpolicyRequestBuilder(this); + return new GetpolicyRequestBuilder(sdkConfiguration); } /** @@ -78,11 +61,10 @@ public GetpolicyRequestBuilder retrieve() { * @return The response from the API call * @throws Exception if the API call fails */ - public GetpolicyResponse retrieve( - String id) throws Exception { + public GetpolicyResponse retrieve(String id) throws Exception { return retrieve(id, Optional.empty()); } - + /** * Gets specified policy * @@ -102,125 +84,9 @@ public GetpolicyResponse retrieve( .id(id) .version(version) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetpolicyRequest.class, - _baseUrl, - "/rest/api/v1/governance/data/policies/{id}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetpolicyRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpolicy", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpolicy", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpolicy", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getpolicy", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetpolicyResponse.Builder _resBuilder = - GetpolicyResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetpolicyResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDlpReportResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetDlpReportResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetpolicyOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -232,7 +98,7 @@ public GetpolicyResponse retrieve( * @return The call builder */ public UpdatepolicyRequestBuilder update() { - return new UpdatepolicyRequestBuilder(this); + return new UpdatepolicyRequestBuilder(sdkConfiguration); } /** @@ -254,133 +120,9 @@ public UpdatepolicyResponse update( .id(id) .updateDlpReportRequest(updateDlpReportRequest) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - UpdatepolicyRequest.class, - _baseUrl, - "/rest/api/v1/governance/data/policies/{id}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "updateDlpReportRequest", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatepolicy", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatepolicy", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatepolicy", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatepolicy", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UpdatepolicyResponse.Builder _resBuilder = - UpdatepolicyResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UpdatepolicyResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - UpdateDlpReportResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withUpdateDlpReportResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UpdatepolicyOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -392,7 +134,7 @@ public UpdatepolicyResponse update( * @return The call builder */ public ListpoliciesRequestBuilder list() { - return new ListpoliciesRequestBuilder(this); + return new ListpoliciesRequestBuilder(sdkConfiguration); } /** @@ -406,7 +148,7 @@ public ListpoliciesRequestBuilder list() { public ListpoliciesResponse listDirect() throws Exception { return list(Optional.empty(), Optional.empty()); } - + /** * Lists policies * @@ -426,123 +168,9 @@ public ListpoliciesResponse list( .autoHide(autoHide) .frequency(frequency) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/governance/data/policies"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - ListpoliciesRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpolicies", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpolicies", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpolicies", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listpolicies", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListpoliciesResponse.Builder _resBuilder = - ListpoliciesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListpoliciesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ListDlpReportsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withListDlpReportsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListpoliciesOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -554,7 +182,7 @@ public ListpoliciesResponse list( * @return The call builder */ public CreatepolicyRequestBuilder create() { - return new CreatepolicyRequestBuilder(this); + return new CreatepolicyRequestBuilder(sdkConfiguration); } /** @@ -562,136 +190,15 @@ public CreatepolicyRequestBuilder create() { * *

Creates a new policy with specified specifications and returns its id. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreatepolicyResponse create( CreateDlpReportRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/governance/data/policies"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createpolicy", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createpolicy", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createpolicy", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createpolicy", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreatepolicyResponse.Builder _resBuilder = - CreatepolicyResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreatepolicyResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - CreateDlpReportResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withCreateDlpReportResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreatepolicyOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -703,7 +210,7 @@ public CreatepolicyResponse create( * @return The call builder */ public DownloadpolicycsvRequestBuilder download() { - return new DownloadpolicycsvRequestBuilder(this); + return new DownloadpolicycsvRequestBuilder(sdkConfiguration); } /** @@ -722,118 +229,9 @@ public DownloadpolicycsvResponse download( .builder() .id(id) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - DownloadpolicycsvRequest.class, - _baseUrl, - "/rest/api/v1/governance/data/policies/{id}/download", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "text/csv; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadpolicycsv", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadpolicycsv", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadpolicycsv", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadpolicycsv", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DownloadpolicycsvResponse.Builder _resBuilder = - DownloadpolicycsvResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DownloadpolicycsvResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "text/csv; charset=UTF-8")) { - String _out = Utils.toUtf8AndClose(_httpRes.body()); - _res.withRes(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DownloadpolicycsvOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Reports.java b/src/main/java/com/glean/api_client/glean_api_client/Reports.java index 359ed5df..24767f79 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Reports.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Reports.java @@ -3,11 +3,9 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.ReportStatusResponse; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.UpdateDlpConfigRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateDlpConfigResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.CreatereportRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.CreatereportResponse; import com.glean.api_client.glean_api_client.models.operations.DownloadreportcsvRequest; @@ -16,29 +14,16 @@ import com.glean.api_client.glean_api_client.models.operations.GetreportstatusRequest; import com.glean.api_client.glean_api_client.models.operations.GetreportstatusRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.GetreportstatusResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.CreatereportOperation; +import com.glean.api_client.glean_api_client.operations.DownloadreportcsvOperation; +import com.glean.api_client.glean_api_client.operations.GetreportstatusOperation; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Reports implements - MethodCallCreatereport, - MethodCallDownloadreportcsv, - MethodCallGetreportstatus { +public class Reports { private final SDKConfiguration sdkConfiguration; Reports(SDKConfiguration sdkConfiguration) { @@ -53,7 +38,7 @@ public class Reports implements * @return The call builder */ public CreatereportRequestBuilder create() { - return new CreatereportRequestBuilder(this); + return new CreatereportRequestBuilder(sdkConfiguration); } /** @@ -61,136 +46,15 @@ public CreatereportRequestBuilder create() { * *

Creates a new one-time report and executes its batch job. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public CreatereportResponse create( UpdateDlpConfigRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/governance/data/reports"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createreport", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createreport", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createreport", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createreport", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreatereportResponse.Builder _resBuilder = - CreatereportResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreatereportResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - UpdateDlpConfigResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withUpdateDlpConfigResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CreatereportOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -202,7 +66,7 @@ public CreatereportResponse create( * @return The call builder */ public DownloadreportcsvRequestBuilder download() { - return new DownloadreportcsvRequestBuilder(this); + return new DownloadreportcsvRequestBuilder(sdkConfiguration); } /** @@ -221,118 +85,9 @@ public DownloadreportcsvResponse download( .builder() .id(id) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - DownloadreportcsvRequest.class, - _baseUrl, - "/rest/api/v1/governance/data/reports/{id}/download", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "text/csv; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadreportcsv", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadreportcsv", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadreportcsv", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "downloadreportcsv", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DownloadreportcsvResponse.Builder _resBuilder = - DownloadreportcsvResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DownloadreportcsvResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "text/csv; charset=UTF-8")) { - String _out = Utils.toUtf8AndClose(_httpRes.body()); - _res.withRes(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DownloadreportcsvOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -344,7 +99,7 @@ public DownloadreportcsvResponse download( * @return The call builder */ public GetreportstatusRequestBuilder status() { - return new GetreportstatusRequestBuilder(this); + return new GetreportstatusRequestBuilder(sdkConfiguration); } /** @@ -363,120 +118,9 @@ public GetreportstatusResponse status( .builder() .id(id) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetreportstatusRequest.class, - _baseUrl, - "/rest/api/v1/governance/data/reports/{id}/status", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getreportstatus", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getreportstatus", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getreportstatus", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getreportstatus", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetreportstatusResponse.Builder _resBuilder = - GetreportstatusResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetreportstatusResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - ReportStatusResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withReportStatusResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetreportstatusOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java index d0b3feb8..df0a4c60 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java +++ b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java @@ -21,8 +21,8 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "0.9.0"; - public static final String SDK_VERSION = "0.5.6"; - public static final String GEN_VERSION = "2.629.2"; + public static final String SDK_VERSION = "0.6.0"; + public static final String GEN_VERSION = "2.651.2"; private static final String BASE_PACKAGE = "com.glean.api_client.glean_api_client"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/glean/api_client/glean_api_client/Search.java b/src/main/java/com/glean/api_client/glean_api_client/Search.java index 53bf440d..ce1e53a2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Search.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Search.java @@ -3,15 +3,12 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.AutocompleteRequest; import com.glean.api_client.glean_api_client.models.components.FeedRequest; import com.glean.api_client.glean_api_client.models.components.RecommendationsRequest; -import com.glean.api_client.glean_api_client.models.components.ResultsResponse; import com.glean.api_client.glean_api_client.models.components.SearchRequest; -import com.glean.api_client.glean_api_client.models.components.SearchResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; -import com.glean.api_client.glean_api_client.models.errors.GleanDataError; import com.glean.api_client.glean_api_client.models.operations.AdminsearchRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.AdminsearchResponse; import com.glean.api_client.glean_api_client.models.operations.AutocompleteRequestBuilder; @@ -20,32 +17,19 @@ import com.glean.api_client.glean_api_client.models.operations.FeedResponse; import com.glean.api_client.glean_api_client.models.operations.RecommendationsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.RecommendationsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.SearchRequestBuilder; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.models.operations.SearchResponse; +import com.glean.api_client.glean_api_client.operations.AdminsearchOperation; +import com.glean.api_client.glean_api_client.operations.AutocompleteOperation; +import com.glean.api_client.glean_api_client.operations.FeedOperation; +import com.glean.api_client.glean_api_client.operations.RecommendationsOperation; +import com.glean.api_client.glean_api_client.operations.SearchOperation; import java.lang.Exception; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Search implements - MethodCallAdminsearch, - MethodCallAutocomplete, - MethodCallFeed, - MethodCallRecommendations, - MethodCallSearch { +public class Search { private final SDKConfiguration sdkConfiguration; Search(SDKConfiguration sdkConfiguration) { @@ -60,7 +44,7 @@ public class Search implements * @return The call builder */ public AdminsearchRequestBuilder queryAsAdmin() { - return new AdminsearchRequestBuilder(this); + return new AdminsearchRequestBuilder(sdkConfiguration); } /** @@ -68,150 +52,15 @@ public AdminsearchRequestBuilder queryAsAdmin() { * *

Retrieves results for search query without respect for permissions. This is available only to privileged users. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public AdminsearchResponse queryAsAdmin( SearchRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/adminsearch"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "adminsearch", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "422", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "adminsearch", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "adminsearch", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "adminsearch", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - AdminsearchResponse.Builder _resBuilder = - AdminsearchResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - AdminsearchResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - SearchResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withSearchResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "422")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GleanDataError _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - throw _out; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new AdminsearchOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -223,7 +72,7 @@ public AdminsearchResponse queryAsAdmin( * @return The call builder */ public AutocompleteRequestBuilder autocomplete() { - return new AutocompleteRequestBuilder(this); + return new AutocompleteRequestBuilder(sdkConfiguration); } /** @@ -231,136 +80,15 @@ public AutocompleteRequestBuilder autocomplete() { * *

Retrieve query suggestions, operators and documents for the given partially typed query. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public AutocompleteResponse autocomplete( AutocompleteRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/autocomplete"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "autocomplete", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "autocomplete", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "autocomplete", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "autocomplete", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - AutocompleteResponse.Builder _resBuilder = - AutocompleteResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - AutocompleteResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.AutocompleteResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAutocompleteResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new AutocompleteOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -372,7 +100,7 @@ public AutocompleteResponse autocomplete( * @return The call builder */ public FeedRequestBuilder retrieveFeed() { - return new FeedRequestBuilder(this); + return new FeedRequestBuilder(sdkConfiguration); } /** @@ -380,136 +108,15 @@ public FeedRequestBuilder retrieveFeed() { * *

The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public FeedResponse retrieveFeed( FeedRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/feed"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "feed", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "408", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "feed", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "feed", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "feed", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - FeedResponse.Builder _resBuilder = - FeedResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - FeedResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.FeedResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withFeedResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "408", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new FeedOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -521,7 +128,7 @@ public FeedResponse retrieveFeed( * @return The call builder */ public RecommendationsRequestBuilder recommendations() { - return new RecommendationsRequestBuilder(this); + return new RecommendationsRequestBuilder(sdkConfiguration); } /** @@ -529,140 +136,15 @@ public RecommendationsRequestBuilder recommendations() { * *

Retrieve recommended documents for the given URL or Glean Document ID. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public RecommendationsResponse recommendations( RecommendationsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/recommendations"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "recommendations", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "recommendations", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "recommendations", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "recommendations", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - RecommendationsResponse.Builder _resBuilder = - RecommendationsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - RecommendationsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ResultsResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withResultsResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "202", "204")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new RecommendationsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -674,7 +156,7 @@ public RecommendationsResponse recommendations( * @return The call builder */ public SearchRequestBuilder query() { - return new SearchRequestBuilder(this); + return new SearchRequestBuilder(sdkConfiguration); } /** @@ -682,150 +164,15 @@ public SearchRequestBuilder query() { * *

Retrieve results from the index for the given query and filters. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public com.glean.api_client.glean_api_client.models.operations.SearchResponse query( + public SearchResponse query( SearchRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/search"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "search", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "408", "422", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "search", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "search", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "search", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - com.glean.api_client.glean_api_client.models.operations.SearchResponse.Builder _resBuilder = - com.glean.api_client.glean_api_client.models.operations.SearchResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - com.glean.api_client.glean_api_client.models.operations.SearchResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - SearchResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withSearchResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "422")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GleanDataError _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - throw _out; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "408", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new SearchOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Tools.java b/src/main/java/com/glean/api_client/glean_api_client/Tools.java index eaf71901..d43b63cc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Tools.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Tools.java @@ -3,38 +3,23 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.ToolsCallRequest; -import com.glean.api_client.glean_api_client.models.components.ToolsCallResponse; -import com.glean.api_client.glean_api_client.models.components.ToolsListResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.GetRestApiV1ToolsListRequest; import com.glean.api_client.glean_api_client.models.operations.GetRestApiV1ToolsListRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.GetRestApiV1ToolsListResponse; import com.glean.api_client.glean_api_client.models.operations.PostRestApiV1ToolsCallRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PostRestApiV1ToolsCallResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.GetRestApiV1ToolsListOperation; +import com.glean.api_client.glean_api_client.operations.PostRestApiV1ToolsCallOperation; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Tools implements - MethodCallGetRestApiV1ToolsList, - MethodCallPostRestApiV1ToolsCall { +public class Tools { private final SDKConfiguration sdkConfiguration; Tools(SDKConfiguration sdkConfiguration) { @@ -49,7 +34,7 @@ public class Tools implements * @return The call builder */ public GetRestApiV1ToolsListRequestBuilder list() { - return new GetRestApiV1ToolsListRequestBuilder(this); + return new GetRestApiV1ToolsListRequestBuilder(sdkConfiguration); } /** @@ -63,7 +48,7 @@ public GetRestApiV1ToolsListRequestBuilder list() { public GetRestApiV1ToolsListResponse listDirect() throws Exception { return list(Optional.empty()); } - + /** * List available tools * @@ -80,123 +65,9 @@ public GetRestApiV1ToolsListResponse list( .builder() .toolNames(toolNames) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/tools/list"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetRestApiV1ToolsListRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get_/rest/api/v1/tools/list", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get_/rest/api/v1/tools/list", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get_/rest/api/v1/tools/list", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get_/rest/api/v1/tools/list", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetRestApiV1ToolsListResponse.Builder _resBuilder = - GetRestApiV1ToolsListResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetRestApiV1ToolsListResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ToolsListResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withToolsListResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetRestApiV1ToolsListOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -208,7 +79,7 @@ public GetRestApiV1ToolsListResponse list( * @return The call builder */ public PostRestApiV1ToolsCallRequestBuilder run() { - return new PostRestApiV1ToolsCallRequestBuilder(this); + return new PostRestApiV1ToolsCallRequestBuilder(sdkConfiguration); } /** @@ -216,136 +87,15 @@ public PostRestApiV1ToolsCallRequestBuilder run() { * *

Execute the specified tool with provided parameters * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public PostRestApiV1ToolsCallResponse run( ToolsCallRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/tools/call"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/rest/api/v1/tools/call", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/rest/api/v1/tools/call", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/rest/api/v1/tools/call", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post_/rest/api/v1/tools/call", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostRestApiV1ToolsCallResponse.Builder _resBuilder = - PostRestApiV1ToolsCallResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostRestApiV1ToolsCallResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ToolsCallResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withToolsCallResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostRestApiV1ToolsCallOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Verification.java b/src/main/java/com/glean/api_client/glean_api_client/Verification.java index 39221b17..117c7f8b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Verification.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Verification.java @@ -3,42 +3,27 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.ReminderRequest; -import com.glean.api_client.glean_api_client.models.components.VerificationFeed; import com.glean.api_client.glean_api_client.models.components.VerifyRequest; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.AddverificationreminderRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.AddverificationreminderResponse; import com.glean.api_client.glean_api_client.models.operations.ListverificationsRequest; import com.glean.api_client.glean_api_client.models.operations.ListverificationsRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.ListverificationsResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.VerifyRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.VerifyResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.AddverificationreminderOperation; +import com.glean.api_client.glean_api_client.operations.ListverificationsOperation; +import com.glean.api_client.glean_api_client.operations.VerifyOperation; import java.lang.Exception; import java.lang.Long; -import java.lang.Object; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Verification implements - MethodCallAddverificationreminder, - MethodCallListverifications, - MethodCallVerify { +public class Verification { private final SDKConfiguration sdkConfiguration; Verification(SDKConfiguration sdkConfiguration) { @@ -53,7 +38,7 @@ public class Verification implements * @return The call builder */ public AddverificationreminderRequestBuilder addReminder() { - return new AddverificationreminderRequestBuilder(this); + return new AddverificationreminderRequestBuilder(sdkConfiguration); } /** @@ -61,136 +46,15 @@ public AddverificationreminderRequestBuilder addReminder() { * *

Creates a verification reminder for the document. Users can create verification reminders from different product surfaces. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public AddverificationreminderResponse addReminder( ReminderRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/addverificationreminder"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "addverificationreminder", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "addverificationreminder", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "addverificationreminder", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "addverificationreminder", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - AddverificationreminderResponse.Builder _resBuilder = - AddverificationreminderResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - AddverificationreminderResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.Verification _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withVerification(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new AddverificationreminderOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -202,7 +66,7 @@ public AddverificationreminderResponse addReminder( * @return The call builder */ public ListverificationsRequestBuilder list() { - return new ListverificationsRequestBuilder(this); + return new ListverificationsRequestBuilder(sdkConfiguration); } /** @@ -216,7 +80,7 @@ public ListverificationsRequestBuilder list() { public ListverificationsResponse listDirect() throws Exception { return list(Optional.empty()); } - + /** * List verifications * @@ -233,123 +97,9 @@ public ListverificationsResponse list( .builder() .count(count) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/listverifications"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - ListverificationsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "listverifications", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listverifications", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "listverifications", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "listverifications", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ListverificationsResponse.Builder _resBuilder = - ListverificationsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ListverificationsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - VerificationFeed _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withVerificationFeed(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ListverificationsOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -361,7 +111,7 @@ public ListverificationsResponse list( * @return The call builder */ public VerifyRequestBuilder verify() { - return new VerifyRequestBuilder(this); + return new VerifyRequestBuilder(sdkConfiguration); } /** @@ -369,136 +119,15 @@ public VerifyRequestBuilder verify() { * *

Verify documents to keep the knowledge up to date within customer corpus. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public VerifyResponse verify( VerifyRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/verify"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "verify", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "verify", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "verify", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "verify", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - VerifyResponse.Builder _resBuilder = - VerifyResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - VerifyResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - com.glean.api_client.glean_api_client.models.components.Verification _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withVerification(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "429", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new VerifyOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java b/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java index 91a369a5..a11cbb96 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Visibilityoverrides.java @@ -3,38 +3,23 @@ */ package com.glean.api_client.glean_api_client; -import com.fasterxml.jackson.core.type.TypeReference; -import com.glean.api_client.glean_api_client.models.components.GetDocumentVisibilityOverridesResponse; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + import com.glean.api_client.glean_api_client.models.components.UpdateDocumentVisibilityOverridesRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateDocumentVisibilityOverridesResponse; -import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.operations.GetdocvisibilityRequest; import com.glean.api_client.glean_api_client.models.operations.GetdocvisibilityRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.GetdocvisibilityResponse; -import com.glean.api_client.glean_api_client.models.operations.SDKMethodInterfaces.*; import com.glean.api_client.glean_api_client.models.operations.SetdocvisibilityRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.SetdocvisibilityResponse; -import com.glean.api_client.glean_api_client.utils.HTTPClient; -import com.glean.api_client.glean_api_client.utils.HTTPRequest; -import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; -import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; -import com.glean.api_client.glean_api_client.utils.SerializedBody; -import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; -import com.glean.api_client.glean_api_client.utils.Utils; -import java.io.InputStream; +import com.glean.api_client.glean_api_client.operations.GetdocvisibilityOperation; +import com.glean.api_client.glean_api_client.operations.SetdocvisibilityOperation; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; import java.util.List; import java.util.Optional; -public class Visibilityoverrides implements - MethodCallGetdocvisibility, - MethodCallSetdocvisibility { +public class Visibilityoverrides { private final SDKConfiguration sdkConfiguration; Visibilityoverrides(SDKConfiguration sdkConfiguration) { @@ -49,7 +34,7 @@ public class Visibilityoverrides implements * @return The call builder */ public GetdocvisibilityRequestBuilder list() { - return new GetdocvisibilityRequestBuilder(this); + return new GetdocvisibilityRequestBuilder(sdkConfiguration); } /** @@ -63,7 +48,7 @@ public GetdocvisibilityRequestBuilder list() { public GetdocvisibilityResponse listDirect() throws Exception { return list(Optional.empty()); } - + /** * Fetches documents visibility * @@ -80,123 +65,9 @@ public GetdocvisibilityResponse list( .builder() .docIds(docIds) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/governance/documents/visibilityoverrides"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetdocvisibilityRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetdocvisibilityResponse.Builder _resBuilder = - GetdocvisibilityResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetdocvisibilityResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - GetDocumentVisibilityOverridesResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGetDocumentVisibilityOverridesResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetdocvisibilityOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } @@ -208,7 +79,7 @@ public GetdocvisibilityResponse list( * @return The call builder */ public SetdocvisibilityRequestBuilder create() { - return new SetdocvisibilityRequestBuilder(this); + return new SetdocvisibilityRequestBuilder(sdkConfiguration); } /** @@ -216,136 +87,15 @@ public SetdocvisibilityRequestBuilder create() { * *

Sets the visibility-override state of the documents specified, effectively hiding or un-hiding documents. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ public SetdocvisibilityResponse create( UpdateDocumentVisibilityOverridesRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/rest/api/v1/governance/documents/visibilityoverrides"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "json", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json; charset=UTF-8") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "setdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "setdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "setdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "setdocvisibility", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - SetdocvisibilityResponse.Builder _resBuilder = - SetdocvisibilityResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - SetdocvisibilityResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json; charset=UTF-8")) { - UpdateDocumentVisibilityOverridesResponse _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withUpdateDocumentVisibilityOverridesResponse(Optional.ofNullable(_out)); - return _res; - } else { - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new APIException( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new SetdocvisibilityOperation( sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Activity.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Activity.java index 7d70c962..02fea71e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Activity.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Activity.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class Activity { @@ -50,12 +49,12 @@ public boolean equals(java.lang.Object o) { } Activity other = (Activity) o; return - Objects.deepEquals(this.events, other.events); + Utils.enhancedDeepEquals(this.events, other.events); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( events); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEnum.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEnum.java index 459e1cac..e69ed28b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEnum.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEnum.java @@ -20,7 +20,7 @@ public enum ActivityEnum { @JsonValue private final String value; - private ActivityEnum(String value) { + ActivityEnum(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEvent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEvent.java index ed99d550..18d75f17 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEvent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEvent.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class ActivityEvent { @@ -183,16 +182,16 @@ public boolean equals(java.lang.Object o) { } ActivityEvent other = (ActivityEvent) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.action, other.action) && - Objects.deepEquals(this.params, other.params) && - Objects.deepEquals(this.timestamp, other.timestamp) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.action, other.action) && + Utils.enhancedDeepEquals(this.params, other.params) && + Utils.enhancedDeepEquals(this.timestamp, other.timestamp) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, action, params, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventAction.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventAction.java index 7e9e0b56..e35b384e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventAction.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventAction.java @@ -25,7 +25,7 @@ public enum ActivityEventAction { @JsonValue private final String value; - private ActivityEventAction(String value) { + ActivityEventAction(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventParams.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventParams.java index 4dfcb68d..f258534a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventParams.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ActivityEventParams.java @@ -13,7 +13,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ActivityEventParams { @@ -365,20 +364,20 @@ public boolean equals(java.lang.Object o) { } ActivityEventParams other = (ActivityEventParams) o; return - Objects.deepEquals(this.bodyContent, other.bodyContent) && - Objects.deepEquals(this.datasourceInstance, other.datasourceInstance) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.instanceOnlyName, other.instanceOnlyName) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.referrer, other.referrer) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.truncated, other.truncated); + Utils.enhancedDeepEquals(this.bodyContent, other.bodyContent) && + Utils.enhancedDeepEquals(this.datasourceInstance, other.datasourceInstance) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.instanceOnlyName, other.instanceOnlyName) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.referrer, other.referrer) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.truncated, other.truncated); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( bodyContent, datasourceInstance, datasource, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsError.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsError.java index 6d457604..44c22071 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsError.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class AddCollectionItemsError { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } AddCollectionItemsError other = (AddCollectionItemsError) o; return - Objects.deepEquals(this.errorType, other.errorType); + Utils.enhancedDeepEquals(this.errorType, other.errorType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( errorType); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsErrorErrorType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsErrorErrorType.java index 254966cd..e3275f81 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsErrorErrorType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsErrorErrorType.java @@ -14,7 +14,7 @@ public enum AddCollectionItemsErrorErrorType { @JsonValue private final String value; - private AddCollectionItemsErrorErrorType(String value) { + AddCollectionItemsErrorErrorType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsRequest.java index fdf1f627..b2c6dc97 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AddCollectionItemsRequest { @@ -106,13 +105,13 @@ public boolean equals(java.lang.Object o) { } AddCollectionItemsRequest other = (AddCollectionItemsRequest) o; return - Objects.deepEquals(this.collectionId, other.collectionId) && - Objects.deepEquals(this.addedCollectionItemDescriptors, other.addedCollectionItemDescriptors); + Utils.enhancedDeepEquals(this.collectionId, other.collectionId) && + Utils.enhancedDeepEquals(this.addedCollectionItemDescriptors, other.addedCollectionItemDescriptors); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( collectionId, addedCollectionItemDescriptors); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsResponse.java index 92ea188f..7caabef7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AddCollectionItemsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class AddCollectionItemsResponse { @@ -90,13 +89,13 @@ public boolean equals(java.lang.Object o) { } AddCollectionItemsResponse other = (AddCollectionItemsResponse) o; return - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( collection, error); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AdditionalFieldDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AdditionalFieldDefinition.java index 92cbc0b6..afcddf29 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AdditionalFieldDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AdditionalFieldDefinition.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -175,13 +174,13 @@ public boolean equals(java.lang.Object o) { } AdditionalFieldDefinition other = (AdditionalFieldDefinition) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.value, other.value); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.value, other.value); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( key, value); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Agent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Agent.java index 3debfd19..a5d518d7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Agent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Agent.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class Agent { @@ -203,16 +202,16 @@ public boolean equals(java.lang.Object o) { } Agent other = (Agent) o; return - Objects.deepEquals(this.agentId, other.agentId) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.capabilities, other.capabilities); + Utils.enhancedDeepEquals(this.agentId, other.agentId) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.capabilities, other.capabilities); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agentId, name, description, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentCapabilities.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentCapabilities.java index 740b35e6..ae460ccc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentCapabilities.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentCapabilities.java @@ -17,7 +17,6 @@ import java.lang.String; import java.util.HashMap; import java.util.Map; -import java.util.Objects; import java.util.Optional; /** @@ -148,14 +147,14 @@ public boolean equals(java.lang.Object o) { } AgentCapabilities other = (AgentCapabilities) o; return - Objects.deepEquals(this.apIoMessages, other.apIoMessages) && - Objects.deepEquals(this.apIoStreaming, other.apIoStreaming) && - Objects.deepEquals(this.additionalProperties, other.additionalProperties); + Utils.enhancedDeepEquals(this.apIoMessages, other.apIoMessages) && + Utils.enhancedDeepEquals(this.apIoStreaming, other.apIoStreaming) && + Utils.enhancedDeepEquals(this.additionalProperties, other.additionalProperties); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( apIoMessages, apIoStreaming, additionalProperties); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentConfig.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentConfig.java index c37823e0..60266380 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentConfig.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentConfig.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -119,13 +118,13 @@ public boolean equals(java.lang.Object o) { } AgentConfig other = (AgentConfig) o; return - Objects.deepEquals(this.agent, other.agent) && - Objects.deepEquals(this.mode, other.mode); + Utils.enhancedDeepEquals(this.agent, other.agent) && + Utils.enhancedDeepEquals(this.mode, other.mode); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agent, mode); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentEnum.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentEnum.java index 43ad39df..28af34d9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentEnum.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentEnum.java @@ -21,7 +21,7 @@ public enum AgentEnum { @JsonValue private final String value; - private AgentEnum(String value) { + AgentEnum(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentExecutionStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentExecutionStatus.java index 606b033d..ff8e1a50 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentExecutionStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentExecutionStatus.java @@ -20,7 +20,7 @@ public enum AgentExecutionStatus { @JsonValue private final String value; - private AgentExecutionStatus(String value) { + AgentExecutionStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentMetadata.java index a8acf345..8b56e85b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentMetadata.java @@ -7,7 +7,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * AgentMetadata @@ -40,7 +39,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java index 9ef3f698..2792a2fd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRun.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; /** @@ -223,16 +222,16 @@ public boolean equals(java.lang.Object o) { } AgentRun other = (AgentRun) o; return - Objects.deepEquals(this.agentId, other.agentId) && - Objects.deepEquals(this.input, other.input) && - Objects.deepEquals(this.messages, other.messages) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.agentId, other.agentId) && + Utils.enhancedDeepEquals(this.input, other.input) && + Utils.enhancedDeepEquals(this.messages, other.messages) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agentId, input, messages, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java index 584fb2e4..8c95168f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunCreate.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; /** @@ -186,15 +185,15 @@ public boolean equals(java.lang.Object o) { } AgentRunCreate other = (AgentRunCreate) o; return - Objects.deepEquals(this.agentId, other.agentId) && - Objects.deepEquals(this.input, other.input) && - Objects.deepEquals(this.messages, other.messages) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.agentId, other.agentId) && + Utils.enhancedDeepEquals(this.input, other.input) && + Utils.enhancedDeepEquals(this.messages, other.messages) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agentId, input, messages, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunWaitResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunWaitResponse.java index 85ff280d..af33c651 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunWaitResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentRunWaitResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AgentRunWaitResponse { @@ -103,13 +102,13 @@ public boolean equals(java.lang.Object o) { } AgentRunWaitResponse other = (AgentRunWaitResponse) o; return - Objects.deepEquals(this.run, other.run) && - Objects.deepEquals(this.messages, other.messages); + Utils.enhancedDeepEquals(this.run, other.run) && + Utils.enhancedDeepEquals(this.messages, other.messages); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( run, messages); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentSchemas.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentSchemas.java index 0a6bd66f..e6688e33 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentSchemas.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AgentSchemas.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * AgentSchemas @@ -115,14 +114,14 @@ public boolean equals(java.lang.Object o) { } AgentSchemas other = (AgentSchemas) o; return - Objects.deepEquals(this.agentId, other.agentId) && - Objects.deepEquals(this.inputSchema, other.inputSchema) && - Objects.deepEquals(this.outputSchema, other.outputSchema); + Utils.enhancedDeepEquals(this.agentId, other.agentId) && + Utils.enhancedDeepEquals(this.inputSchema, other.inputSchema) && + Utils.enhancedDeepEquals(this.outputSchema, other.outputSchema); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agentId, inputSchema, outputSchema); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppActionCounts.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppActionCounts.java index e85555f2..6ee5850d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppActionCounts.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppActionCounts.java @@ -16,7 +16,6 @@ import java.lang.String; import java.util.HashMap; import java.util.Map; -import java.util.Objects; import java.util.Optional; /** @@ -288,18 +287,18 @@ public boolean equals(java.lang.Object o) { } AiAppActionCounts other = (AiAppActionCounts) o; return - Objects.deepEquals(this.totalSlackbotResponses, other.totalSlackbotResponses) && - Objects.deepEquals(this.totalSlackbotResponsesShared, other.totalSlackbotResponsesShared) && - Objects.deepEquals(this.totalSlackbotResponsesNotHelpful, other.totalSlackbotResponsesNotHelpful) && - Objects.deepEquals(this.totalChatMessages, other.totalChatMessages) && - Objects.deepEquals(this.totalUpvotes, other.totalUpvotes) && - Objects.deepEquals(this.totalDownvotes, other.totalDownvotes) && - Objects.deepEquals(this.additionalProperties, other.additionalProperties); + Utils.enhancedDeepEquals(this.totalSlackbotResponses, other.totalSlackbotResponses) && + Utils.enhancedDeepEquals(this.totalSlackbotResponsesShared, other.totalSlackbotResponsesShared) && + Utils.enhancedDeepEquals(this.totalSlackbotResponsesNotHelpful, other.totalSlackbotResponsesNotHelpful) && + Utils.enhancedDeepEquals(this.totalChatMessages, other.totalChatMessages) && + Utils.enhancedDeepEquals(this.totalUpvotes, other.totalUpvotes) && + Utils.enhancedDeepEquals(this.totalDownvotes, other.totalDownvotes) && + Utils.enhancedDeepEquals(this.additionalProperties, other.additionalProperties); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( totalSlackbotResponses, totalSlackbotResponsesShared, totalSlackbotResponsesNotHelpful, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppsInsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppsInsightsResponse.java index 34d53a48..1799441a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppsInsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AiAppsInsightsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AiAppsInsightsResponse { @@ -213,16 +212,16 @@ public boolean equals(java.lang.Object o) { } AiAppsInsightsResponse other = (AiAppsInsightsResponse) o; return - Objects.deepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && - Objects.deepEquals(this.aiAppInsights, other.aiAppInsights) && - Objects.deepEquals(this.totalActiveUsers, other.totalActiveUsers) && - Objects.deepEquals(this.actionCounts, other.actionCounts) && - Objects.deepEquals(this.departments, other.departments); + Utils.enhancedDeepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && + Utils.enhancedDeepEquals(this.aiAppInsights, other.aiAppInsights) && + Utils.enhancedDeepEquals(this.totalActiveUsers, other.totalActiveUsers) && + Utils.enhancedDeepEquals(this.actionCounts, other.actionCounts) && + Utils.enhancedDeepEquals(this.departments, other.departments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastLogTimestamp, aiAppInsights, totalActiveUsers, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AiInsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AiInsightsResponse.java index 927f23aa..d0e93d32 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AiInsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AiInsightsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AiInsightsResponse { @@ -464,23 +463,23 @@ public boolean equals(java.lang.Object o) { } AiInsightsResponse other = (AiInsightsResponse) o; return - Objects.deepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && - Objects.deepEquals(this.assistantInsights, other.assistantInsights) && - Objects.deepEquals(this.totalActiveAssistantUsers, other.totalActiveAssistantUsers) && - Objects.deepEquals(this.totalChatMessages, other.totalChatMessages) && - Objects.deepEquals(this.totalAiSummarizations, other.totalAiSummarizations) && - Objects.deepEquals(this.totalAiAnswers, other.totalAiAnswers) && - Objects.deepEquals(this.totalUpvotes, other.totalUpvotes) && - Objects.deepEquals(this.totalDownvotes, other.totalDownvotes) && - Objects.deepEquals(this.totalGleanbotResponses, other.totalGleanbotResponses) && - Objects.deepEquals(this.totalGleanbotResponsesShared, other.totalGleanbotResponsesShared) && - Objects.deepEquals(this.totalGleanbotResponsesNotHelpful, other.totalGleanbotResponsesNotHelpful) && - Objects.deepEquals(this.departments, other.departments); + Utils.enhancedDeepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && + Utils.enhancedDeepEquals(this.assistantInsights, other.assistantInsights) && + Utils.enhancedDeepEquals(this.totalActiveAssistantUsers, other.totalActiveAssistantUsers) && + Utils.enhancedDeepEquals(this.totalChatMessages, other.totalChatMessages) && + Utils.enhancedDeepEquals(this.totalAiSummarizations, other.totalAiSummarizations) && + Utils.enhancedDeepEquals(this.totalAiAnswers, other.totalAiAnswers) && + Utils.enhancedDeepEquals(this.totalUpvotes, other.totalUpvotes) && + Utils.enhancedDeepEquals(this.totalDownvotes, other.totalDownvotes) && + Utils.enhancedDeepEquals(this.totalGleanbotResponses, other.totalGleanbotResponses) && + Utils.enhancedDeepEquals(this.totalGleanbotResponsesShared, other.totalGleanbotResponsesShared) && + Utils.enhancedDeepEquals(this.totalGleanbotResponsesNotHelpful, other.totalGleanbotResponsesNotHelpful) && + Utils.enhancedDeepEquals(this.departments, other.departments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastLogTimestamp, assistantInsights, totalActiveAssistantUsers, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AllowlistOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AllowlistOptions.java index 0e2f2ff0..5b1840e5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AllowlistOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AllowlistOptions.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -83,12 +82,12 @@ public boolean equals(java.lang.Object o) { } AllowlistOptions other = (AllowlistOptions) o; return - Objects.deepEquals(this.terms, other.terms); + Utils.enhancedDeepEquals(this.terms, other.terms); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( terms); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Announcement.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Announcement.java index cdb0e7c2..6d62d898 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Announcement.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Announcement.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Announcement { @@ -823,35 +822,35 @@ public boolean equals(java.lang.Object o) { } Announcement other = (Announcement) o; return - Objects.deepEquals(this.startTime, other.startTime) && - Objects.deepEquals(this.endTime, other.endTime) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.body, other.body) && - Objects.deepEquals(this.emoji, other.emoji) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.banner, other.banner) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.sourceDocumentId, other.sourceDocumentId) && - Objects.deepEquals(this.hideAttribution, other.hideAttribution) && - Objects.deepEquals(this.channel, other.channel) && - Objects.deepEquals(this.postType, other.postType) && - Objects.deepEquals(this.isPrioritized, other.isPrioritized) && - Objects.deepEquals(this.viewUrl, other.viewUrl) && - Objects.deepEquals(this.draftId, other.draftId) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.createTimestamp, other.createTimestamp) && - Objects.deepEquals(this.lastUpdateTimestamp, other.lastUpdateTimestamp) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.viewerInfo, other.viewerInfo) && - Objects.deepEquals(this.sourceDocument, other.sourceDocument) && - Objects.deepEquals(this.isPublished, other.isPublished); + Utils.enhancedDeepEquals(this.startTime, other.startTime) && + Utils.enhancedDeepEquals(this.endTime, other.endTime) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.body, other.body) && + Utils.enhancedDeepEquals(this.emoji, other.emoji) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.banner, other.banner) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.sourceDocumentId, other.sourceDocumentId) && + Utils.enhancedDeepEquals(this.hideAttribution, other.hideAttribution) && + Utils.enhancedDeepEquals(this.channel, other.channel) && + Utils.enhancedDeepEquals(this.postType, other.postType) && + Utils.enhancedDeepEquals(this.isPrioritized, other.isPrioritized) && + Utils.enhancedDeepEquals(this.viewUrl, other.viewUrl) && + Utils.enhancedDeepEquals(this.draftId, other.draftId) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.createTimestamp, other.createTimestamp) && + Utils.enhancedDeepEquals(this.lastUpdateTimestamp, other.lastUpdateTimestamp) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.viewerInfo, other.viewerInfo) && + Utils.enhancedDeepEquals(this.sourceDocument, other.sourceDocument) && + Utils.enhancedDeepEquals(this.isPublished, other.isPublished); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( startTime, endTime, title, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementChannel.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementChannel.java index b661ac3f..97c540de 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementChannel.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementChannel.java @@ -20,7 +20,7 @@ public enum AnnouncementChannel { @JsonValue private final String value; - private AnnouncementChannel(String value) { + AnnouncementChannel(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementPostType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementPostType.java index 1aee14e3..dd667540 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementPostType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementPostType.java @@ -20,7 +20,7 @@ public enum AnnouncementPostType { @JsonValue private final String value; - private AnnouncementPostType(String value) { + AnnouncementPostType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementViewerInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementViewerInfo.java index f3465731..b15ad555 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementViewerInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnnouncementViewerInfo.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class AnnouncementViewerInfo { @@ -112,13 +111,13 @@ public boolean equals(java.lang.Object o) { } AnnouncementViewerInfo other = (AnnouncementViewerInfo) o; return - Objects.deepEquals(this.isDismissed, other.isDismissed) && - Objects.deepEquals(this.isRead, other.isRead); + Utils.enhancedDeepEquals(this.isDismissed, other.isDismissed) && + Utils.enhancedDeepEquals(this.isRead, other.isRead); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( isDismissed, isRead); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEvent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEvent.java index 593855b0..90381dde 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEvent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEvent.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -107,13 +106,13 @@ public boolean equals(java.lang.Object o) { } AnonymousEvent other = (AnonymousEvent) o; return - Objects.deepEquals(this.time, other.time) && - Objects.deepEquals(this.eventType, other.eventType); + Utils.enhancedDeepEquals(this.time, other.time) && + Utils.enhancedDeepEquals(this.eventType, other.eventType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( time, eventType); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEventEventType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEventEventType.java index f939a502..9cd42efe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEventEventType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnonymousEventEventType.java @@ -20,7 +20,7 @@ public enum AnonymousEventEventType { @JsonValue private final String value; - private AnonymousEventEventType(String value) { + AnonymousEventEventType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Answer.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Answer.java index 2feec4f8..2512431f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Answer.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Answer.java @@ -9,13 +9,13 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Deprecated; import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Answer { @@ -52,10 +52,13 @@ public class Answer { private Optional bodyText; /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("boardId") + @Deprecated private Optional boardId; /** @@ -274,8 +277,11 @@ public Optional bodyText() { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated @JsonIgnore public Optional boardId() { return boardId; @@ -490,8 +496,11 @@ public Answer withBodyText(Optional bodyText) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Answer withBoardId(long boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = Optional.ofNullable(boardId); @@ -499,8 +508,11 @@ public Answer withBoardId(long boardId) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Answer withBoardId(Optional boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = boardId; @@ -782,35 +794,35 @@ public boolean equals(java.lang.Object o) { } Answer other = (Answer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.docId, other.docId) && - Objects.deepEquals(this.question, other.question) && - Objects.deepEquals(this.questionVariations, other.questionVariations) && - Objects.deepEquals(this.bodyText, other.bodyText) && - Objects.deepEquals(this.boardId, other.boardId) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.roles, other.roles) && - Objects.deepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && - Objects.deepEquals(this.sourceType, other.sourceType) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.combinedAnswerText, other.combinedAnswerText) && - Objects.deepEquals(this.likes, other.likes) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.verification, other.verification) && - Objects.deepEquals(this.board, other.board) && - Objects.deepEquals(this.collections, other.collections) && - Objects.deepEquals(this.documentCategory, other.documentCategory) && - Objects.deepEquals(this.sourceDocument, other.sourceDocument); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.docId, other.docId) && + Utils.enhancedDeepEquals(this.question, other.question) && + Utils.enhancedDeepEquals(this.questionVariations, other.questionVariations) && + Utils.enhancedDeepEquals(this.bodyText, other.bodyText) && + Utils.enhancedDeepEquals(this.boardId, other.boardId) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.roles, other.roles) && + Utils.enhancedDeepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && + Utils.enhancedDeepEquals(this.sourceType, other.sourceType) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.combinedAnswerText, other.combinedAnswerText) && + Utils.enhancedDeepEquals(this.likes, other.likes) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.verification, other.verification) && + Utils.enhancedDeepEquals(this.board, other.board) && + Utils.enhancedDeepEquals(this.collections, other.collections) && + Utils.enhancedDeepEquals(this.documentCategory, other.documentCategory) && + Utils.enhancedDeepEquals(this.sourceDocument, other.sourceDocument); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, docId, question, @@ -878,6 +890,7 @@ public final static class Builder { private Optional bodyText = Optional.empty(); + @Deprecated private Optional boardId = Optional.empty(); private Optional> audienceFilters = Optional.empty(); @@ -996,8 +1009,11 @@ public Builder bodyText(Optional bodyText) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Builder boardId(long boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = Optional.ofNullable(boardId); @@ -1005,8 +1021,11 @@ public Builder boardId(long boardId) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Builder boardId(Optional boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = boardId; diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerBoard.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerBoard.java index d37761bb..c40a1419 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerBoard.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerBoard.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AnswerBoard { @@ -431,24 +430,24 @@ public boolean equals(java.lang.Object o) { } AnswerBoard other = (AnswerBoard) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.creator, other.creator) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.itemCount, other.itemCount) && - Objects.deepEquals(this.roles, other.roles); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.creator, other.creator) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.itemCount, other.itemCount) && + Utils.enhancedDeepEquals(this.roles, other.roles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, addedRoles, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationData.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationData.java index fb96974d..fee1bfaa 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationData.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationData.java @@ -9,12 +9,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Deprecated; import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AnswerCreationData { @@ -38,10 +38,13 @@ public class AnswerCreationData { private Optional bodyText; /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("boardId") + @Deprecated private Optional boardId; /** @@ -158,8 +161,11 @@ public Optional bodyText() { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated @JsonIgnore public Optional boardId() { return boardId; @@ -281,8 +287,11 @@ public AnswerCreationData withBodyText(Optional bodyText) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public AnswerCreationData withBoardId(long boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = Optional.ofNullable(boardId); @@ -290,8 +299,11 @@ public AnswerCreationData withBoardId(long boardId) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public AnswerCreationData withBoardId(Optional boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = boardId; @@ -435,23 +447,23 @@ public boolean equals(java.lang.Object o) { } AnswerCreationData other = (AnswerCreationData) o; return - Objects.deepEquals(this.question, other.question) && - Objects.deepEquals(this.questionVariations, other.questionVariations) && - Objects.deepEquals(this.bodyText, other.bodyText) && - Objects.deepEquals(this.boardId, other.boardId) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.roles, other.roles) && - Objects.deepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && - Objects.deepEquals(this.sourceType, other.sourceType) && - Objects.deepEquals(this.addedCollections, other.addedCollections) && - Objects.deepEquals(this.combinedAnswerText, other.combinedAnswerText); + Utils.enhancedDeepEquals(this.question, other.question) && + Utils.enhancedDeepEquals(this.questionVariations, other.questionVariations) && + Utils.enhancedDeepEquals(this.bodyText, other.bodyText) && + Utils.enhancedDeepEquals(this.boardId, other.boardId) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.roles, other.roles) && + Utils.enhancedDeepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && + Utils.enhancedDeepEquals(this.sourceType, other.sourceType) && + Utils.enhancedDeepEquals(this.addedCollections, other.addedCollections) && + Utils.enhancedDeepEquals(this.combinedAnswerText, other.combinedAnswerText); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( question, questionVariations, bodyText, @@ -491,6 +503,7 @@ public final static class Builder { private Optional bodyText = Optional.empty(); + @Deprecated private Optional boardId = Optional.empty(); private Optional> audienceFilters = Optional.empty(); @@ -562,8 +575,11 @@ public Builder bodyText(Optional bodyText) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Builder boardId(long boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = Optional.ofNullable(boardId); @@ -571,8 +587,11 @@ public Builder boardId(long boardId) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Builder boardId(Optional boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = boardId; diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationDataSourceType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationDataSourceType.java index 70dd7918..b87e5143 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationDataSourceType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerCreationDataSourceType.java @@ -15,7 +15,7 @@ public enum AnswerCreationDataSourceType { @JsonValue private final String value; - private AnswerCreationDataSourceType(String value) { + AnswerCreationDataSourceType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLike.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLike.java index db7c5d1b..331c1440 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLike.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLike.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class AnswerLike { @@ -102,13 +101,13 @@ public boolean equals(java.lang.Object o) { } AnswerLike other = (AnswerLike) o; return - Objects.deepEquals(this.user, other.user) && - Objects.deepEquals(this.createTime, other.createTime); + Utils.enhancedDeepEquals(this.user, other.user) && + Utils.enhancedDeepEquals(this.createTime, other.createTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( user, createTime); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLikes.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLikes.java index 84d22a20..5be62c14 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLikes.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerLikes.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class AnswerLikes { @@ -104,14 +103,14 @@ public boolean equals(java.lang.Object o) { } AnswerLikes other = (AnswerLikes) o; return - Objects.deepEquals(this.likedBy, other.likedBy) && - Objects.deepEquals(this.likedByUser, other.likedByUser) && - Objects.deepEquals(this.numLikes, other.numLikes); + Utils.enhancedDeepEquals(this.likedBy, other.likedBy) && + Utils.enhancedDeepEquals(this.likedByUser, other.likedByUser) && + Utils.enhancedDeepEquals(this.numLikes, other.numLikes); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( likedBy, likedByUser, numLikes); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerResult.java index 33950c98..e76a95a9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerResult.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class AnswerResult { @@ -93,13 +92,13 @@ public boolean equals(java.lang.Object o) { } AnswerResult other = (AnswerResult) o; return - Objects.deepEquals(this.answer, other.answer) && - Objects.deepEquals(this.trackingToken, other.trackingToken); + Utils.enhancedDeepEquals(this.answer, other.answer) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( answer, trackingToken); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerSourceType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerSourceType.java index 4cc9c760..55cb612c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerSourceType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AnswerSourceType.java @@ -15,7 +15,7 @@ public enum AnswerSourceType { @JsonValue private final String value; - private AnswerSourceType(String value) { + AnswerSourceType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AppResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AppResult.java index ae9e0dc6..9ae09c74 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AppResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AppResult.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class AppResult { @@ -174,15 +173,15 @@ public boolean equals(java.lang.Object o) { } AppResult other = (AppResult) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.docType, other.docType) && - Objects.deepEquals(this.mimeType, other.mimeType) && - Objects.deepEquals(this.iconUrl, other.iconUrl); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.docType, other.docType) && + Utils.enhancedDeepEquals(this.mimeType, other.mimeType) && + Utils.enhancedDeepEquals(this.iconUrl, other.iconUrl); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, docType, mimeType, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AssistantActivityType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AssistantActivityType.java index 6f780a7b..7e45b527 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AssistantActivityType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AssistantActivityType.java @@ -17,7 +17,7 @@ public enum AssistantActivityType { @JsonValue private final String value; - private AssistantActivityType(String value) { + AssistantActivityType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfig.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfig.java index 03e16831..21792b27 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfig.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfig.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -429,21 +428,21 @@ public boolean equals(java.lang.Object o) { } AuthConfig other = (AuthConfig) o; return - Objects.deepEquals(this.isOnPrem, other.isOnPrem) && - Objects.deepEquals(this.usesCentralAuth, other.usesCentralAuth) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.grantType, other.grantType) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.clientUrl, other.clientUrl) && - Objects.deepEquals(this.scopes, other.scopes) && - Objects.deepEquals(this.audiences, other.audiences) && - Objects.deepEquals(this.authorizationUrl, other.authorizationUrl) && - Objects.deepEquals(this.lastAuthorizedAt, other.lastAuthorizedAt); + Utils.enhancedDeepEquals(this.isOnPrem, other.isOnPrem) && + Utils.enhancedDeepEquals(this.usesCentralAuth, other.usesCentralAuth) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.grantType, other.grantType) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.clientUrl, other.clientUrl) && + Utils.enhancedDeepEquals(this.scopes, other.scopes) && + Utils.enhancedDeepEquals(this.audiences, other.audiences) && + Utils.enhancedDeepEquals(this.authorizationUrl, other.authorizationUrl) && + Utils.enhancedDeepEquals(this.lastAuthorizedAt, other.lastAuthorizedAt); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( isOnPrem, usesCentralAuth, type, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigStatus.java index c23aa0ca..0b5f9308 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigStatus.java @@ -20,7 +20,7 @@ public enum AuthConfigStatus { @JsonValue private final String value; - private AuthConfigStatus(String value) { + AuthConfigStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigType.java index 660d4b5c..d3a06600 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthConfigType.java @@ -28,7 +28,7 @@ public enum AuthConfigType { @JsonValue private final String value; - private AuthConfigType(String value) { + AuthConfigType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthToken.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthToken.java index a0e8cdc8..491be6c8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthToken.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthToken.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class AuthToken { @@ -196,17 +195,17 @@ public boolean equals(java.lang.Object o) { } AuthToken other = (AuthToken) o; return - Objects.deepEquals(this.accessToken, other.accessToken) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.scope, other.scope) && - Objects.deepEquals(this.tokenType, other.tokenType) && - Objects.deepEquals(this.authUser, other.authUser) && - Objects.deepEquals(this.expiration, other.expiration); + Utils.enhancedDeepEquals(this.accessToken, other.accessToken) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.scope, other.scope) && + Utils.enhancedDeepEquals(this.tokenType, other.tokenType) && + Utils.enhancedDeepEquals(this.authUser, other.authUser) && + Utils.enhancedDeepEquals(this.expiration, other.expiration); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( accessToken, datasource, scope, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthType.java index d9cfc90b..29ac5449 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AuthType.java @@ -28,7 +28,7 @@ public enum AuthType { @JsonValue private final String value; - private AuthType(String value) { + AuthType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Author.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Author.java index b51d2052..12127484 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Author.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Author.java @@ -15,7 +15,7 @@ public enum Author { @JsonValue private final String value; - private Author(String value) { + Author(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequest.java index 14338b54..ab2605ad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AutocompleteRequest { @@ -310,19 +309,19 @@ public boolean equals(java.lang.Object o) { } AutocompleteRequest other = (AutocompleteRequest) o; return - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.datasourcesFilter, other.datasourcesFilter) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.resultTypes, other.resultTypes) && - Objects.deepEquals(this.resultSize, other.resultSize) && - Objects.deepEquals(this.authTokens, other.authTokens); + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.datasourcesFilter, other.datasourcesFilter) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.resultTypes, other.resultTypes) && + Utils.enhancedDeepEquals(this.resultSize, other.resultSize) && + Utils.enhancedDeepEquals(this.authTokens, other.authTokens); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( trackingToken, sessionInfo, query, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequestResultType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequestResultType.java index bde24b77..39833336 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequestResultType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteRequestResultType.java @@ -26,7 +26,7 @@ public enum AutocompleteRequestResultType { @JsonValue private final String value; - private AutocompleteRequestResultType(String value) { + AutocompleteRequestResultType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResponse.java index ca415897..e05d3b58 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AutocompleteResponse { @@ -263,18 +262,18 @@ public boolean equals(java.lang.Object o) { } AutocompleteResponse other = (AutocompleteResponse) o; return - Objects.deepEquals(this.experimentIds, other.experimentIds) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.results, other.results) && - Objects.deepEquals(this.groups, other.groups) && - Objects.deepEquals(this.gleanDataError, other.gleanDataError) && - Objects.deepEquals(this.backendTimeMillis, other.backendTimeMillis); + Utils.enhancedDeepEquals(this.experimentIds, other.experimentIds) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.results, other.results) && + Utils.enhancedDeepEquals(this.groups, other.groups) && + Utils.enhancedDeepEquals(this.gleanDataError, other.gleanDataError) && + Utils.enhancedDeepEquals(this.backendTimeMillis, other.backendTimeMillis); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( experimentIds, trackingToken, sessionInfo, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResult.java index 96089b27..f48422aa 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResult.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class AutocompleteResult { @@ -379,22 +378,22 @@ public boolean equals(java.lang.Object o) { } AutocompleteResult other = (AutocompleteResult) o; return - Objects.deepEquals(this.result, other.result) && - Objects.deepEquals(this.keywords, other.keywords) && - Objects.deepEquals(this.resultType, other.resultType) && - Objects.deepEquals(this.score, other.score) && - Objects.deepEquals(this.operatorMetadata, other.operatorMetadata) && - Objects.deepEquals(this.quicklink, other.quicklink) && - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.structuredResult, other.structuredResult) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.ranges, other.ranges); + Utils.enhancedDeepEquals(this.result, other.result) && + Utils.enhancedDeepEquals(this.keywords, other.keywords) && + Utils.enhancedDeepEquals(this.resultType, other.resultType) && + Utils.enhancedDeepEquals(this.score, other.score) && + Utils.enhancedDeepEquals(this.operatorMetadata, other.operatorMetadata) && + Utils.enhancedDeepEquals(this.quicklink, other.quicklink) && + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.structuredResult, other.structuredResult) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.ranges, other.ranges); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( result, keywords, resultType, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultGroup.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultGroup.java index b4118729..e3460450 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultGroup.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultGroup.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -153,14 +152,14 @@ public boolean equals(java.lang.Object o) { } AutocompleteResultGroup other = (AutocompleteResultGroup) o; return - Objects.deepEquals(this.startIndex, other.startIndex) && - Objects.deepEquals(this.endIndex, other.endIndex) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.startIndex, other.startIndex) && + Utils.enhancedDeepEquals(this.endIndex, other.endIndex) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( startIndex, endIndex, title); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultResultType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultResultType.java index 22fcb3da..25dce0fb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultResultType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/AutocompleteResultResultType.java @@ -26,7 +26,7 @@ public enum AutocompleteResultResultType { @JsonValue private final String value; - private AutocompleteResultResultType(String value) { + AutocompleteResultResultType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Badge.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Badge.java index bfa96ab7..594982e5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Badge.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Badge.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -191,15 +190,15 @@ public boolean equals(java.lang.Object o) { } Badge other = (Badge) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.displayName, other.displayName) && - Objects.deepEquals(this.iconConfig, other.iconConfig) && - Objects.deepEquals(this.pinned, other.pinned); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.iconConfig, other.iconConfig) && + Utils.enhancedDeepEquals(this.pinned, other.pinned); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( key, displayName, iconConfig, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexDocumentsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexDocumentsRequest.java index cff4c709..0031c16e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexDocumentsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexDocumentsRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -271,18 +270,18 @@ public boolean equals(java.lang.Object o) { } BulkIndexDocumentsRequest other = (BulkIndexDocumentsRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.documents, other.documents) && - Objects.deepEquals(this.disableStaleDocumentDeletionCheck, other.disableStaleDocumentDeletionCheck); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.documents, other.documents) && + Utils.enhancedDeepEquals(this.disableStaleDocumentDeletionCheck, other.disableStaleDocumentDeletionCheck); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexEmployeesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexEmployeesRequest.java index 50b0435e..8d1969d4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexEmployeesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexEmployeesRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -244,17 +243,17 @@ public boolean equals(java.lang.Object o) { } BulkIndexEmployeesRequest other = (BulkIndexEmployeesRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.employees, other.employees) && - Objects.deepEquals(this.disableStaleDataDeletionCheck, other.disableStaleDataDeletionCheck); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.employees, other.employees) && + Utils.enhancedDeepEquals(this.disableStaleDataDeletionCheck, other.disableStaleDataDeletionCheck); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexGroupsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexGroupsRequest.java index cd988258..73c5f840 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexGroupsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexGroupsRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -271,18 +270,18 @@ public boolean equals(java.lang.Object o) { } BulkIndexGroupsRequest other = (BulkIndexGroupsRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.groups, other.groups) && - Objects.deepEquals(this.disableStaleDataDeletionCheck, other.disableStaleDataDeletionCheck); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.groups, other.groups) && + Utils.enhancedDeepEquals(this.disableStaleDataDeletionCheck, other.disableStaleDataDeletionCheck); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexMembershipsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexMembershipsRequest.java index b70529a5..171b0246 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexMembershipsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexMembershipsRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -271,18 +270,18 @@ public boolean equals(java.lang.Object o) { } BulkIndexMembershipsRequest other = (BulkIndexMembershipsRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.group, other.group) && - Objects.deepEquals(this.memberships, other.memberships); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.group, other.group) && + Utils.enhancedDeepEquals(this.memberships, other.memberships); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexShortcutsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexShortcutsRequest.java index 73360f03..55ba579a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexShortcutsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexShortcutsRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -208,16 +207,16 @@ public boolean equals(java.lang.Object o) { } BulkIndexShortcutsRequest other = (BulkIndexShortcutsRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.shortcuts, other.shortcuts); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexTeamsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexTeamsRequest.java index fa9cca22..da1ebaa9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexTeamsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexTeamsRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -208,16 +207,16 @@ public boolean equals(java.lang.Object o) { } BulkIndexTeamsRequest other = (BulkIndexTeamsRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.teams, other.teams); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.teams, other.teams); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexUsersRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexUsersRequest.java index aae54f7f..2b98651a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexUsersRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkIndexUsersRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -271,18 +270,18 @@ public boolean equals(java.lang.Object o) { } BulkIndexUsersRequest other = (BulkIndexUsersRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.users, other.users) && - Objects.deepEquals(this.disableStaleDataDeletionCheck, other.disableStaleDataDeletionCheck); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.users, other.users) && + Utils.enhancedDeepEquals(this.disableStaleDataDeletionCheck, other.disableStaleDataDeletionCheck); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEvent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEvent.java index 75690771..0791a24d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEvent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEvent.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -227,16 +226,16 @@ public boolean equals(java.lang.Object o) { } BulkUploadHistoryEvent other = (BulkUploadHistoryEvent) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.startTime, other.startTime) && - Objects.deepEquals(this.endTime, other.endTime) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.processingState, other.processingState); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.startTime, other.startTime) && + Utils.enhancedDeepEquals(this.endTime, other.endTime) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.processingState, other.processingState); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, startTime, endTime, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEventStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEventStatus.java index f66e1574..3108eff5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEventStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/BulkUploadHistoryEventStatus.java @@ -20,7 +20,7 @@ public enum BulkUploadHistoryEventStatus { @JsonValue private final String value; - private BulkUploadHistoryEventStatus(String value) { + BulkUploadHistoryEventStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendee.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendee.java index e1293f20..29ce11ba 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendee.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendee.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CalendarAttendee { @@ -194,16 +193,16 @@ public boolean equals(java.lang.Object o) { } CalendarAttendee other = (CalendarAttendee) o; return - Objects.deepEquals(this.isOrganizer, other.isOrganizer) && - Objects.deepEquals(this.isInGroup, other.isInGroup) && - Objects.deepEquals(this.person, other.person) && - Objects.deepEquals(this.groupAttendees, other.groupAttendees) && - Objects.deepEquals(this.responseStatus, other.responseStatus); + Utils.enhancedDeepEquals(this.isOrganizer, other.isOrganizer) && + Utils.enhancedDeepEquals(this.isInGroup, other.isInGroup) && + Utils.enhancedDeepEquals(this.person, other.person) && + Utils.enhancedDeepEquals(this.groupAttendees, other.groupAttendees) && + Utils.enhancedDeepEquals(this.responseStatus, other.responseStatus); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( isOrganizer, isInGroup, person, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendees.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendees.java index 7f07da60..c724e0d2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendees.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarAttendees.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CalendarAttendees { @@ -296,18 +295,18 @@ public boolean equals(java.lang.Object o) { } CalendarAttendees other = (CalendarAttendees) o; return - Objects.deepEquals(this.people, other.people) && - Objects.deepEquals(this.isLimit, other.isLimit) && - Objects.deepEquals(this.total, other.total) && - Objects.deepEquals(this.numAccepted, other.numAccepted) && - Objects.deepEquals(this.numDeclined, other.numDeclined) && - Objects.deepEquals(this.numNoResponse, other.numNoResponse) && - Objects.deepEquals(this.numTentative, other.numTentative); + Utils.enhancedDeepEquals(this.people, other.people) && + Utils.enhancedDeepEquals(this.isLimit, other.isLimit) && + Utils.enhancedDeepEquals(this.total, other.total) && + Utils.enhancedDeepEquals(this.numAccepted, other.numAccepted) && + Utils.enhancedDeepEquals(this.numDeclined, other.numDeclined) && + Utils.enhancedDeepEquals(this.numNoResponse, other.numNoResponse) && + Utils.enhancedDeepEquals(this.numTentative, other.numTentative); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( people, isLimit, total, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEvent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEvent.java index e6441f67..08815b49 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEvent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEvent.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -443,24 +442,24 @@ public boolean equals(java.lang.Object o) { } CalendarEvent other = (CalendarEvent) o; return - Objects.deepEquals(this.time, other.time) && - Objects.deepEquals(this.eventType, other.eventType) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.attendees, other.attendees) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.conferenceData, other.conferenceData) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.hasTranscript, other.hasTranscript) && - Objects.deepEquals(this.transcriptUrl, other.transcriptUrl) && - Objects.deepEquals(this.classifications, other.classifications) && - Objects.deepEquals(this.generatedAttachments, other.generatedAttachments); + Utils.enhancedDeepEquals(this.time, other.time) && + Utils.enhancedDeepEquals(this.eventType, other.eventType) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.attendees, other.attendees) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.conferenceData, other.conferenceData) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.hasTranscript, other.hasTranscript) && + Utils.enhancedDeepEquals(this.transcriptUrl, other.transcriptUrl) && + Utils.enhancedDeepEquals(this.classifications, other.classifications) && + Utils.enhancedDeepEquals(this.generatedAttachments, other.generatedAttachments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( time, eventType, id, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEventEventType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEventEventType.java index 8c1e39c6..099f2b5f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEventEventType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CalendarEventEventType.java @@ -20,7 +20,7 @@ public enum CalendarEventEventType { @JsonValue private final String value; - private CalendarEventEventType(String value) { + CalendarEventEventType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CanonicalizingRegexType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CanonicalizingRegexType.java index 1e82ae2a..0b9e1f4c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CanonicalizingRegexType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CanonicalizingRegexType.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -116,13 +115,13 @@ public boolean equals(java.lang.Object o) { } CanonicalizingRegexType other = (CanonicalizingRegexType) o; return - Objects.deepEquals(this.matchRegex, other.matchRegex) && - Objects.deepEquals(this.rewriteRegex, other.rewriteRegex); + Utils.enhancedDeepEquals(this.matchRegex, other.matchRegex) && + Utils.enhancedDeepEquals(this.rewriteRegex, other.rewriteRegex); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( matchRegex, rewriteRegex); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CategoryToResultSize.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CategoryToResultSize.java index 35ace094..590b1a9b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CategoryToResultSize.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CategoryToResultSize.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class CategoryToResultSize { @@ -64,12 +63,12 @@ public boolean equals(java.lang.Object o) { } CategoryToResultSize other = (CategoryToResultSize) o; return - Objects.deepEquals(this.resultSize, other.resultSize); + Utils.enhancedDeepEquals(this.resultSize, other.resultSize); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( resultSize); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChannelInviteInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChannelInviteInfo.java index c1b79166..856afe2b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChannelInviteInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChannelInviteInfo.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; /** @@ -205,16 +204,16 @@ public boolean equals(java.lang.Object o) { } ChannelInviteInfo other = (ChannelInviteInfo) o; return - Objects.deepEquals(this.channel, other.channel) && - Objects.deepEquals(this.isAutoInvite, other.isAutoInvite) && - Objects.deepEquals(this.inviter, other.inviter) && - Objects.deepEquals(this.inviteTime, other.inviteTime) && - Objects.deepEquals(this.reminderTime, other.reminderTime); + Utils.enhancedDeepEquals(this.channel, other.channel) && + Utils.enhancedDeepEquals(this.isAutoInvite, other.isAutoInvite) && + Utils.enhancedDeepEquals(this.inviter, other.inviter) && + Utils.enhancedDeepEquals(this.inviteTime, other.inviteTime) && + Utils.enhancedDeepEquals(this.reminderTime, other.reminderTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( channel, isAutoInvite, inviter, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Chat.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Chat.java index 87c94011..fde2c1c3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Chat.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Chat.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -362,20 +361,20 @@ public boolean equals(java.lang.Object o) { } Chat other = (Chat) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.applicationId, other.applicationId) && - Objects.deepEquals(this.applicationName, other.applicationName) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.messages, other.messages); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.applicationId, other.applicationId) && + Utils.enhancedDeepEquals(this.applicationName, other.applicationName) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.messages, other.messages); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, createTime, createdBy, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFile.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFile.java index bc902221..257707de 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFile.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFile.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -190,15 +189,15 @@ public boolean equals(java.lang.Object o) { } ChatFile other = (ChatFile) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, url, name, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileFailureReason.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileFailureReason.java index b32bd94d..a1bef02d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileFailureReason.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileFailureReason.java @@ -25,7 +25,7 @@ public enum ChatFileFailureReason { @JsonValue private final String value; - private ChatFileFailureReason(String value) { + ChatFileFailureReason(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileMetadata.java index f1345be3..bf2cf870 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileMetadata.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -228,16 +227,16 @@ public boolean equals(java.lang.Object o) { } ChatFileMetadata other = (ChatFileMetadata) o; return - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.uploadTime, other.uploadTime) && - Objects.deepEquals(this.processedSize, other.processedSize) && - Objects.deepEquals(this.failureReason, other.failureReason) && - Objects.deepEquals(this.mimeType, other.mimeType); + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.uploadTime, other.uploadTime) && + Utils.enhancedDeepEquals(this.processedSize, other.processedSize) && + Utils.enhancedDeepEquals(this.failureReason, other.failureReason) && + Utils.enhancedDeepEquals(this.mimeType, other.mimeType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( status, uploadTime, processedSize, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileStatus.java index 32fd2123..edad678b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatFileStatus.java @@ -22,7 +22,7 @@ public enum ChatFileStatus { @JsonValue private final String value; - private ChatFileStatus(String value) { + ChatFileStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessage.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessage.java index d7abc0c1..9bf54494 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessage.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessage.java @@ -17,7 +17,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -416,21 +415,21 @@ public boolean equals(java.lang.Object o) { } ChatMessage other = (ChatMessage) o; return - Objects.deepEquals(this.agentConfig, other.agentConfig) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.citations, other.citations) && - Objects.deepEquals(this.uploadedFileIds, other.uploadedFileIds) && - Objects.deepEquals(this.fragments, other.fragments) && - Objects.deepEquals(this.ts, other.ts) && - Objects.deepEquals(this.messageId, other.messageId) && - Objects.deepEquals(this.messageTrackingToken, other.messageTrackingToken) && - Objects.deepEquals(this.messageType, other.messageType) && - Objects.deepEquals(this.hasMoreFragments, other.hasMoreFragments); + Utils.enhancedDeepEquals(this.agentConfig, other.agentConfig) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.citations, other.citations) && + Utils.enhancedDeepEquals(this.uploadedFileIds, other.uploadedFileIds) && + Utils.enhancedDeepEquals(this.fragments, other.fragments) && + Utils.enhancedDeepEquals(this.ts, other.ts) && + Utils.enhancedDeepEquals(this.messageId, other.messageId) && + Utils.enhancedDeepEquals(this.messageTrackingToken, other.messageTrackingToken) && + Utils.enhancedDeepEquals(this.messageType, other.messageType) && + Utils.enhancedDeepEquals(this.hasMoreFragments, other.hasMoreFragments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agentConfig, author, citations, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageCitation.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageCitation.java index dc69e478..17e2586d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageCitation.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageCitation.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -206,16 +205,16 @@ public boolean equals(java.lang.Object o) { } ChatMessageCitation other = (ChatMessageCitation) o; return - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.sourceDocument, other.sourceDocument) && - Objects.deepEquals(this.sourceFile, other.sourceFile) && - Objects.deepEquals(this.sourcePerson, other.sourcePerson) && - Objects.deepEquals(this.referenceRanges, other.referenceRanges); + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.sourceDocument, other.sourceDocument) && + Utils.enhancedDeepEquals(this.sourceFile, other.sourceFile) && + Utils.enhancedDeepEquals(this.sourcePerson, other.sourcePerson) && + Utils.enhancedDeepEquals(this.referenceRanges, other.referenceRanges); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( trackingToken, sourceDocument, sourceFile, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java index 27d47864..e8a295ee 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMessageFragment.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -230,17 +229,17 @@ public boolean equals(java.lang.Object o) { } ChatMessageFragment other = (ChatMessageFragment) o; return - Objects.deepEquals(this.structuredResults, other.structuredResults) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.text, other.text) && - Objects.deepEquals(this.querySuggestion, other.querySuggestion) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.action, other.action); + Utils.enhancedDeepEquals(this.structuredResults, other.structuredResults) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.querySuggestion, other.querySuggestion) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.action, other.action); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( structuredResults, trackingToken, text, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadata.java index 0f85f81e..77d87f0e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadata.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -324,19 +323,19 @@ public boolean equals(java.lang.Object o) { } ChatMetadata other = (ChatMetadata) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.applicationId, other.applicationId) && - Objects.deepEquals(this.applicationName, other.applicationName) && - Objects.deepEquals(this.icon, other.icon); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.applicationId, other.applicationId) && + Utils.enhancedDeepEquals(this.applicationName, other.applicationName) && + Utils.enhancedDeepEquals(this.icon, other.icon); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, createTime, createdBy, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadataResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadataResult.java index 035fe1a9..2dcef076 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadataResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatMetadataResult.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ChatMetadataResult { @@ -113,13 +112,13 @@ public boolean equals(java.lang.Object o) { } ChatMetadataResult other = (ChatMetadataResult) o; return - Objects.deepEquals(this.chat, other.chat) && - Objects.deepEquals(this.trackingToken, other.trackingToken); + Utils.enhancedDeepEquals(this.chat, other.chat) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( chat, trackingToken); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRequest.java index 5bad9ad5..c06e52ed 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRequest.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ChatRequest { @@ -398,22 +397,22 @@ public boolean equals(java.lang.Object o) { } ChatRequest other = (ChatRequest) o; return - Objects.deepEquals(this.saveChat, other.saveChat) && - Objects.deepEquals(this.chatId, other.chatId) && - Objects.deepEquals(this.messages, other.messages) && - Objects.deepEquals(this.agentConfig, other.agentConfig) && - Objects.deepEquals(this.inclusions, other.inclusions) && - Objects.deepEquals(this.exclusions, other.exclusions) && - Objects.deepEquals(this.timeoutMillis, other.timeoutMillis) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.applicationId, other.applicationId) && - Objects.deepEquals(this.agentId, other.agentId) && - Objects.deepEquals(this.stream, other.stream); + Utils.enhancedDeepEquals(this.saveChat, other.saveChat) && + Utils.enhancedDeepEquals(this.chatId, other.chatId) && + Utils.enhancedDeepEquals(this.messages, other.messages) && + Utils.enhancedDeepEquals(this.agentConfig, other.agentConfig) && + Utils.enhancedDeepEquals(this.inclusions, other.inclusions) && + Utils.enhancedDeepEquals(this.exclusions, other.exclusions) && + Utils.enhancedDeepEquals(this.timeoutMillis, other.timeoutMillis) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.applicationId, other.applicationId) && + Utils.enhancedDeepEquals(this.agentId, other.agentId) && + Utils.enhancedDeepEquals(this.stream, other.stream); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( saveChat, chatId, messages, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResponse.java index 25e6ef67..6280f979 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -217,16 +216,16 @@ public boolean equals(java.lang.Object o) { } ChatResponse other = (ChatResponse) o; return - Objects.deepEquals(this.messages, other.messages) && - Objects.deepEquals(this.chatId, other.chatId) && - Objects.deepEquals(this.followUpPrompts, other.followUpPrompts) && - Objects.deepEquals(this.backendTimeMillis, other.backendTimeMillis) && - Objects.deepEquals(this.chatSessionTrackingToken, other.chatSessionTrackingToken); + Utils.enhancedDeepEquals(this.messages, other.messages) && + Utils.enhancedDeepEquals(this.chatId, other.chatId) && + Utils.enhancedDeepEquals(this.followUpPrompts, other.followUpPrompts) && + Utils.enhancedDeepEquals(this.backendTimeMillis, other.backendTimeMillis) && + Utils.enhancedDeepEquals(this.chatSessionTrackingToken, other.chatSessionTrackingToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( messages, chatId, followUpPrompts, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRestrictionFilters.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRestrictionFilters.java index bee24ec8..cea22f23 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRestrictionFilters.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatRestrictionFilters.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ChatRestrictionFilters { @@ -128,14 +127,14 @@ public boolean equals(java.lang.Object o) { } ChatRestrictionFilters other = (ChatRestrictionFilters) o; return - Objects.deepEquals(this.containerSpecs, other.containerSpecs) && - Objects.deepEquals(this.documentSpecs, other.documentSpecs) && - Objects.deepEquals(this.datasourceInstances, other.datasourceInstances); + Utils.enhancedDeepEquals(this.containerSpecs, other.containerSpecs) && + Utils.enhancedDeepEquals(this.documentSpecs, other.documentSpecs) && + Utils.enhancedDeepEquals(this.datasourceInstances, other.datasourceInstances); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( containerSpecs, documentSpecs, datasourceInstances); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResult.java index 07ed72e5..13cae606 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatResult.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ChatResult { @@ -113,13 +112,13 @@ public boolean equals(java.lang.Object o) { } ChatResult other = (ChatResult) o; return - Objects.deepEquals(this.chat, other.chat) && - Objects.deepEquals(this.trackingToken, other.trackingToken); + Utils.enhancedDeepEquals(this.chat, other.chat) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( chat, trackingToken); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatZeroStateSuggestionOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatZeroStateSuggestionOptions.java index d887ae18..331404d5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatZeroStateSuggestionOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ChatZeroStateSuggestionOptions.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ChatZeroStateSuggestionOptions { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } ChatZeroStateSuggestionOptions other = (ChatZeroStateSuggestionOptions) o; return - Objects.deepEquals(this.applicationId, other.applicationId); + Utils.enhancedDeepEquals(this.applicationId, other.applicationId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( applicationId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessRequest.java index a196d7d6..3d1aec98 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * CheckDocumentAccessRequest @@ -141,15 +140,15 @@ public boolean equals(java.lang.Object o) { } CheckDocumentAccessRequest other = (CheckDocumentAccessRequest) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.docId, other.docId) && - Objects.deepEquals(this.userEmail, other.userEmail); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.docId, other.docId) && + Utils.enhancedDeepEquals(this.userEmail, other.userEmail); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, objectType, docId, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessResponse.java index becd6375..7cc6b7fe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CheckDocumentAccessResponse.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -81,12 +80,12 @@ public boolean equals(java.lang.Object o) { } CheckDocumentAccessResponse other = (CheckDocumentAccessResponse) o; return - Objects.deepEquals(this.hasAccess, other.hasAccess); + Utils.enhancedDeepEquals(this.hasAccess, other.hasAccess); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( hasAccess); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterGroup.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterGroup.java index 0e999a12..defd4cb8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterGroup.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterGroup.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ClusterGroup { @@ -143,14 +142,14 @@ public boolean equals(java.lang.Object o) { } ClusterGroup other = (ClusterGroup) o; return - Objects.deepEquals(this.clusteredResults, other.clusteredResults) && - Objects.deepEquals(this.clusterType, other.clusterType) && - Objects.deepEquals(this.visibleCountHint, other.visibleCountHint); + Utils.enhancedDeepEquals(this.clusteredResults, other.clusteredResults) && + Utils.enhancedDeepEquals(this.clusterType, other.clusterType) && + Utils.enhancedDeepEquals(this.visibleCountHint, other.visibleCountHint); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( clusteredResults, clusterType, visibleCountHint); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterTypeEnum.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterTypeEnum.java index 2afa2eee..a50a0e9b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterTypeEnum.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ClusterTypeEnum.java @@ -27,7 +27,7 @@ public enum ClusterTypeEnum { @JsonValue private final String value; - private ClusterTypeEnum(String value) { + ClusterTypeEnum(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Code.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Code.java index c4f027a5..da752b2f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Code.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Code.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Code { @@ -175,16 +174,16 @@ public boolean equals(java.lang.Object o) { } Code other = (Code) o; return - Objects.deepEquals(this.repoName, other.repoName) && - Objects.deepEquals(this.fileName, other.fileName) && - Objects.deepEquals(this.fileUrl, other.fileUrl) && - Objects.deepEquals(this.lines, other.lines) && - Objects.deepEquals(this.isLastMatch, other.isLastMatch); + Utils.enhancedDeepEquals(this.repoName, other.repoName) && + Utils.enhancedDeepEquals(this.fileName, other.fileName) && + Utils.enhancedDeepEquals(this.fileUrl, other.fileUrl) && + Utils.enhancedDeepEquals(this.lines, other.lines) && + Utils.enhancedDeepEquals(this.isLastMatch, other.isLastMatch); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( repoName, fileName, fileUrl, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CodeLine.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CodeLine.java index 7a1d6976..8a998a69 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CodeLine.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CodeLine.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CodeLine { @@ -127,14 +126,14 @@ public boolean equals(java.lang.Object o) { } CodeLine other = (CodeLine) o; return - Objects.deepEquals(this.lineNumber, other.lineNumber) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.ranges, other.ranges); + Utils.enhancedDeepEquals(this.lineNumber, other.lineNumber) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.ranges, other.ranges); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lineNumber, content, ranges); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Collection.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Collection.java index 449f2eed..7aba03d4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Collection.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Collection.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Collection { @@ -773,34 +772,34 @@ public boolean equals(java.lang.Object o) { } Collection other = (Collection) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.adminLocked, other.adminLocked) && - Objects.deepEquals(this.parentId, other.parentId) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.creator, other.creator) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.itemCount, other.itemCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.items, other.items) && - Objects.deepEquals(this.pinMetadata, other.pinMetadata) && - Objects.deepEquals(this.shortcuts, other.shortcuts) && - Objects.deepEquals(this.children, other.children) && - Objects.deepEquals(this.roles, other.roles); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.adminLocked, other.adminLocked) && + Utils.enhancedDeepEquals(this.parentId, other.parentId) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.creator, other.creator) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.itemCount, other.itemCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.items, other.items) && + Utils.enhancedDeepEquals(this.pinMetadata, other.pinMetadata) && + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts) && + Utils.enhancedDeepEquals(this.children, other.children) && + Utils.enhancedDeepEquals(this.roles, other.roles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, addedRoles, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError1.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError1.java index 9e22fd26..c97ee3a8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError1.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError1.java @@ -10,7 +10,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class CollectionError1 { @@ -50,12 +49,12 @@ public boolean equals(java.lang.Object o) { } CollectionError1 other = (CollectionError1) o; return - Objects.deepEquals(this.errorCode, other.errorCode); + Utils.enhancedDeepEquals(this.errorCode, other.errorCode); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( errorCode); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError2.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError2.java index f96b5f55..2278abb0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError2.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError2.java @@ -10,7 +10,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class CollectionError2 { @@ -50,12 +49,12 @@ public boolean equals(java.lang.Object o) { } CollectionError2 other = (CollectionError2) o; return - Objects.deepEquals(this.errorCode, other.errorCode); + Utils.enhancedDeepEquals(this.errorCode, other.errorCode); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( errorCode); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError3.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError3.java index bf670bc4..19f3cc0a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError3.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionError3.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class CollectionError3 { @@ -49,12 +48,12 @@ public boolean equals(java.lang.Object o) { } CollectionError3 other = (CollectionError3) o; return - Objects.deepEquals(this.errorCode, other.errorCode); + Utils.enhancedDeepEquals(this.errorCode, other.errorCode); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( errorCode); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionErrorErrorCode.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionErrorErrorCode.java index 82604365..dc5681a4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionErrorErrorCode.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionErrorErrorCode.java @@ -20,7 +20,7 @@ public enum CollectionErrorErrorCode { @JsonValue private final String value; - private CollectionErrorErrorCode(String value) { + CollectionErrorErrorCode(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItem.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItem.java index df28d41f..675b19ab 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItem.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItem.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class CollectionItem { @@ -439,24 +438,24 @@ public boolean equals(java.lang.Object o) { } CollectionItem other = (CollectionItem) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.collectionId, other.collectionId) && - Objects.deepEquals(this.documentId, other.documentId) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.itemId, other.itemId) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.shortcut, other.shortcut) && - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.itemType, other.itemType); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.collectionId, other.collectionId) && + Utils.enhancedDeepEquals(this.documentId, other.documentId) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.itemId, other.itemId) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.shortcut, other.shortcut) && + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.itemType, other.itemType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, icon, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptor.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptor.java index 81912b75..c8b3fae6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptor.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptor.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class CollectionItemDescriptor { @@ -281,18 +280,18 @@ public boolean equals(java.lang.Object o) { } CollectionItemDescriptor other = (CollectionItemDescriptor) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.documentId, other.documentId) && - Objects.deepEquals(this.newNextItemId, other.newNextItemId) && - Objects.deepEquals(this.itemType, other.itemType); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.documentId, other.documentId) && + Utils.enhancedDeepEquals(this.newNextItemId, other.newNextItemId) && + Utils.enhancedDeepEquals(this.itemType, other.itemType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, icon, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptorItemType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptorItemType.java index 23d81e1b..3ce64bf9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptorItemType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemDescriptorItemType.java @@ -16,7 +16,7 @@ public enum CollectionItemDescriptorItemType { @JsonValue private final String value; - private CollectionItemDescriptorItemType(String value) { + CollectionItemDescriptorItemType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemItemType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemItemType.java index 1ea662c3..9e3869b6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemItemType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionItemItemType.java @@ -17,7 +17,7 @@ public enum CollectionItemItemType { @JsonValue private final String value; - private CollectionItemItemType(String value) { + CollectionItemItemType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinMetadata.java index de544ee7..8e96cca9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinMetadata.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class CollectionPinMetadata { @@ -76,13 +75,13 @@ public boolean equals(java.lang.Object o) { } CollectionPinMetadata other = (CollectionPinMetadata) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.target, other.target); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.target, other.target); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, target); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinTarget.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinTarget.java index c06f5fd5..08825913 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinTarget.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinTarget.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class CollectionPinTarget { @@ -140,14 +139,14 @@ public boolean equals(java.lang.Object o) { } CollectionPinTarget other = (CollectionPinTarget) o; return - Objects.deepEquals(this.category, other.category) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.target, other.target); + Utils.enhancedDeepEquals(this.category, other.category) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.target, other.target); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( category, value, target); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableCategories.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableCategories.java index 013b777f..6dd2c481 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableCategories.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableCategories.java @@ -21,7 +21,7 @@ public enum CollectionPinnableCategories { @JsonValue private final String value; - private CollectionPinnableCategories(String value) { + CollectionPinnableCategories(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableTargets.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableTargets.java index 7580fd16..cd8b1427 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableTargets.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnableTargets.java @@ -20,7 +20,7 @@ public enum CollectionPinnableTargets { @JsonValue private final String value; - private CollectionPinnableTargets(String value) { + CollectionPinnableTargets(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnedMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnedMetadata.java index cf0f5623..6bb27834 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnedMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CollectionPinnedMetadata.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CollectionPinnedMetadata { @@ -115,13 +114,13 @@ public boolean equals(java.lang.Object o) { } CollectionPinnedMetadata other = (CollectionPinnedMetadata) o; return - Objects.deepEquals(this.existingPins, other.existingPins) && - Objects.deepEquals(this.eligiblePins, other.eligiblePins); + Utils.enhancedDeepEquals(this.existingPins, other.existingPins) && + Utils.enhancedDeepEquals(this.eligiblePins, other.eligiblePins); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( existingPins, eligiblePins); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CommentDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CommentDefinition.java index 1a528360..99b1cdc7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CommentDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CommentDefinition.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -256,17 +255,17 @@ public boolean equals(java.lang.Object o) { } CommentDefinition other = (CommentDefinition) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.updatedBy, other.updatedBy); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, author, content, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CommunicationChannel.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CommunicationChannel.java index 79c5e4ab..ec2f00e5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CommunicationChannel.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CommunicationChannel.java @@ -15,7 +15,7 @@ public enum CommunicationChannel { @JsonValue private final String value; - private CommunicationChannel(String value) { + CommunicationChannel(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Company.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Company.java index 41d01e2b..f38d8d8b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Company.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Company.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Company { @@ -504,24 +503,24 @@ public boolean equals(java.lang.Object o) { } Company other = (Company) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.profileUrl, other.profileUrl) && - Objects.deepEquals(this.websiteUrls, other.websiteUrls) && - Objects.deepEquals(this.logoUrl, other.logoUrl) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.phone, other.phone) && - Objects.deepEquals(this.fax, other.fax) && - Objects.deepEquals(this.industry, other.industry) && - Objects.deepEquals(this.annualRevenue, other.annualRevenue) && - Objects.deepEquals(this.numberOfEmployees, other.numberOfEmployees) && - Objects.deepEquals(this.stockSymbol, other.stockSymbol) && - Objects.deepEquals(this.foundedDate, other.foundedDate) && - Objects.deepEquals(this.about, other.about); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.profileUrl, other.profileUrl) && + Utils.enhancedDeepEquals(this.websiteUrls, other.websiteUrls) && + Utils.enhancedDeepEquals(this.logoUrl, other.logoUrl) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.phone, other.phone) && + Utils.enhancedDeepEquals(this.fax, other.fax) && + Utils.enhancedDeepEquals(this.industry, other.industry) && + Utils.enhancedDeepEquals(this.annualRevenue, other.annualRevenue) && + Utils.enhancedDeepEquals(this.numberOfEmployees, other.numberOfEmployees) && + Utils.enhancedDeepEquals(this.stockSymbol, other.stockSymbol) && + Utils.enhancedDeepEquals(this.foundedDate, other.foundedDate) && + Utils.enhancedDeepEquals(this.about, other.about); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, profileUrl, websiteUrls, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceData.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceData.java index dd85f0b4..28545dfc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceData.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceData.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ConferenceData { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } ConferenceData other = (ConferenceData) o; return - Objects.deepEquals(this.provider, other.provider) && - Objects.deepEquals(this.uri, other.uri) && - Objects.deepEquals(this.source, other.source); + Utils.enhancedDeepEquals(this.provider, other.provider) && + Utils.enhancedDeepEquals(this.uri, other.uri) && + Utils.enhancedDeepEquals(this.source, other.source); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( provider, uri, source); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceDataSource.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceDataSource.java index 742ba7f9..d626edbc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceDataSource.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ConferenceDataSource.java @@ -16,7 +16,7 @@ public enum ConferenceDataSource { @JsonValue private final String value; - private ConferenceDataSource(String value) { + ConferenceDataSource(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ConnectorType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ConnectorType.java index 1ed598d8..87b7dca2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ConnectorType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ConnectorType.java @@ -26,7 +26,7 @@ public enum ConnectorType { @JsonValue private final String value; - private ConnectorType(String value) { + ConnectorType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentDefinition.java index 5251199c..fb0f7bb7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentDefinition.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -134,14 +133,14 @@ public boolean equals(java.lang.Object o) { } ContentDefinition other = (ContentDefinition) o; return - Objects.deepEquals(this.mimeType, other.mimeType) && - Objects.deepEquals(this.textContent, other.textContent) && - Objects.deepEquals(this.binaryContent, other.binaryContent); + Utils.enhancedDeepEquals(this.mimeType, other.mimeType) && + Utils.enhancedDeepEquals(this.textContent, other.textContent) && + Utils.enhancedDeepEquals(this.binaryContent, other.binaryContent); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mimeType, textContent, binaryContent); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentInsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentInsightsResponse.java index 3deac8ba..8fe51664 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentInsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentInsightsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ContentInsightsResponse { @@ -224,16 +223,16 @@ public boolean equals(java.lang.Object o) { } ContentInsightsResponse other = (ContentInsightsResponse) o; return - Objects.deepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && - Objects.deepEquals(this.documentInsights, other.documentInsights) && - Objects.deepEquals(this.departments, other.departments) && - Objects.deepEquals(this.minDepartmentSizeThreshold, other.minDepartmentSizeThreshold) && - Objects.deepEquals(this.minVisitorThreshold, other.minVisitorThreshold); + Utils.enhancedDeepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && + Utils.enhancedDeepEquals(this.documentInsights, other.documentInsights) && + Utils.enhancedDeepEquals(this.departments, other.departments) && + Utils.enhancedDeepEquals(this.minDepartmentSizeThreshold, other.minDepartmentSizeThreshold) && + Utils.enhancedDeepEquals(this.minVisitorThreshold, other.minVisitorThreshold); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastLogTimestamp, documentInsights, departments, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentType.java index 5b51d102..4688581f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ContentType.java @@ -14,7 +14,7 @@ public enum ContentType { @JsonValue private final String value; - private ContentType(String value) { + ContentType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CountInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CountInfo.java index 24274621..481d9044 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CountInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CountInfo.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class CountInfo { @@ -129,14 +128,14 @@ public boolean equals(java.lang.Object o) { } CountInfo other = (CountInfo) o; return - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.period, other.period) && - Objects.deepEquals(this.org, other.org); + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.period, other.period) && + Utils.enhancedDeepEquals(this.org, other.org); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( count, period, org); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequest.java index dd26b319..874cb09c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequest.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CreateAnnouncementRequest { @@ -490,25 +489,25 @@ public boolean equals(java.lang.Object o) { } CreateAnnouncementRequest other = (CreateAnnouncementRequest) o; return - Objects.deepEquals(this.startTime, other.startTime) && - Objects.deepEquals(this.endTime, other.endTime) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.body, other.body) && - Objects.deepEquals(this.emoji, other.emoji) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.banner, other.banner) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.sourceDocumentId, other.sourceDocumentId) && - Objects.deepEquals(this.hideAttribution, other.hideAttribution) && - Objects.deepEquals(this.channel, other.channel) && - Objects.deepEquals(this.postType, other.postType) && - Objects.deepEquals(this.isPrioritized, other.isPrioritized) && - Objects.deepEquals(this.viewUrl, other.viewUrl); + Utils.enhancedDeepEquals(this.startTime, other.startTime) && + Utils.enhancedDeepEquals(this.endTime, other.endTime) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.body, other.body) && + Utils.enhancedDeepEquals(this.emoji, other.emoji) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.banner, other.banner) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.sourceDocumentId, other.sourceDocumentId) && + Utils.enhancedDeepEquals(this.hideAttribution, other.hideAttribution) && + Utils.enhancedDeepEquals(this.channel, other.channel) && + Utils.enhancedDeepEquals(this.postType, other.postType) && + Utils.enhancedDeepEquals(this.isPrioritized, other.isPrioritized) && + Utils.enhancedDeepEquals(this.viewUrl, other.viewUrl); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( startTime, endTime, title, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestChannel.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestChannel.java index 09d4f76b..606dce6a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestChannel.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestChannel.java @@ -20,7 +20,7 @@ public enum CreateAnnouncementRequestChannel { @JsonValue private final String value; - private CreateAnnouncementRequestChannel(String value) { + CreateAnnouncementRequestChannel(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestPostType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestPostType.java index 0e939e17..ecec0b49 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestPostType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnnouncementRequestPostType.java @@ -20,7 +20,7 @@ public enum CreateAnnouncementRequestPostType { @JsonValue private final String value; - private CreateAnnouncementRequestPostType(String value) { + CreateAnnouncementRequestPostType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnswerRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnswerRequest.java index 7a446a41..852038bb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnswerRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAnswerRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class CreateAnswerRequest { @@ -49,12 +48,12 @@ public boolean equals(java.lang.Object o) { } CreateAnswerRequest other = (CreateAnswerRequest) o; return - Objects.deepEquals(this.data, other.data); + Utils.enhancedDeepEquals(this.data, other.data); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( data); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAuthTokenResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAuthTokenResponse.java index 03ac508d..dd92114d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAuthTokenResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateAuthTokenResponse.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class CreateAuthTokenResponse { @@ -85,13 +84,13 @@ public boolean equals(java.lang.Object o) { } CreateAuthTokenResponse other = (CreateAuthTokenResponse) o; return - Objects.deepEquals(this.token, other.token) && - Objects.deepEquals(this.expirationTime, other.expirationTime); + Utils.enhancedDeepEquals(this.token, other.token) && + Utils.enhancedDeepEquals(this.expirationTime, other.expirationTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( token, expirationTime); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionRequest.java index 7201482f..b7fd2e10 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionRequest.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CreateCollectionRequest { @@ -422,22 +421,22 @@ public boolean equals(java.lang.Object o) { } CreateCollectionRequest other = (CreateCollectionRequest) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.adminLocked, other.adminLocked) && - Objects.deepEquals(this.parentId, other.parentId) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource) && - Objects.deepEquals(this.newNextItemId, other.newNextItemId); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.adminLocked, other.adminLocked) && + Utils.enhancedDeepEquals(this.parentId, other.parentId) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource) && + Utils.enhancedDeepEquals(this.newNextItemId, other.newNextItemId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, addedRoles, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponse.java index 968af835..eb034fca 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponse.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CreateCollectionResponse { @@ -841,37 +840,37 @@ public boolean equals(java.lang.Object o) { } CreateCollectionResponse other = (CreateCollectionResponse) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.adminLocked, other.adminLocked) && - Objects.deepEquals(this.parentId, other.parentId) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.creator, other.creator) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.itemCount, other.itemCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.items, other.items) && - Objects.deepEquals(this.pinMetadata, other.pinMetadata) && - Objects.deepEquals(this.shortcuts, other.shortcuts) && - Objects.deepEquals(this.children, other.children) && - Objects.deepEquals(this.roles, other.roles) && - Objects.deepEquals(this.errorCode, other.errorCode) && - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.adminLocked, other.adminLocked) && + Utils.enhancedDeepEquals(this.parentId, other.parentId) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.creator, other.creator) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.itemCount, other.itemCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.items, other.items) && + Utils.enhancedDeepEquals(this.pinMetadata, other.pinMetadata) && + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts) && + Utils.enhancedDeepEquals(this.children, other.children) && + Utils.enhancedDeepEquals(this.roles, other.roles) && + Utils.enhancedDeepEquals(this.errorCode, other.errorCode) && + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, addedRoles, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponseErrorCode.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponseErrorCode.java index fd956bb7..0a43300b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponseErrorCode.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateCollectionResponseErrorCode.java @@ -20,7 +20,7 @@ public enum CreateCollectionResponseErrorCode { @JsonValue private final String value; - private CreateCollectionResponseErrorCode(String value) { + CreateCollectionResponseErrorCode(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportRequest.java index ee95e76a..bd76b10f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class CreateDlpReportRequest { @@ -187,15 +186,15 @@ public boolean equals(java.lang.Object o) { } CreateDlpReportRequest other = (CreateDlpReportRequest) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.config, other.config) && - Objects.deepEquals(this.frequency, other.frequency) && - Objects.deepEquals(this.autoHideDocs, other.autoHideDocs); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.config, other.config) && + Utils.enhancedDeepEquals(this.frequency, other.frequency) && + Utils.enhancedDeepEquals(this.autoHideDocs, other.autoHideDocs); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, config, frequency, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportResponse.java index e56afee9..15b0610a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateDlpReportResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class CreateDlpReportResponse { @@ -77,12 +76,12 @@ public boolean equals(java.lang.Object o) { } CreateDlpReportResponse other = (CreateDlpReportResponse) o; return - Objects.deepEquals(this.report, other.report); + Utils.enhancedDeepEquals(this.report, other.report); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( report); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutRequest.java index 21462cf1..0437bebf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class CreateShortcutRequest { @@ -49,12 +48,12 @@ public boolean equals(java.lang.Object o) { } CreateShortcutRequest other = (CreateShortcutRequest) o; return - Objects.deepEquals(this.data, other.data); + Utils.enhancedDeepEquals(this.data, other.data); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( data); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutResponse.java index b3414cab..b23d64e8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CreateShortcutResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class CreateShortcutResponse { @@ -90,13 +89,13 @@ public boolean equals(java.lang.Object o) { } CreateShortcutResponse other = (CreateShortcutResponse) o; return - Objects.deepEquals(this.shortcut, other.shortcut) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.shortcut, other.shortcut) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( shortcut, error); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDataValue.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDataValue.java index 517f6c2a..63dc8289 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDataValue.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDataValue.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CustomDataValue { @@ -176,16 +175,16 @@ public boolean equals(java.lang.Object o) { } CustomDataValue other = (CustomDataValue) o; return - Objects.deepEquals(this.displayLabel, other.displayLabel) && - Objects.deepEquals(this.stringValue, other.stringValue) && - Objects.deepEquals(this.stringListValue, other.stringListValue) && - Objects.deepEquals(this.numberValue, other.numberValue) && - Objects.deepEquals(this.booleanValue, other.booleanValue); + Utils.enhancedDeepEquals(this.displayLabel, other.displayLabel) && + Utils.enhancedDeepEquals(this.stringValue, other.stringValue) && + Utils.enhancedDeepEquals(this.stringListValue, other.stringListValue) && + Utils.enhancedDeepEquals(this.numberValue, other.numberValue) && + Utils.enhancedDeepEquals(this.booleanValue, other.booleanValue); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( displayLabel, stringValue, stringListValue, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfig.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfig.java index 9ee7349f..dbf749a0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfig.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfig.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -1009,38 +1008,38 @@ public boolean equals(java.lang.Object o) { } CustomDatasourceConfig other = (CustomDatasourceConfig) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.displayName, other.displayName) && - Objects.deepEquals(this.datasourceCategory, other.datasourceCategory) && - Objects.deepEquals(this.urlRegex, other.urlRegex) && - Objects.deepEquals(this.iconUrl, other.iconUrl) && - Objects.deepEquals(this.objectDefinitions, other.objectDefinitions) && - Objects.deepEquals(this.suggestionText, other.suggestionText) && - Objects.deepEquals(this.homeUrl, other.homeUrl) && - Objects.deepEquals(this.crawlerSeedUrls, other.crawlerSeedUrls) && - Objects.deepEquals(this.iconDarkUrl, other.iconDarkUrl) && - Objects.deepEquals(this.hideBuiltInFacets, other.hideBuiltInFacets) && - Objects.deepEquals(this.canonicalizingURLRegex, other.canonicalizingURLRegex) && - Objects.deepEquals(this.canonicalizingTitleRegex, other.canonicalizingTitleRegex) && - Objects.deepEquals(this.redlistTitleRegex, other.redlistTitleRegex) && - Objects.deepEquals(this.connectorType, other.connectorType) && - Objects.deepEquals(this.quicklinks, other.quicklinks) && - Objects.deepEquals(this.renderConfigPreset, other.renderConfigPreset) && - Objects.deepEquals(this.aliases, other.aliases) && - Objects.deepEquals(this.isOnPrem, other.isOnPrem) && - Objects.deepEquals(this.trustUrlRegexForViewActivity, other.trustUrlRegexForViewActivity) && - Objects.deepEquals(this.includeUtmSource, other.includeUtmSource) && - Objects.deepEquals(this.stripFragmentInCanonicalUrl, other.stripFragmentInCanonicalUrl) && - Objects.deepEquals(this.identityDatasourceName, other.identityDatasourceName) && - Objects.deepEquals(this.productAccessGroup, other.productAccessGroup) && - Objects.deepEquals(this.isUserReferencedByEmail, other.isUserReferencedByEmail) && - Objects.deepEquals(this.isEntityDatasource, other.isEntityDatasource) && - Objects.deepEquals(this.isTestDatasource, other.isTestDatasource); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.datasourceCategory, other.datasourceCategory) && + Utils.enhancedDeepEquals(this.urlRegex, other.urlRegex) && + Utils.enhancedDeepEquals(this.iconUrl, other.iconUrl) && + Utils.enhancedDeepEquals(this.objectDefinitions, other.objectDefinitions) && + Utils.enhancedDeepEquals(this.suggestionText, other.suggestionText) && + Utils.enhancedDeepEquals(this.homeUrl, other.homeUrl) && + Utils.enhancedDeepEquals(this.crawlerSeedUrls, other.crawlerSeedUrls) && + Utils.enhancedDeepEquals(this.iconDarkUrl, other.iconDarkUrl) && + Utils.enhancedDeepEquals(this.hideBuiltInFacets, other.hideBuiltInFacets) && + Utils.enhancedDeepEquals(this.canonicalizingURLRegex, other.canonicalizingURLRegex) && + Utils.enhancedDeepEquals(this.canonicalizingTitleRegex, other.canonicalizingTitleRegex) && + Utils.enhancedDeepEquals(this.redlistTitleRegex, other.redlistTitleRegex) && + Utils.enhancedDeepEquals(this.connectorType, other.connectorType) && + Utils.enhancedDeepEquals(this.quicklinks, other.quicklinks) && + Utils.enhancedDeepEquals(this.renderConfigPreset, other.renderConfigPreset) && + Utils.enhancedDeepEquals(this.aliases, other.aliases) && + Utils.enhancedDeepEquals(this.isOnPrem, other.isOnPrem) && + Utils.enhancedDeepEquals(this.trustUrlRegexForViewActivity, other.trustUrlRegexForViewActivity) && + Utils.enhancedDeepEquals(this.includeUtmSource, other.includeUtmSource) && + Utils.enhancedDeepEquals(this.stripFragmentInCanonicalUrl, other.stripFragmentInCanonicalUrl) && + Utils.enhancedDeepEquals(this.identityDatasourceName, other.identityDatasourceName) && + Utils.enhancedDeepEquals(this.productAccessGroup, other.productAccessGroup) && + Utils.enhancedDeepEquals(this.isUserReferencedByEmail, other.isUserReferencedByEmail) && + Utils.enhancedDeepEquals(this.isEntityDatasource, other.isEntityDatasource) && + Utils.enhancedDeepEquals(this.isTestDatasource, other.isTestDatasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, displayName, datasourceCategory, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfigConnectorType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfigConnectorType.java index f797a4da..193a02ba 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfigConnectorType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomDatasourceConfigConnectorType.java @@ -26,7 +26,7 @@ public enum CustomDatasourceConfigConnectorType { @JsonValue private final String value; - private CustomDatasourceConfigConnectorType(String value) { + CustomDatasourceConfigConnectorType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntity.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntity.java index 77d5689f..8bad12f8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntity.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntity.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CustomEntity { @@ -272,18 +271,18 @@ public boolean equals(java.lang.Object o) { } CustomEntity other = (CustomEntity) o; return - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.roles, other.roles); + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.roles, other.roles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( permissions, id, title, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntityMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntityMetadata.java index a5685c5d..7402a6b8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntityMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomEntityMetadata.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class CustomEntityMetadata { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } CustomEntityMetadata other = (CustomEntityMetadata) o; return - Objects.deepEquals(this.customData, other.customData); + Utils.enhancedDeepEquals(this.customData, other.customData); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( customData); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldData.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldData.java index 8ce4a931..3342c72c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldData.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldData.java @@ -15,7 +15,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; public class CustomFieldData { @@ -124,14 +123,14 @@ public boolean equals(java.lang.Object o) { } CustomFieldData other = (CustomFieldData) o; return - Objects.deepEquals(this.label, other.label) && - Objects.deepEquals(this.values, other.values) && - Objects.deepEquals(this.displayable, other.displayable); + Utils.enhancedDeepEquals(this.label, other.label) && + Utils.enhancedDeepEquals(this.values, other.values) && + Utils.enhancedDeepEquals(this.displayable, other.displayable); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( label, values, displayable); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValue.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValue.java index 35729ebd..604847e6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValue.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValue.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; @JsonDeserialize(using = CustomFieldValue._Deserializer.class) public class CustomFieldValue { @@ -73,12 +72,12 @@ public boolean equals(java.lang.Object o) { return false; } CustomFieldValue other = (CustomFieldValue) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueHyperlink.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueHyperlink.java index 17f87141..d54874df 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueHyperlink.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueHyperlink.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class CustomFieldValueHyperlink { @@ -111,13 +110,13 @@ public boolean equals(java.lang.Object o) { } CustomFieldValueHyperlink other = (CustomFieldValueHyperlink) o; return - Objects.deepEquals(this.urlAnchor, other.urlAnchor) && - Objects.deepEquals(this.urlLink, other.urlLink); + Utils.enhancedDeepEquals(this.urlAnchor, other.urlAnchor) && + Utils.enhancedDeepEquals(this.urlLink, other.urlLink); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( urlAnchor, urlLink); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValuePerson.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValuePerson.java index 3df22782..3377f593 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValuePerson.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValuePerson.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class CustomFieldValuePerson { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } CustomFieldValuePerson other = (CustomFieldValuePerson) o; return - Objects.deepEquals(this.person, other.person); + Utils.enhancedDeepEquals(this.person, other.person); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( person); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueStr.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueStr.java index a348abab..2897ec96 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueStr.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomFieldValueStr.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class CustomFieldValueStr { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } CustomFieldValueStr other = (CustomFieldValueStr) o; return - Objects.deepEquals(this.strText, other.strText); + Utils.enhancedDeepEquals(this.strText, other.strText); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( strText); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomProperty.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomProperty.java index 3e356deb..9b4b4695 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomProperty.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomProperty.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -107,13 +106,13 @@ public boolean equals(java.lang.Object o) { } CustomProperty other = (CustomProperty) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.value, other.value); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.value, other.value); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, value); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Customer.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Customer.java index f09c4e96..28c791d7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Customer.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Customer.java @@ -17,7 +17,6 @@ import java.time.LocalDate; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class Customer { @@ -371,21 +370,21 @@ public boolean equals(java.lang.Object o) { } Customer other = (Customer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.domains, other.domains) && - Objects.deepEquals(this.company, other.company) && - Objects.deepEquals(this.documentCounts, other.documentCounts) && - Objects.deepEquals(this.poc, other.poc) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.mergedCustomers, other.mergedCustomers) && - Objects.deepEquals(this.startDate, other.startDate) && - Objects.deepEquals(this.contractAnnualRevenue, other.contractAnnualRevenue) && - Objects.deepEquals(this.notes, other.notes); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.domains, other.domains) && + Utils.enhancedDeepEquals(this.company, other.company) && + Utils.enhancedDeepEquals(this.documentCounts, other.documentCounts) && + Utils.enhancedDeepEquals(this.poc, other.poc) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.mergedCustomers, other.mergedCustomers) && + Utils.enhancedDeepEquals(this.startDate, other.startDate) && + Utils.enhancedDeepEquals(this.contractAnnualRevenue, other.contractAnnualRevenue) && + Utils.enhancedDeepEquals(this.notes, other.notes); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, domains, company, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomerMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomerMetadata.java index 6c7a3295..ea50dd7a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomerMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/CustomerMetadata.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class CustomerMetadata { @@ -114,13 +113,13 @@ public boolean equals(java.lang.Object o) { } CustomerMetadata other = (CustomerMetadata) o; return - Objects.deepEquals(this.datasourceId, other.datasourceId) && - Objects.deepEquals(this.customData, other.customData); + Utils.enhancedDeepEquals(this.datasourceId, other.datasourceId) && + Utils.enhancedDeepEquals(this.customData, other.customData); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasourceId, customData); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Datasource.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Datasource.java index ec57bd99..cf0282c4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Datasource.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Datasource.java @@ -21,7 +21,7 @@ public enum Datasource { @JsonValue private final String value; - private Datasource(String value) { + Datasource(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceBulkMembershipDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceBulkMembershipDefinition.java index 6e0bd087..40f512e2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceBulkMembershipDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceBulkMembershipDefinition.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -116,13 +115,13 @@ public boolean equals(java.lang.Object o) { } DatasourceBulkMembershipDefinition other = (DatasourceBulkMembershipDefinition) o; return - Objects.deepEquals(this.memberUserId, other.memberUserId) && - Objects.deepEquals(this.memberGroupName, other.memberGroupName); + Utils.enhancedDeepEquals(this.memberUserId, other.memberUserId) && + Utils.enhancedDeepEquals(this.memberGroupName, other.memberGroupName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( memberUserId, memberGroupName); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceCategory.java index dda72ec3..b9b3041c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceCategory.java @@ -35,7 +35,7 @@ public enum DatasourceCategory { @JsonValue private final String value; - private DatasourceCategory(String value) { + DatasourceCategory(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceGroupDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceGroupDefinition.java index f1281a89..aab1476c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceGroupDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceGroupDefinition.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * DatasourceGroupDefinition @@ -63,12 +62,12 @@ public boolean equals(java.lang.Object o) { } DatasourceGroupDefinition other = (DatasourceGroupDefinition) o; return - Objects.deepEquals(this.name, other.name); + Utils.enhancedDeepEquals(this.name, other.name); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceMembershipDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceMembershipDefinition.java index e759cac8..a368870b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceMembershipDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceMembershipDefinition.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -143,14 +142,14 @@ public boolean equals(java.lang.Object o) { } DatasourceMembershipDefinition other = (DatasourceMembershipDefinition) o; return - Objects.deepEquals(this.groupName, other.groupName) && - Objects.deepEquals(this.memberUserId, other.memberUserId) && - Objects.deepEquals(this.memberGroupName, other.memberGroupName); + Utils.enhancedDeepEquals(this.groupName, other.groupName) && + Utils.enhancedDeepEquals(this.memberUserId, other.memberUserId) && + Utils.enhancedDeepEquals(this.memberGroupName, other.memberGroupName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( groupName, memberUserId, memberGroupName); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceObjectTypeDocumentCountEntry.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceObjectTypeDocumentCountEntry.java index 5d706b47..848d1690 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceObjectTypeDocumentCountEntry.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceObjectTypeDocumentCountEntry.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DatasourceObjectTypeDocumentCountEntry { @@ -112,13 +111,13 @@ public boolean equals(java.lang.Object o) { } DatasourceObjectTypeDocumentCountEntry other = (DatasourceObjectTypeDocumentCountEntry) o; return - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.count, other.count); + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.count, other.count); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( objectType, count); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceProfile.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceProfile.java index 01474caa..3cbbb911 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceProfile.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceProfile.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DatasourceProfile { @@ -202,16 +201,16 @@ public boolean equals(java.lang.Object o) { } DatasourceProfile other = (DatasourceProfile) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.handle, other.handle) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.nativeAppUrl, other.nativeAppUrl) && - Objects.deepEquals(this.isUserGenerated, other.isUserGenerated); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.handle, other.handle) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.nativeAppUrl, other.nativeAppUrl) && + Utils.enhancedDeepEquals(this.isUserGenerated, other.isUserGenerated); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, handle, url, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceUserDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceUserDefinition.java index aec3d42b..14b2e95f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceUserDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceUserDefinition.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -153,15 +152,15 @@ public boolean equals(java.lang.Object o) { } DatasourceUserDefinition other = (DatasourceUserDefinition) o; return - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.userId, other.userId) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.isActive, other.isActive); + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.userId, other.userId) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.isActive, other.isActive); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( email, userId, name, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceVisibility.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceVisibility.java index 5d2ffe73..284463ec 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceVisibility.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourceVisibility.java @@ -21,7 +21,7 @@ public enum DatasourceVisibility { @JsonValue private final String value; - private DatasourceVisibility(String value) { + DatasourceVisibility(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourcesType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourcesType.java index 00007499..fb6dadf6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourcesType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DatasourcesType.java @@ -20,7 +20,7 @@ public enum DatasourcesType { @JsonValue private final String value; - private DatasourcesType(String value) { + DatasourcesType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponent.java index 1a3a884c..71f83f06 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponent.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class DebugDatasourceStatusIdentityResponseComponent { @@ -103,13 +102,13 @@ public boolean equals(java.lang.Object o) { } DebugDatasourceStatusIdentityResponseComponent other = (DebugDatasourceStatusIdentityResponseComponent) o; return - Objects.deepEquals(this.bulkUploadHistory, other.bulkUploadHistory) && - Objects.deepEquals(this.counts, other.counts); + Utils.enhancedDeepEquals(this.bulkUploadHistory, other.bulkUploadHistory) && + Utils.enhancedDeepEquals(this.counts, other.counts); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( bulkUploadHistory, counts); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponentCounts.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponentCounts.java index a63684d7..504d3038 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponentCounts.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusIdentityResponseComponentCounts.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DebugDatasourceStatusIdentityResponseComponentCounts { @@ -76,12 +75,12 @@ public boolean equals(java.lang.Object o) { } DebugDatasourceStatusIdentityResponseComponentCounts other = (DebugDatasourceStatusIdentityResponseComponentCounts) o; return - Objects.deepEquals(this.uploaded, other.uploaded); + Utils.enhancedDeepEquals(this.uploaded, other.uploaded); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploaded); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponse.java index ea1c166b..f8c553b2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -132,14 +131,14 @@ public boolean equals(java.lang.Object o) { } DebugDatasourceStatusResponse other = (DebugDatasourceStatusResponse) o; return - Objects.deepEquals(this.documents, other.documents) && - Objects.deepEquals(this.identity, other.identity) && - Objects.deepEquals(this.datasourceVisibility, other.datasourceVisibility); + Utils.enhancedDeepEquals(this.documents, other.documents) && + Utils.enhancedDeepEquals(this.identity, other.identity) && + Utils.enhancedDeepEquals(this.datasourceVisibility, other.datasourceVisibility); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documents, identity, datasourceVisibility); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponseCounts.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponseCounts.java index c0465b01..620d827e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponseCounts.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDatasourceStatusResponseCounts.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class DebugDatasourceStatusResponseCounts { @@ -115,13 +114,13 @@ public boolean equals(java.lang.Object o) { } DebugDatasourceStatusResponseCounts other = (DebugDatasourceStatusResponseCounts) o; return - Objects.deepEquals(this.uploaded, other.uploaded) && - Objects.deepEquals(this.indexed, other.indexed); + Utils.enhancedDeepEquals(this.uploaded, other.uploaded) && + Utils.enhancedDeepEquals(this.indexed, other.indexed); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploaded, indexed); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentRequest.java index a32ac9b5..ae9c8543 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * DebugDocumentRequest @@ -89,13 +88,13 @@ public boolean equals(java.lang.Object o) { } DebugDocumentRequest other = (DebugDocumentRequest) o; return - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.docId, other.docId); + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.docId, other.docId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( objectType, docId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentResponse.java index e574e6c3..92d447c9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -119,13 +118,13 @@ public boolean equals(java.lang.Object o) { } DebugDocumentResponse other = (DebugDocumentResponse) o; return - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.uploadedPermissions, other.uploadedPermissions); + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.uploadedPermissions, other.uploadedPermissions); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( status, uploadedPermissions); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsRequest.java index ef3d5519..abbae3f2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsRequest.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; /** * DebugDocumentsRequest @@ -64,12 +63,12 @@ public boolean equals(java.lang.Object o) { } DebugDocumentsRequest other = (DebugDocumentsRequest) o; return - Objects.deepEquals(this.debugDocuments, other.debugDocuments); + Utils.enhancedDeepEquals(this.debugDocuments, other.debugDocuments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( debugDocuments); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponse.java index a824bf0c..43bce98e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -83,12 +82,12 @@ public boolean equals(java.lang.Object o) { } DebugDocumentsResponse other = (DebugDocumentsResponse) o; return - Objects.deepEquals(this.documentStatuses, other.documentStatuses); + Utils.enhancedDeepEquals(this.documentStatuses, other.documentStatuses); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documentStatuses); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponseItem.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponseItem.java index cd552793..8e16d307 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponseItem.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugDocumentsResponseItem.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -154,14 +153,14 @@ public boolean equals(java.lang.Object o) { } DebugDocumentsResponseItem other = (DebugDocumentsResponseItem) o; return - Objects.deepEquals(this.docId, other.docId) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.debugInfo, other.debugInfo); + Utils.enhancedDeepEquals(this.docId, other.docId) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.debugInfo, other.debugInfo); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( docId, objectType, debugInfo); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserRequest.java index 4d623970..39cc8534 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * DebugUserRequest @@ -63,12 +62,12 @@ public boolean equals(java.lang.Object o) { } DebugUserRequest other = (DebugUserRequest) o; return - Objects.deepEquals(this.email, other.email); + Utils.enhancedDeepEquals(this.email, other.email); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( email); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserResponse.java index b57a67cd..6568ca8d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DebugUserResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -120,13 +119,13 @@ public boolean equals(java.lang.Object o) { } DebugUserResponse other = (DebugUserResponse) o; return - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.uploadedGroups, other.uploadedGroups); + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.uploadedGroups, other.uploadedGroups); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( status, uploadedGroups); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnnouncementRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnnouncementRequest.java index fa9cb063..13aea5b9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnnouncementRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnnouncementRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class DeleteAnnouncementRequest { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } DeleteAnnouncementRequest other = (DeleteAnnouncementRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnswerRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnswerRequest.java index d82e7b5e..20b5b050 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnswerRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteAnswerRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DeleteAnswerRequest { @@ -103,13 +102,13 @@ public boolean equals(java.lang.Object o) { } DeleteAnswerRequest other = (DeleteAnswerRequest) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.docId, other.docId); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.docId, other.docId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, docId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatFilesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatFilesRequest.java index 5e3ee347..5df48594 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatFilesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatFilesRequest.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class DeleteChatFilesRequest { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } DeleteChatFilesRequest other = (DeleteChatFilesRequest) o; return - Objects.deepEquals(this.fileIds, other.fileIds); + Utils.enhancedDeepEquals(this.fileIds, other.fileIds); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( fileIds); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatsRequest.java index 53e147e5..1759c310 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteChatsRequest.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class DeleteChatsRequest { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } DeleteChatsRequest other = (DeleteChatsRequest) o; return - Objects.deepEquals(this.ids, other.ids); + Utils.enhancedDeepEquals(this.ids, other.ids); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ids); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemRequest.java index 80dd7280..40fabc34 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemRequest.java @@ -12,7 +12,6 @@ import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DeleteCollectionItemRequest { @@ -130,14 +129,14 @@ public boolean equals(java.lang.Object o) { } DeleteCollectionItemRequest other = (DeleteCollectionItemRequest) o; return - Objects.deepEquals(this.collectionId, other.collectionId) && - Objects.deepEquals(this.itemId, other.itemId) && - Objects.deepEquals(this.documentId, other.documentId); + Utils.enhancedDeepEquals(this.collectionId, other.collectionId) && + Utils.enhancedDeepEquals(this.itemId, other.itemId) && + Utils.enhancedDeepEquals(this.documentId, other.documentId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( collectionId, itemId, documentId); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemResponse.java index e92e4673..e4bc425b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionItemResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class DeleteCollectionItemResponse { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } DeleteCollectionItemResponse other = (DeleteCollectionItemResponse) o; return - Objects.deepEquals(this.collection, other.collection); + Utils.enhancedDeepEquals(this.collection, other.collection); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( collection); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionRequest.java index 2c802e0b..3c5d4949 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteCollectionRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; public class DeleteCollectionRequest { @@ -104,13 +103,13 @@ public boolean equals(java.lang.Object o) { } DeleteCollectionRequest other = (DeleteCollectionRequest) o; return - Objects.deepEquals(this.ids, other.ids) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource); + Utils.enhancedDeepEquals(this.ids, other.ids) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ids, allowedDatasource); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteDocumentRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteDocumentRequest.java index 9345168e..2162cd9d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteDocumentRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteDocumentRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -162,15 +161,15 @@ public boolean equals(java.lang.Object o) { } DeleteDocumentRequest other = (DeleteDocumentRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, datasource, objectType, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteEmployeeRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteEmployeeRequest.java index 78a07e0c..7a2fd372 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteEmployeeRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteEmployeeRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -108,13 +107,13 @@ public boolean equals(java.lang.Object o) { } DeleteEmployeeRequest other = (DeleteEmployeeRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.employeeEmail, other.employeeEmail); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.employeeEmail, other.employeeEmail); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, employeeEmail); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteGroupRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteGroupRequest.java index 268ab3cd..aa868695 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteGroupRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteGroupRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -135,14 +134,14 @@ public boolean equals(java.lang.Object o) { } DeleteGroupRequest other = (DeleteGroupRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.groupName, other.groupName); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.groupName, other.groupName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, datasource, groupName); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteMembershipRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteMembershipRequest.java index b2c57bb4..a502b095 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteMembershipRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteMembershipRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -135,14 +134,14 @@ public boolean equals(java.lang.Object o) { } DeleteMembershipRequest other = (DeleteMembershipRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.membership, other.membership); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.membership, other.membership); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, datasource, membership); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteShortcutRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteShortcutRequest.java index 49f70489..688c01ad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteShortcutRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteShortcutRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class DeleteShortcutRequest { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } DeleteShortcutRequest other = (DeleteShortcutRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteTeamRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteTeamRequest.java index 4a07163f..678f6751 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteTeamRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteTeamRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * DeleteTeamRequest @@ -63,12 +62,12 @@ public boolean equals(java.lang.Object o) { } DeleteTeamRequest other = (DeleteTeamRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteUserRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteUserRequest.java index 23a007b1..2533f75a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteUserRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DeleteUserRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -135,14 +134,14 @@ public boolean equals(java.lang.Object o) { } DeleteUserRequest other = (DeleteUserRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.email, other.email); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.email, other.email); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, datasource, email); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Direction.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Direction.java index bec24f79..071617e0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Direction.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Direction.java @@ -20,7 +20,7 @@ public enum Direction { @JsonValue private final String value; - private Direction(String value) { + Direction(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Disambiguation.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Disambiguation.java index bb1114a9..aa49e0ad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Disambiguation.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Disambiguation.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -154,14 +153,14 @@ public boolean equals(java.lang.Object o) { } Disambiguation other = (Disambiguation) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, id, type); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DisplayableListItemUIConfig.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DisplayableListItemUIConfig.java index 7b515b70..dcc9819c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DisplayableListItemUIConfig.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DisplayableListItemUIConfig.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -81,12 +80,12 @@ public boolean equals(java.lang.Object o) { } DisplayableListItemUIConfig other = (DisplayableListItemUIConfig) o; return - Objects.deepEquals(this.showNewIndicator, other.showNewIndicator); + Utils.enhancedDeepEquals(this.showNewIndicator, other.showNewIndicator); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( showNewIndicator); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpConfig.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpConfig.java index a028af85..942d29a1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpConfig.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpConfig.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -532,24 +531,24 @@ public boolean equals(java.lang.Object o) { } DlpConfig other = (DlpConfig) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.sensitiveInfoTypes, other.sensitiveInfoTypes) && - Objects.deepEquals(this.inputOptions, other.inputOptions) && - Objects.deepEquals(this.externalSharingOptions, other.externalSharingOptions) && - Objects.deepEquals(this.broadSharingOptions, other.broadSharingOptions) && - Objects.deepEquals(this.sensitiveContentOptions, other.sensitiveContentOptions) && - Objects.deepEquals(this.reportName, other.reportName) && - Objects.deepEquals(this.frequency, other.frequency) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.redactQuote, other.redactQuote) && - Objects.deepEquals(this.autoHideDocs, other.autoHideDocs) && - Objects.deepEquals(this.allowlistOptions, other.allowlistOptions); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.sensitiveInfoTypes, other.sensitiveInfoTypes) && + Utils.enhancedDeepEquals(this.inputOptions, other.inputOptions) && + Utils.enhancedDeepEquals(this.externalSharingOptions, other.externalSharingOptions) && + Utils.enhancedDeepEquals(this.broadSharingOptions, other.broadSharingOptions) && + Utils.enhancedDeepEquals(this.sensitiveContentOptions, other.sensitiveContentOptions) && + Utils.enhancedDeepEquals(this.reportName, other.reportName) && + Utils.enhancedDeepEquals(this.frequency, other.frequency) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.redactQuote, other.redactQuote) && + Utils.enhancedDeepEquals(this.autoHideDocs, other.autoHideDocs) && + Utils.enhancedDeepEquals(this.allowlistOptions, other.allowlistOptions); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, sensitiveInfoTypes, inputOptions, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpFrequency.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpFrequency.java index 41713129..2d7976c3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpFrequency.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpFrequency.java @@ -23,7 +23,7 @@ public enum DlpFrequency { @JsonValue private final String value; - private DlpFrequency(String value) { + DlpFrequency(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPerson.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPerson.java index 87dd7628..9da69789 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPerson.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPerson.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -124,14 +123,14 @@ public boolean equals(java.lang.Object o) { } DlpPerson other = (DlpPerson) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.obfuscatedId, other.obfuscatedId) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.obfuscatedId, other.obfuscatedId) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, obfuscatedId, metadata); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPersonMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPersonMetadata.java index 3ad621d0..8d8567a8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPersonMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpPersonMetadata.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DlpPersonMetadata { @@ -111,13 +110,13 @@ public boolean equals(java.lang.Object o) { } DlpPersonMetadata other = (DlpPersonMetadata) o; return - Objects.deepEquals(this.firstName, other.firstName) && - Objects.deepEquals(this.email, other.email); + Utils.enhancedDeepEquals(this.firstName, other.firstName) && + Utils.enhancedDeepEquals(this.email, other.email); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( firstName, email); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReport.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReport.java index b7b5a8a0..662dc111 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReport.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReport.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -448,23 +447,23 @@ public boolean equals(java.lang.Object o) { } DlpReport other = (DlpReport) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.config, other.config) && - Objects.deepEquals(this.frequency, other.frequency) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.lastUpdatedAt, other.lastUpdatedAt) && - Objects.deepEquals(this.autoHideDocs, other.autoHideDocs) && - Objects.deepEquals(this.lastScanStatus, other.lastScanStatus) && - Objects.deepEquals(this.lastScanStartTime, other.lastScanStartTime) && - Objects.deepEquals(this.updatedBy, other.updatedBy); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.config, other.config) && + Utils.enhancedDeepEquals(this.frequency, other.frequency) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.lastUpdatedAt, other.lastUpdatedAt) && + Utils.enhancedDeepEquals(this.autoHideDocs, other.autoHideDocs) && + Utils.enhancedDeepEquals(this.lastScanStatus, other.lastScanStatus) && + Utils.enhancedDeepEquals(this.lastScanStartTime, other.lastScanStartTime) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, name, config, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReportStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReportStatus.java index 56ef423b..cd1333f8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReportStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpReportStatus.java @@ -22,7 +22,7 @@ public enum DlpReportStatus { @JsonValue private final String value; - private DlpReportStatus(String value) { + DlpReportStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpSimpleResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpSimpleResult.java index c5c39a92..be2855b1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpSimpleResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DlpSimpleResult.java @@ -15,7 +15,7 @@ public enum DlpSimpleResult { @JsonValue private final String value; - private DlpSimpleResult(String value) { + DlpSimpleResult(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocCategory.java index a0b71806..33731e60 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocCategory.java @@ -35,7 +35,7 @@ public enum DocCategory { @JsonValue private final String value; - private DocCategory(String value) { + DocCategory(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Document.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Document.java index 82af2b99..cd482ab1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Document.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Document.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Document { @@ -395,22 +394,22 @@ public boolean equals(java.lang.Object o) { } Document other = (Document) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.connectorType, other.connectorType) && - Objects.deepEquals(this.docType, other.docType) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.containerDocument, other.containerDocument) && - Objects.deepEquals(this.parentDocument, other.parentDocument) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.sections, other.sections); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.connectorType, other.connectorType) && + Utils.enhancedDeepEquals(this.docType, other.docType) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.containerDocument, other.containerDocument) && + Utils.enhancedDeepEquals(this.parentDocument, other.parentDocument) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.sections, other.sections); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, datasource, connectorType, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentContent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentContent.java index ea24788a..8483f444 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentContent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentContent.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class DocumentContent { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } DocumentContent other = (DocumentContent) o; return - Objects.deepEquals(this.fullTextList, other.fullTextList); + Utils.enhancedDeepEquals(this.fullTextList, other.fullTextList); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( fullTextList); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentDefinition.java index b13b53b0..004431fe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentDefinition.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -856,34 +855,34 @@ public boolean equals(java.lang.Object o) { } DocumentDefinition other = (DocumentDefinition) o; return - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.filename, other.filename) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.containerDatasourceId, other.containerDatasourceId) && - Objects.deepEquals(this.containerObjectType, other.containerObjectType) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.viewURL, other.viewURL) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.body, other.body) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.owner, other.owner) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.tags, other.tags) && - Objects.deepEquals(this.interactions, other.interactions) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.additionalUrls, other.additionalUrls) && - Objects.deepEquals(this.comments, other.comments) && - Objects.deepEquals(this.customProperties, other.customProperties); + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.filename, other.filename) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.containerDatasourceId, other.containerDatasourceId) && + Utils.enhancedDeepEquals(this.containerObjectType, other.containerObjectType) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.viewURL, other.viewURL) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.body, other.body) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.owner, other.owner) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.tags, other.tags) && + Utils.enhancedDeepEquals(this.interactions, other.interactions) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.additionalUrls, other.additionalUrls) && + Utils.enhancedDeepEquals(this.comments, other.comments) && + Utils.enhancedDeepEquals(this.customProperties, other.customProperties); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( title, filename, container, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInsight.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInsight.java index 63f18155..fc826079 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInsight.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInsight.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class DocumentInsight { @@ -108,14 +107,14 @@ public boolean equals(java.lang.Object o) { } DocumentInsight other = (DocumentInsight) o; return - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.visitorCount, other.visitorCount); + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.visitorCount, other.visitorCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( document, viewCount, visitorCount); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractions.java index 8fffd3f4..a35b9799 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractions.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class DocumentInteractions { @@ -251,17 +250,17 @@ public boolean equals(java.lang.Object o) { } DocumentInteractions other = (DocumentInteractions) o; return - Objects.deepEquals(this.numComments, other.numComments) && - Objects.deepEquals(this.numReactions, other.numReactions) && - Objects.deepEquals(this.reactions, other.reactions) && - Objects.deepEquals(this.reacts, other.reacts) && - Objects.deepEquals(this.shares, other.shares) && - Objects.deepEquals(this.visitorCount, other.visitorCount); + Utils.enhancedDeepEquals(this.numComments, other.numComments) && + Utils.enhancedDeepEquals(this.numReactions, other.numReactions) && + Utils.enhancedDeepEquals(this.reactions, other.reactions) && + Utils.enhancedDeepEquals(this.reacts, other.reacts) && + Utils.enhancedDeepEquals(this.shares, other.shares) && + Utils.enhancedDeepEquals(this.visitorCount, other.visitorCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( numComments, numReactions, reactions, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractionsDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractionsDefinition.java index 3a7b3238..aa4f356c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractionsDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentInteractionsDefinition.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -117,14 +116,14 @@ public boolean equals(java.lang.Object o) { } DocumentInteractionsDefinition other = (DocumentInteractionsDefinition) o; return - Objects.deepEquals(this.numViews, other.numViews) && - Objects.deepEquals(this.numLikes, other.numLikes) && - Objects.deepEquals(this.numComments, other.numComments); + Utils.enhancedDeepEquals(this.numViews, other.numViews) && + Utils.enhancedDeepEquals(this.numLikes, other.numLikes) && + Utils.enhancedDeepEquals(this.numComments, other.numComments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( numViews, numLikes, numComments); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentMetadata.java index e66c0921..3c9965a6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentMetadata.java @@ -15,7 +15,6 @@ import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class DocumentMetadata { @@ -1312,51 +1311,51 @@ public boolean equals(java.lang.Object o) { } DocumentMetadata other = (DocumentMetadata) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.datasourceInstance, other.datasourceInstance) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.containerId, other.containerId) && - Objects.deepEquals(this.superContainerId, other.superContainerId) && - Objects.deepEquals(this.parentId, other.parentId) && - Objects.deepEquals(this.mimeType, other.mimeType) && - Objects.deepEquals(this.documentId, other.documentId) && - Objects.deepEquals(this.loggingId, other.loggingId) && - Objects.deepEquals(this.documentIdHash, other.documentIdHash) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.owner, other.owner) && - Objects.deepEquals(this.mentionedPeople, other.mentionedPeople) && - Objects.deepEquals(this.visibility, other.visibility) && - Objects.deepEquals(this.components, other.components) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.statusCategory, other.statusCategory) && - Objects.deepEquals(this.pins, other.pins) && - Objects.deepEquals(this.priority, other.priority) && - Objects.deepEquals(this.assignedTo, other.assignedTo) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.labels, other.labels) && - Objects.deepEquals(this.collections, other.collections) && - Objects.deepEquals(this.datasourceId, other.datasourceId) && - Objects.deepEquals(this.interactions, other.interactions) && - Objects.deepEquals(this.verification, other.verification) && - Objects.deepEquals(this.viewerInfo, other.viewerInfo) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.visitCount, other.visitCount) && - Objects.deepEquals(this.shortcuts, other.shortcuts) && - Objects.deepEquals(this.path, other.path) && - Objects.deepEquals(this.customData, other.customData) && - Objects.deepEquals(this.documentCategory, other.documentCategory) && - Objects.deepEquals(this.contactPerson, other.contactPerson) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.indexStatus, other.indexStatus) && - Objects.deepEquals(this.ancestors, other.ancestors); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.datasourceInstance, other.datasourceInstance) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.containerId, other.containerId) && + Utils.enhancedDeepEquals(this.superContainerId, other.superContainerId) && + Utils.enhancedDeepEquals(this.parentId, other.parentId) && + Utils.enhancedDeepEquals(this.mimeType, other.mimeType) && + Utils.enhancedDeepEquals(this.documentId, other.documentId) && + Utils.enhancedDeepEquals(this.loggingId, other.loggingId) && + Utils.enhancedDeepEquals(this.documentIdHash, other.documentIdHash) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.owner, other.owner) && + Utils.enhancedDeepEquals(this.mentionedPeople, other.mentionedPeople) && + Utils.enhancedDeepEquals(this.visibility, other.visibility) && + Utils.enhancedDeepEquals(this.components, other.components) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.statusCategory, other.statusCategory) && + Utils.enhancedDeepEquals(this.pins, other.pins) && + Utils.enhancedDeepEquals(this.priority, other.priority) && + Utils.enhancedDeepEquals(this.assignedTo, other.assignedTo) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.labels, other.labels) && + Utils.enhancedDeepEquals(this.collections, other.collections) && + Utils.enhancedDeepEquals(this.datasourceId, other.datasourceId) && + Utils.enhancedDeepEquals(this.interactions, other.interactions) && + Utils.enhancedDeepEquals(this.verification, other.verification) && + Utils.enhancedDeepEquals(this.viewerInfo, other.viewerInfo) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.visitCount, other.visitCount) && + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts) && + Utils.enhancedDeepEquals(this.path, other.path) && + Utils.enhancedDeepEquals(this.customData, other.customData) && + Utils.enhancedDeepEquals(this.documentCategory, other.documentCategory) && + Utils.enhancedDeepEquals(this.contactPerson, other.contactPerson) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.indexStatus, other.indexStatus) && + Utils.enhancedDeepEquals(this.ancestors, other.ancestors); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, datasourceInstance, objectType, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrError.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrError.java index 34e6a28c..0787e10c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrError.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DocumentOrError { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } DocumentOrError other = (DocumentOrError) o; return - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( error); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrErrorUnion.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrErrorUnion.java index 643aa834..2595e179 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrErrorUnion.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentOrErrorUnion.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; @JsonDeserialize(using = DocumentOrErrorUnion._Deserializer.class) public class DocumentOrErrorUnion { @@ -67,12 +66,12 @@ public boolean equals(java.lang.Object o) { return false; } DocumentOrErrorUnion other = (DocumentOrErrorUnion) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentPermissionsDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentPermissionsDefinition.java index a69c0c0b..20acb538 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentPermissionsDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentPermissionsDefinition.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -230,16 +229,16 @@ public boolean equals(java.lang.Object o) { } DocumentPermissionsDefinition other = (DocumentPermissionsDefinition) o; return - Objects.deepEquals(this.allowedUsers, other.allowedUsers) && - Objects.deepEquals(this.allowedGroups, other.allowedGroups) && - Objects.deepEquals(this.allowedGroupIntersections, other.allowedGroupIntersections) && - Objects.deepEquals(this.allowAnonymousAccess, other.allowAnonymousAccess) && - Objects.deepEquals(this.allowAllDatasourceUsersAccess, other.allowAllDatasourceUsersAccess); + Utils.enhancedDeepEquals(this.allowedUsers, other.allowedUsers) && + Utils.enhancedDeepEquals(this.allowedGroups, other.allowedGroups) && + Utils.enhancedDeepEquals(this.allowedGroupIntersections, other.allowedGroupIntersections) && + Utils.enhancedDeepEquals(this.allowAnonymousAccess, other.allowAnonymousAccess) && + Utils.enhancedDeepEquals(this.allowAllDatasourceUsersAccess, other.allowAllDatasourceUsersAccess); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( allowedUsers, allowedGroups, allowedGroupIntersections, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSection.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSection.java index dc532ac7..0abfedd3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSection.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSection.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DocumentSection { @@ -111,13 +110,13 @@ public boolean equals(java.lang.Object o) { } DocumentSection other = (DocumentSection) o; return - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( title, url); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec1.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec1.java index e7f14623..b1fd0a64 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec1.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec1.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DocumentSpec1 { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } DocumentSpec1 other = (DocumentSpec1) o; return - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( url); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec2.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec2.java index 205c752c..e1f1bba8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec2.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec2.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DocumentSpec2 { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } DocumentSpec2 other = (DocumentSpec2) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec3.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec3.java index 68beb846..0bf975fe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec3.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpec3.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class DocumentSpec3 { @@ -150,14 +149,14 @@ public boolean equals(java.lang.Object o) { } DocumentSpec3 other = (DocumentSpec3) o; return - Objects.deepEquals(this.ugcType, other.ugcType) && - Objects.deepEquals(this.contentId, other.contentId) && - Objects.deepEquals(this.docType, other.docType); + Utils.enhancedDeepEquals(this.ugcType, other.ugcType) && + Utils.enhancedDeepEquals(this.contentId, other.contentId) && + Utils.enhancedDeepEquals(this.docType, other.docType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ugcType, contentId, docType); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUgcType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUgcType.java index d1926ae9..68dd6b1b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUgcType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUgcType.java @@ -22,7 +22,7 @@ public enum DocumentSpecUgcType { @JsonValue private final String value; - private DocumentSpecUgcType(String value) { + DocumentSpecUgcType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUnion.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUnion.java index f353162c..8b1f1e22 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUnion.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentSpecUnion.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; @JsonDeserialize(using = DocumentSpecUnion._Deserializer.class) public class DocumentSpecUnion { @@ -73,12 +72,12 @@ public boolean equals(java.lang.Object o) { return false; } DocumentSpecUnion other = (DocumentSpecUnion) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentStatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentStatusResponse.java index bc64013a..b6c7d778 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentStatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentStatusResponse.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -224,16 +223,16 @@ public boolean equals(java.lang.Object o) { } DocumentStatusResponse other = (DocumentStatusResponse) o; return - Objects.deepEquals(this.uploadStatus, other.uploadStatus) && - Objects.deepEquals(this.lastUploadedAt, other.lastUploadedAt) && - Objects.deepEquals(this.indexingStatus, other.indexingStatus) && - Objects.deepEquals(this.lastIndexedAt, other.lastIndexedAt) && - Objects.deepEquals(this.permissionIdentityStatus, other.permissionIdentityStatus); + Utils.enhancedDeepEquals(this.uploadStatus, other.uploadStatus) && + Utils.enhancedDeepEquals(this.lastUploadedAt, other.lastUploadedAt) && + Utils.enhancedDeepEquals(this.indexingStatus, other.indexingStatus) && + Utils.enhancedDeepEquals(this.lastIndexedAt, other.lastIndexedAt) && + Utils.enhancedDeepEquals(this.permissionIdentityStatus, other.permissionIdentityStatus); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadStatus, lastUploadedAt, indexingStatus, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibility.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibility.java index 119103b2..b28822b5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibility.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibility.java @@ -24,7 +24,7 @@ public enum DocumentVisibility { @JsonValue private final String value; - private DocumentVisibility(String value) { + DocumentVisibility(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverride.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverride.java index 4ede6bcf..636ebede 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverride.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverride.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class DocumentVisibilityOverride { @@ -101,13 +100,13 @@ public boolean equals(java.lang.Object o) { } DocumentVisibilityOverride other = (DocumentVisibilityOverride) o; return - Objects.deepEquals(this.docId, other.docId) && - Objects.deepEquals(this.override, other.override); + Utils.enhancedDeepEquals(this.docId, other.docId) && + Utils.enhancedDeepEquals(this.override, other.override); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( docId, override); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverrideOverride.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverrideOverride.java index 0cb28580..991243c3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverrideOverride.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityOverrideOverride.java @@ -22,7 +22,7 @@ public enum DocumentVisibilityOverrideOverride { @JsonValue private final String value; - private DocumentVisibilityOverrideOverride(String value) { + DocumentVisibilityOverrideOverride(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResult.java index b3dff84b..3f9f186b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResult.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class DocumentVisibilityUpdateResult { @@ -138,14 +137,14 @@ public boolean equals(java.lang.Object o) { } DocumentVisibilityUpdateResult other = (DocumentVisibilityUpdateResult) o; return - Objects.deepEquals(this.docId, other.docId) && - Objects.deepEquals(this.override, other.override) && - Objects.deepEquals(this.success, other.success); + Utils.enhancedDeepEquals(this.docId, other.docId) && + Utils.enhancedDeepEquals(this.override, other.override) && + Utils.enhancedDeepEquals(this.success, other.success); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( docId, override, success); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResultOverride.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResultOverride.java index 2c760ac2..6fc38ec4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResultOverride.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/DocumentVisibilityUpdateResultOverride.java @@ -22,7 +22,7 @@ public enum DocumentVisibilityUpdateResultOverride { @JsonValue private final String value; - private DocumentVisibilityUpdateResultOverride(String value) { + DocumentVisibilityUpdateResultOverride(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Documents.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Documents.java index 2eaa916b..9ddb166d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Documents.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Documents.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Documents { @@ -140,14 +139,14 @@ public boolean equals(java.lang.Object o) { } Documents other = (Documents) o; return - Objects.deepEquals(this.bulkUploadHistory, other.bulkUploadHistory) && - Objects.deepEquals(this.counts, other.counts) && - Objects.deepEquals(this.processingHistory, other.processingHistory); + Utils.enhancedDeepEquals(this.bulkUploadHistory, other.bulkUploadHistory) && + Utils.enhancedDeepEquals(this.counts, other.counts) && + Utils.enhancedDeepEquals(this.processingHistory, other.processingHistory); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( bulkUploadHistory, counts, processingHistory); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequest.java index 58d8aacf..d36f8baa 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequest.java @@ -9,12 +9,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Deprecated; import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class EditAnswerRequest { @@ -51,10 +51,13 @@ public class EditAnswerRequest { private Optional bodyText; /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("boardId") + @Deprecated private Optional boardId; /** @@ -204,8 +207,11 @@ public Optional bodyText() { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated @JsonIgnore public Optional boardId() { return boardId; @@ -363,8 +369,11 @@ public EditAnswerRequest withBodyText(Optional bodyText) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public EditAnswerRequest withBoardId(long boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = Optional.ofNullable(boardId); @@ -372,8 +381,11 @@ public EditAnswerRequest withBoardId(long boardId) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public EditAnswerRequest withBoardId(Optional boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = boardId; @@ -535,26 +547,26 @@ public boolean equals(java.lang.Object o) { } EditAnswerRequest other = (EditAnswerRequest) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.docId, other.docId) && - Objects.deepEquals(this.question, other.question) && - Objects.deepEquals(this.questionVariations, other.questionVariations) && - Objects.deepEquals(this.bodyText, other.bodyText) && - Objects.deepEquals(this.boardId, other.boardId) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.roles, other.roles) && - Objects.deepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && - Objects.deepEquals(this.sourceType, other.sourceType) && - Objects.deepEquals(this.addedCollections, other.addedCollections) && - Objects.deepEquals(this.removedCollections, other.removedCollections) && - Objects.deepEquals(this.combinedAnswerText, other.combinedAnswerText); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.docId, other.docId) && + Utils.enhancedDeepEquals(this.question, other.question) && + Utils.enhancedDeepEquals(this.questionVariations, other.questionVariations) && + Utils.enhancedDeepEquals(this.bodyText, other.bodyText) && + Utils.enhancedDeepEquals(this.boardId, other.boardId) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.roles, other.roles) && + Utils.enhancedDeepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && + Utils.enhancedDeepEquals(this.sourceType, other.sourceType) && + Utils.enhancedDeepEquals(this.addedCollections, other.addedCollections) && + Utils.enhancedDeepEquals(this.removedCollections, other.removedCollections) && + Utils.enhancedDeepEquals(this.combinedAnswerText, other.combinedAnswerText); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, docId, question, @@ -604,6 +616,7 @@ public final static class Builder { private Optional bodyText = Optional.empty(); + @Deprecated private Optional boardId = Optional.empty(); private Optional> audienceFilters = Optional.empty(); @@ -704,8 +717,11 @@ public Builder bodyText(Optional bodyText) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Builder boardId(long boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = Optional.ofNullable(boardId); @@ -713,8 +729,11 @@ public Builder boardId(long boardId) { } /** - * The parent board ID of this Answer, or 0 if it's a floating Answer. + * The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ + @Deprecated public Builder boardId(Optional boardId) { Utils.checkNotNull(boardId, "boardId"); this.boardId = boardId; diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequestSourceType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequestSourceType.java index 625614e8..28a5c594 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequestSourceType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditAnswerRequestSourceType.java @@ -15,7 +15,7 @@ public enum EditAnswerRequestSourceType { @JsonValue private final String value; - private EditAnswerRequestSourceType(String value) { + EditAnswerRequestSourceType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemRequest.java index 91345a9c..a66cb22f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class EditCollectionItemRequest { @@ -202,16 +201,16 @@ public boolean equals(java.lang.Object o) { } EditCollectionItemRequest other = (EditCollectionItemRequest) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.collectionId, other.collectionId) && - Objects.deepEquals(this.itemId, other.itemId); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.collectionId, other.collectionId) && + Utils.enhancedDeepEquals(this.itemId, other.itemId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, icon, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemResponse.java index 75c4e22a..3cf7226e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionItemResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class EditCollectionItemResponse { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } EditCollectionItemResponse other = (EditCollectionItemResponse) o; return - Objects.deepEquals(this.collection, other.collection); + Utils.enhancedDeepEquals(this.collection, other.collection); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( collection); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionRequest.java index eebe47fc..74ed8568 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionRequest.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class EditCollectionRequest { @@ -413,22 +412,22 @@ public boolean equals(java.lang.Object o) { } EditCollectionRequest other = (EditCollectionRequest) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.adminLocked, other.adminLocked) && - Objects.deepEquals(this.parentId, other.parentId) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource) && - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.adminLocked, other.adminLocked) && + Utils.enhancedDeepEquals(this.parentId, other.parentId) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource) && + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, addedRoles, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponse.java index fa5090d0..96faf77f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponse.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class EditCollectionResponse { @@ -841,37 +840,37 @@ public boolean equals(java.lang.Object o) { } EditCollectionResponse other = (EditCollectionResponse) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.adminLocked, other.adminLocked) && - Objects.deepEquals(this.parentId, other.parentId) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.creator, other.creator) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.itemCount, other.itemCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.items, other.items) && - Objects.deepEquals(this.pinMetadata, other.pinMetadata) && - Objects.deepEquals(this.shortcuts, other.shortcuts) && - Objects.deepEquals(this.children, other.children) && - Objects.deepEquals(this.roles, other.roles) && - Objects.deepEquals(this.errorCode, other.errorCode) && - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.adminLocked, other.adminLocked) && + Utils.enhancedDeepEquals(this.parentId, other.parentId) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.creator, other.creator) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.itemCount, other.itemCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.items, other.items) && + Utils.enhancedDeepEquals(this.pinMetadata, other.pinMetadata) && + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts) && + Utils.enhancedDeepEquals(this.children, other.children) && + Utils.enhancedDeepEquals(this.roles, other.roles) && + Utils.enhancedDeepEquals(this.errorCode, other.errorCode) && + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, description, addedRoles, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponseErrorCode.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponseErrorCode.java index fd5beba5..1bbbda90 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponseErrorCode.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditCollectionResponseErrorCode.java @@ -20,7 +20,7 @@ public enum EditCollectionResponseErrorCode { @JsonValue private final String value; - private EditCollectionResponseErrorCode(String value) { + EditCollectionResponseErrorCode(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditPinRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditPinRequest.java index 6dc47d36..15f90c40 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EditPinRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EditPinRequest.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class EditPinRequest { @@ -151,14 +150,14 @@ public boolean equals(java.lang.Object o) { } EditPinRequest other = (EditPinRequest) o; return - Objects.deepEquals(this.queries, other.queries) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.queries, other.queries) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( queries, audienceFilters, id); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeInfoDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeInfoDefinition.java index e7a03044..f7844d92 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeInfoDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeInfoDefinition.java @@ -17,7 +17,6 @@ import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -1023,38 +1022,38 @@ public boolean equals(java.lang.Object o) { } EmployeeInfoDefinition other = (EmployeeInfoDefinition) o; return - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.firstName, other.firstName) && - Objects.deepEquals(this.lastName, other.lastName) && - Objects.deepEquals(this.preferredName, other.preferredName) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.phoneNumber, other.phoneNumber) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.structuredLocation, other.structuredLocation) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.photoUrl, other.photoUrl) && - Objects.deepEquals(this.businessUnit, other.businessUnit) && - Objects.deepEquals(this.department, other.department) && - Objects.deepEquals(this.datasourceProfiles, other.datasourceProfiles) && - Objects.deepEquals(this.teams, other.teams) && - Objects.deepEquals(this.startDate, other.startDate) && - Objects.deepEquals(this.endDate, other.endDate) && - Objects.deepEquals(this.bio, other.bio) && - Objects.deepEquals(this.pronoun, other.pronoun) && - Objects.deepEquals(this.alsoKnownAs, other.alsoKnownAs) && - Objects.deepEquals(this.profileUrl, other.profileUrl) && - Objects.deepEquals(this.socialNetworks, other.socialNetworks) && - Objects.deepEquals(this.managerEmail, other.managerEmail) && - Objects.deepEquals(this.managerId, other.managerId) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.relationships, other.relationships) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.additionalFields, other.additionalFields); + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.firstName, other.firstName) && + Utils.enhancedDeepEquals(this.lastName, other.lastName) && + Utils.enhancedDeepEquals(this.preferredName, other.preferredName) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.phoneNumber, other.phoneNumber) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.structuredLocation, other.structuredLocation) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.photoUrl, other.photoUrl) && + Utils.enhancedDeepEquals(this.businessUnit, other.businessUnit) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.datasourceProfiles, other.datasourceProfiles) && + Utils.enhancedDeepEquals(this.teams, other.teams) && + Utils.enhancedDeepEquals(this.startDate, other.startDate) && + Utils.enhancedDeepEquals(this.endDate, other.endDate) && + Utils.enhancedDeepEquals(this.bio, other.bio) && + Utils.enhancedDeepEquals(this.pronoun, other.pronoun) && + Utils.enhancedDeepEquals(this.alsoKnownAs, other.alsoKnownAs) && + Utils.enhancedDeepEquals(this.profileUrl, other.profileUrl) && + Utils.enhancedDeepEquals(this.socialNetworks, other.socialNetworks) && + Utils.enhancedDeepEquals(this.managerEmail, other.managerEmail) && + Utils.enhancedDeepEquals(this.managerId, other.managerId) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.relationships, other.relationships) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.additionalFields, other.additionalFields); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( email, firstName, lastName, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeTeamInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeTeamInfo.java index 7e078184..102d14a6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeTeamInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EmployeeTeamInfo.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -152,14 +151,14 @@ public boolean equals(java.lang.Object o) { } EmployeeTeamInfo other = (EmployeeTeamInfo) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, name, url); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EntitiesSortOrder.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EntitiesSortOrder.java index 159ed190..eb235c46 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EntitiesSortOrder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EntitiesSortOrder.java @@ -25,7 +25,7 @@ public enum EntitiesSortOrder { @JsonValue private final String value; - private EntitiesSortOrder(String value) { + EntitiesSortOrder(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityRelationship.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityRelationship.java index 9c4d55a8..a2a469bc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityRelationship.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityRelationship.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * EntityRelationship @@ -89,13 +88,13 @@ public boolean equals(java.lang.Object o) { } EntityRelationship other = (EntityRelationship) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.email, other.email); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.email, other.email); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, email); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityType.java index 13bffc66..de2f862f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EntityType.java @@ -21,7 +21,7 @@ public enum EntityType { @JsonValue private final String value; - private EntityType(String value) { + EntityType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Error.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Error.java index 8d269876..5465bd1e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Error.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Error.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class Error { @@ -63,12 +62,12 @@ public boolean equals(java.lang.Object o) { } Error other = (Error) o; return - Objects.deepEquals(this.message, other.message); + Utils.enhancedDeepEquals(this.message, other.message); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( message); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ErrorMessage.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ErrorMessage.java index e601cf6a..e87fb682 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ErrorMessage.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ErrorMessage.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ErrorMessage { @@ -99,13 +98,13 @@ public boolean equals(java.lang.Object o) { } ErrorMessage other = (ErrorMessage) o; return - Objects.deepEquals(this.source, other.source) && - Objects.deepEquals(this.errorMessage, other.errorMessage); + Utils.enhancedDeepEquals(this.source, other.source) && + Utils.enhancedDeepEquals(this.errorMessage, other.errorMessage); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( source, errorMessage); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Event.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Event.java index cb9ddddc..5a772a0b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Event.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Event.java @@ -47,7 +47,7 @@ public enum Event { @JsonValue private final String value; - private Event(String value) { + Event(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassification.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassification.java index 06a70624..0deeb4c0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassification.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassification.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -108,13 +107,13 @@ public boolean equals(java.lang.Object o) { } EventClassification other = (EventClassification) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.strategies, other.strategies); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.strategies, other.strategies); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, strategies); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassificationName.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassificationName.java index 8e08a9d5..39d74576 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassificationName.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EventClassificationName.java @@ -19,7 +19,7 @@ public enum EventClassificationName { @JsonValue private final String value; - private EventClassificationName(String value) { + EventClassificationName(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/EventStrategyName.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/EventStrategyName.java index ad585fae..43cd580d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/EventStrategyName.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/EventStrategyName.java @@ -27,7 +27,7 @@ public enum EventStrategyName { @JsonValue private final String value; - private EventStrategyName(String value) { + EventStrategyName(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalSharingOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalSharingOptions.java index d1f3bf8f..4115ba26 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalSharingOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalSharingOptions.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -381,20 +380,20 @@ public boolean equals(java.lang.Object o) { } ExternalSharingOptions other = (ExternalSharingOptions) o; return - Objects.deepEquals(this.enabled, other.enabled) && - Objects.deepEquals(this.threshold, other.threshold) && - Objects.deepEquals(this.thresholdEnabled, other.thresholdEnabled) && - Objects.deepEquals(this.anyoneWithLinkEnabled, other.anyoneWithLinkEnabled) && - Objects.deepEquals(this.anyoneInternalEnabled, other.anyoneInternalEnabled) && - Objects.deepEquals(this.anonymousAccessEnabled, other.anonymousAccessEnabled) && - Objects.deepEquals(this.userAccessEnabled, other.userAccessEnabled) && - Objects.deepEquals(this.userIds, other.userIds) && - Objects.deepEquals(this.domainAccessEnabled, other.domainAccessEnabled); + Utils.enhancedDeepEquals(this.enabled, other.enabled) && + Utils.enhancedDeepEquals(this.threshold, other.threshold) && + Utils.enhancedDeepEquals(this.thresholdEnabled, other.thresholdEnabled) && + Utils.enhancedDeepEquals(this.anyoneWithLinkEnabled, other.anyoneWithLinkEnabled) && + Utils.enhancedDeepEquals(this.anyoneInternalEnabled, other.anyoneInternalEnabled) && + Utils.enhancedDeepEquals(this.anonymousAccessEnabled, other.anonymousAccessEnabled) && + Utils.enhancedDeepEquals(this.userAccessEnabled, other.userAccessEnabled) && + Utils.enhancedDeepEquals(this.userIds, other.userIds) && + Utils.enhancedDeepEquals(this.domainAccessEnabled, other.domainAccessEnabled); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( enabled, threshold, thresholdEnabled, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalShortcut.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalShortcut.java index 072472e7..ffb3164c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalShortcut.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExternalShortcut.java @@ -13,7 +13,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ExternalShortcut { @@ -401,22 +400,22 @@ public boolean equals(java.lang.Object o) { } ExternalShortcut other = (ExternalShortcut) o; return - Objects.deepEquals(this.inputAlias, other.inputAlias) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.destinationUrl, other.destinationUrl) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.intermediateUrl, other.intermediateUrl) && - Objects.deepEquals(this.decayedVisitScore, other.decayedVisitScore) && - Objects.deepEquals(this.editUrl, other.editUrl); + Utils.enhancedDeepEquals(this.inputAlias, other.inputAlias) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.destinationUrl, other.destinationUrl) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.intermediateUrl, other.intermediateUrl) && + Utils.enhancedDeepEquals(this.decayedVisitScore, other.decayedVisitScore) && + Utils.enhancedDeepEquals(this.editUrl, other.editUrl); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( inputAlias, description, destinationUrl, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ExtractedQnA.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExtractedQnA.java index 471f2355..f7e9388a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ExtractedQnA.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExtractedQnA.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ExtractedQnA { @@ -137,14 +136,14 @@ public boolean equals(java.lang.Object o) { } ExtractedQnA other = (ExtractedQnA) o; return - Objects.deepEquals(this.heading, other.heading) && - Objects.deepEquals(this.question, other.question) && - Objects.deepEquals(this.questionResult, other.questionResult); + Utils.enhancedDeepEquals(this.heading, other.heading) && + Utils.enhancedDeepEquals(this.question, other.question) && + Utils.enhancedDeepEquals(this.questionResult, other.questionResult); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( heading, question, questionResult); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucket.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucket.java index 2319b08a..5ab11332 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucket.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucket.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class FacetBucket { @@ -174,15 +173,15 @@ public boolean equals(java.lang.Object o) { } FacetBucket other = (FacetBucket) o; return - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.percentage, other.percentage) && - Objects.deepEquals(this.value, other.value); + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.percentage, other.percentage) && + Utils.enhancedDeepEquals(this.value, other.value); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( count, datasource, percentage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucketFilter.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucketFilter.java index e7751b4e..a699c678 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucketFilter.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetBucketFilter.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class FacetBucketFilter { @@ -111,13 +110,13 @@ public boolean equals(java.lang.Object o) { } FacetBucketFilter other = (FacetBucketFilter) o; return - Objects.deepEquals(this.facet, other.facet) && - Objects.deepEquals(this.prefix, other.prefix); + Utils.enhancedDeepEquals(this.facet, other.facet) && + Utils.enhancedDeepEquals(this.prefix, other.prefix); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( facet, prefix); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilter.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilter.java index f5850aa7..5d44637f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilter.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilter.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class FacetFilter { @@ -138,14 +137,14 @@ public boolean equals(java.lang.Object o) { } FacetFilter other = (FacetFilter) o; return - Objects.deepEquals(this.fieldName, other.fieldName) && - Objects.deepEquals(this.values, other.values) && - Objects.deepEquals(this.groupName, other.groupName); + Utils.enhancedDeepEquals(this.fieldName, other.fieldName) && + Utils.enhancedDeepEquals(this.values, other.values) && + Utils.enhancedDeepEquals(this.groupName, other.groupName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( fieldName, values, groupName); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterSet.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterSet.java index 21086529..01352e8b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterSet.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterSet.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -71,12 +70,12 @@ public boolean equals(java.lang.Object o) { } FacetFilterSet other = (FacetFilterSet) o; return - Objects.deepEquals(this.filters, other.filters); + Utils.enhancedDeepEquals(this.filters, other.filters); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( filters); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterValue.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterValue.java index 2b61328b..2e5f4cdc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterValue.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetFilterValue.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class FacetFilterValue { @@ -139,14 +138,14 @@ public boolean equals(java.lang.Object o) { } FacetFilterValue other = (FacetFilterValue) o; return - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.relationType, other.relationType) && - Objects.deepEquals(this.isNegated, other.isNegated); + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.relationType, other.relationType) && + Utils.enhancedDeepEquals(this.isNegated, other.isNegated); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( value, relationType, isNegated); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetResult.java index 2953fba0..4f9539d5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetResult.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class FacetResult { @@ -223,16 +222,16 @@ public boolean equals(java.lang.Object o) { } FacetResult other = (FacetResult) o; return - Objects.deepEquals(this.sourceName, other.sourceName) && - Objects.deepEquals(this.operatorName, other.operatorName) && - Objects.deepEquals(this.buckets, other.buckets) && - Objects.deepEquals(this.hasMoreBuckets, other.hasMoreBuckets) && - Objects.deepEquals(this.groupName, other.groupName); + Utils.enhancedDeepEquals(this.sourceName, other.sourceName) && + Utils.enhancedDeepEquals(this.operatorName, other.operatorName) && + Utils.enhancedDeepEquals(this.buckets, other.buckets) && + Utils.enhancedDeepEquals(this.hasMoreBuckets, other.hasMoreBuckets) && + Utils.enhancedDeepEquals(this.groupName, other.groupName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( sourceName, operatorName, buckets, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetValue.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetValue.java index 46c3d7ba..4a2e4421 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetValue.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FacetValue.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class FacetValue { @@ -174,15 +173,15 @@ public boolean equals(java.lang.Object o) { } FacetValue other = (FacetValue) o; return - Objects.deepEquals(this.stringValue, other.stringValue) && - Objects.deepEquals(this.integerValue, other.integerValue) && - Objects.deepEquals(this.displayLabel, other.displayLabel) && - Objects.deepEquals(this.iconConfig, other.iconConfig); + Utils.enhancedDeepEquals(this.stringValue, other.stringValue) && + Utils.enhancedDeepEquals(this.integerValue, other.integerValue) && + Utils.enhancedDeepEquals(this.displayLabel, other.displayLabel) && + Utils.enhancedDeepEquals(this.iconConfig, other.iconConfig); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( stringValue, integerValue, displayLabel, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FavoriteInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FavoriteInfo.java index a79f5f21..d68166bf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FavoriteInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FavoriteInfo.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class FavoriteInfo { @@ -175,15 +174,15 @@ public boolean equals(java.lang.Object o) { } FavoriteInfo other = (FavoriteInfo) o; return - Objects.deepEquals(this.ugcType, other.ugcType) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.favoritedByUser, other.favoritedByUser); + Utils.enhancedDeepEquals(this.ugcType, other.ugcType) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.favoritedByUser, other.favoritedByUser); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ugcType, id, count, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedEntry.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedEntry.java index dc4baf39..6846745d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedEntry.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedEntry.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class FeedEntry { @@ -611,31 +610,31 @@ public boolean equals(java.lang.Object o) { } FeedEntry other = (FeedEntry) o; return - Objects.deepEquals(this.entryId, other.entryId) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.uiConfig, other.uiConfig) && - Objects.deepEquals(this.justificationType, other.justificationType) && - Objects.deepEquals(this.justification, other.justification) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.viewUrl, other.viewUrl) && - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.event, other.event) && - Objects.deepEquals(this.announcement, other.announcement) && - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.collectionItem, other.collectionItem) && - Objects.deepEquals(this.person, other.person) && - Objects.deepEquals(this.app, other.app) && - Objects.deepEquals(this.promptTemplate, other.promptTemplate) && - Objects.deepEquals(this.workflow, other.workflow) && - Objects.deepEquals(this.activities, other.activities) && - Objects.deepEquals(this.documentVisitorCount, other.documentVisitorCount); + Utils.enhancedDeepEquals(this.entryId, other.entryId) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.uiConfig, other.uiConfig) && + Utils.enhancedDeepEquals(this.justificationType, other.justificationType) && + Utils.enhancedDeepEquals(this.justification, other.justification) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.viewUrl, other.viewUrl) && + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.event, other.event) && + Utils.enhancedDeepEquals(this.announcement, other.announcement) && + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.collectionItem, other.collectionItem) && + Utils.enhancedDeepEquals(this.person, other.person) && + Utils.enhancedDeepEquals(this.app, other.app) && + Utils.enhancedDeepEquals(this.promptTemplate, other.promptTemplate) && + Utils.enhancedDeepEquals(this.workflow, other.workflow) && + Utils.enhancedDeepEquals(this.activities, other.activities) && + Utils.enhancedDeepEquals(this.documentVisitorCount, other.documentVisitorCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( entryId, title, thumbnail, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequest.java index 9313a371..6155bb5c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class FeedRequest { @@ -165,15 +164,15 @@ public boolean equals(java.lang.Object o) { } FeedRequest other = (FeedRequest) o; return - Objects.deepEquals(this.categories, other.categories) && - Objects.deepEquals(this.requestOptions, other.requestOptions) && - Objects.deepEquals(this.timeoutMillis, other.timeoutMillis) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo); + Utils.enhancedDeepEquals(this.categories, other.categories) && + Utils.enhancedDeepEquals(this.requestOptions, other.requestOptions) && + Utils.enhancedDeepEquals(this.timeoutMillis, other.timeoutMillis) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( categories, requestOptions, timeoutMillis, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java index b5db6569..61961557 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java @@ -24,6 +24,7 @@ public enum FeedRequestCategory { DISPLAYABLE_LIST("DISPLAYABLE_LIST"), SOCIAL_LINK("SOCIAL_LINK"), EXTERNAL_TASKS("EXTERNAL_TASKS"), + WORKFLOW_COLLECTIONS("WORKFLOW_COLLECTIONS"), ZERO_STATE_CHAT_SUGGESTION("ZERO_STATE_CHAT_SUGGESTION"), ZERO_STATE_CHAT_TOOL_SUGGESTION("ZERO_STATE_CHAT_TOOL_SUGGESTION"), ZERO_STATE_WORKFLOW_CREATED_BY_ME("ZERO_STATE_WORKFLOW_CREATED_BY_ME"), @@ -34,7 +35,7 @@ public enum FeedRequestCategory { @JsonValue private final String value; - private FeedRequestCategory(String value) { + FeedRequestCategory(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestOptions.java index 8a937fc3..1b29dcca 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestOptions.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class FeedRequestOptions { @@ -205,16 +204,16 @@ public boolean equals(java.lang.Object o) { } FeedRequestOptions other = (FeedRequestOptions) o; return - Objects.deepEquals(this.resultSize, other.resultSize) && - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.categoryToResultSize, other.categoryToResultSize) && - Objects.deepEquals(this.datasourceFilter, other.datasourceFilter) && - Objects.deepEquals(this.chatZeroStateSuggestionOptions, other.chatZeroStateSuggestionOptions); + Utils.enhancedDeepEquals(this.resultSize, other.resultSize) && + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.categoryToResultSize, other.categoryToResultSize) && + Utils.enhancedDeepEquals(this.datasourceFilter, other.datasourceFilter) && + Utils.enhancedDeepEquals(this.chatZeroStateSuggestionOptions, other.chatZeroStateSuggestionOptions); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( resultSize, timezoneOffset, categoryToResultSize, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResponse.java index d9094f10..1a527015 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResponse.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class FeedResponse { @@ -241,17 +240,17 @@ public boolean equals(java.lang.Object o) { } FeedResponse other = (FeedResponse) o; return - Objects.deepEquals(this.experimentIds, other.experimentIds) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.serverTimestamp, other.serverTimestamp) && - Objects.deepEquals(this.results, other.results) && - Objects.deepEquals(this.facetResults, other.facetResults) && - Objects.deepEquals(this.mentionsTimeWindowInHours, other.mentionsTimeWindowInHours); + Utils.enhancedDeepEquals(this.experimentIds, other.experimentIds) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.serverTimestamp, other.serverTimestamp) && + Utils.enhancedDeepEquals(this.results, other.results) && + Utils.enhancedDeepEquals(this.facetResults, other.facetResults) && + Utils.enhancedDeepEquals(this.mentionsTimeWindowInHours, other.mentionsTimeWindowInHours); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( experimentIds, trackingToken, serverTimestamp, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResult.java index fe77265a..b863c9ed 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResult.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class FeedResult { @@ -160,15 +159,15 @@ public boolean equals(java.lang.Object o) { } FeedResult other = (FeedResult) o; return - Objects.deepEquals(this.category, other.category) && - Objects.deepEquals(this.primaryEntry, other.primaryEntry) && - Objects.deepEquals(this.secondaryEntries, other.secondaryEntries) && - Objects.deepEquals(this.rank, other.rank); + Utils.enhancedDeepEquals(this.category, other.category) && + Utils.enhancedDeepEquals(this.primaryEntry, other.primaryEntry) && + Utils.enhancedDeepEquals(this.secondaryEntries, other.secondaryEntries) && + Utils.enhancedDeepEquals(this.rank, other.rank); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( category, primaryEntry, secondaryEntries, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java index de21455c..35278380 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java @@ -40,7 +40,7 @@ public enum FeedResultCategory { @JsonValue private final String value; - private FeedResultCategory(String value) { + FeedResultCategory(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Feedback.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Feedback.java index 4c43f17b..350ae5ad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Feedback.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Feedback.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Feedback { @@ -682,31 +681,31 @@ public boolean equals(java.lang.Object o) { } Feedback other = (Feedback) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.category, other.category) && - Objects.deepEquals(this.trackingTokens, other.trackingTokens) && - Objects.deepEquals(this.event, other.event) && - Objects.deepEquals(this.position, other.position) && - Objects.deepEquals(this.payload, other.payload) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.timestamp, other.timestamp) && - Objects.deepEquals(this.user, other.user) && - Objects.deepEquals(this.pathname, other.pathname) && - Objects.deepEquals(this.channels, other.channels) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.uiTree, other.uiTree) && - Objects.deepEquals(this.uiElement, other.uiElement) && - Objects.deepEquals(this.manualFeedbackInfo, other.manualFeedbackInfo) && - Objects.deepEquals(this.seenFeedbackInfo, other.seenFeedbackInfo) && - Objects.deepEquals(this.userViewInfo, other.userViewInfo) && - Objects.deepEquals(this.workflowFeedbackInfo, other.workflowFeedbackInfo) && - Objects.deepEquals(this.applicationId, other.applicationId) && - Objects.deepEquals(this.agentId, other.agentId); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.category, other.category) && + Utils.enhancedDeepEquals(this.trackingTokens, other.trackingTokens) && + Utils.enhancedDeepEquals(this.event, other.event) && + Utils.enhancedDeepEquals(this.position, other.position) && + Utils.enhancedDeepEquals(this.payload, other.payload) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.timestamp, other.timestamp) && + Utils.enhancedDeepEquals(this.user, other.user) && + Utils.enhancedDeepEquals(this.pathname, other.pathname) && + Utils.enhancedDeepEquals(this.channels, other.channels) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.uiTree, other.uiTree) && + Utils.enhancedDeepEquals(this.uiElement, other.uiElement) && + Utils.enhancedDeepEquals(this.manualFeedbackInfo, other.manualFeedbackInfo) && + Utils.enhancedDeepEquals(this.seenFeedbackInfo, other.seenFeedbackInfo) && + Utils.enhancedDeepEquals(this.userViewInfo, other.userViewInfo) && + Utils.enhancedDeepEquals(this.workflowFeedbackInfo, other.workflowFeedbackInfo) && + Utils.enhancedDeepEquals(this.applicationId, other.applicationId) && + Utils.enhancedDeepEquals(this.agentId, other.agentId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, category, trackingTokens, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackCategory.java index 6bf942ea..29e3bb91 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackCategory.java @@ -29,7 +29,7 @@ public enum FeedbackCategory { @JsonValue private final String value; - private FeedbackCategory(String value) { + FeedbackCategory(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChannel.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChannel.java index 406fcf4f..9f8e8ab6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChannel.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChannel.java @@ -15,7 +15,7 @@ public enum FeedbackChannel { @JsonValue private final String value; - private FeedbackChannel(String value) { + FeedbackChannel(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChatExchange.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChatExchange.java index e9818250..c059bc76 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChatExchange.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedbackChatExchange.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class FeedbackChatExchange { @@ -247,17 +246,17 @@ public boolean equals(java.lang.Object o) { } FeedbackChatExchange other = (FeedbackChatExchange) o; return - Objects.deepEquals(this.timestamp, other.timestamp) && - Objects.deepEquals(this.agent, other.agent) && - Objects.deepEquals(this.userQuery, other.userQuery) && - Objects.deepEquals(this.searchQuery, other.searchQuery) && - Objects.deepEquals(this.resultDocuments, other.resultDocuments) && - Objects.deepEquals(this.response, other.response); + Utils.enhancedDeepEquals(this.timestamp, other.timestamp) && + Utils.enhancedDeepEquals(this.agent, other.agent) && + Utils.enhancedDeepEquals(this.userQuery, other.userQuery) && + Utils.enhancedDeepEquals(this.searchQuery, other.searchQuery) && + Utils.enhancedDeepEquals(this.resultDocuments, other.resultDocuments) && + Utils.enhancedDeepEquals(this.response, other.response); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timestamp, agent, userQuery, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/File.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/File.java index d55b2951..9a01a722 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/File.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/File.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class File { @@ -66,13 +65,13 @@ public boolean equals(java.lang.Object o) { } File other = (File) o; return - Objects.deepEquals(this.fileName, other.fileName) && - Objects.deepEquals(this.content, other.content); + Utils.enhancedDeepEquals(this.fileName, other.fileName) && + Utils.enhancedDeepEquals(this.content, other.content); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( fileName, content); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FollowupAction.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FollowupAction.java index 69242903..36bf1167 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FollowupAction.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FollowupAction.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -261,17 +260,17 @@ public boolean equals(java.lang.Object o) { } FollowupAction other = (FollowupAction) o; return - Objects.deepEquals(this.actionRunId, other.actionRunId) && - Objects.deepEquals(this.actionInstanceId, other.actionInstanceId) && - Objects.deepEquals(this.actionId, other.actionId) && - Objects.deepEquals(this.recommendationText, other.recommendationText) && - Objects.deepEquals(this.actionLabel, other.actionLabel) && - Objects.deepEquals(this.userConfirmationRequired, other.userConfirmationRequired); + Utils.enhancedDeepEquals(this.actionRunId, other.actionRunId) && + Utils.enhancedDeepEquals(this.actionInstanceId, other.actionInstanceId) && + Utils.enhancedDeepEquals(this.actionId, other.actionId) && + Utils.enhancedDeepEquals(this.recommendationText, other.recommendationText) && + Utils.enhancedDeepEquals(this.actionLabel, other.actionLabel) && + Utils.enhancedDeepEquals(this.userConfirmationRequired, other.userConfirmationRequired); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( actionRunId, actionInstanceId, actionId, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Format.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Format.java index 866e3414..f753a7f9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Format.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Format.java @@ -19,7 +19,7 @@ public enum Format { @JsonValue private final String value; - private Format(String value) { + Format(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachment.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachment.java index afee36f7..84a37d8c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachment.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachment.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -220,17 +219,17 @@ public boolean equals(java.lang.Object o) { } GeneratedAttachment other = (GeneratedAttachment) o; return - Objects.deepEquals(this.strategyName, other.strategyName) && - Objects.deepEquals(this.documents, other.documents) && - Objects.deepEquals(this.person, other.person) && - Objects.deepEquals(this.customer, other.customer) && - Objects.deepEquals(this.externalLinks, other.externalLinks) && - Objects.deepEquals(this.content, other.content); + Utils.enhancedDeepEquals(this.strategyName, other.strategyName) && + Utils.enhancedDeepEquals(this.documents, other.documents) && + Utils.enhancedDeepEquals(this.person, other.person) && + Utils.enhancedDeepEquals(this.customer, other.customer) && + Utils.enhancedDeepEquals(this.externalLinks, other.externalLinks) && + Utils.enhancedDeepEquals(this.content, other.content); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( strategyName, documents, person, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachmentContent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachmentContent.java index 3075c448..c7840ef9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachmentContent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedAttachmentContent.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -116,13 +115,13 @@ public boolean equals(java.lang.Object o) { } GeneratedAttachmentContent other = (GeneratedAttachmentContent) o; return - Objects.deepEquals(this.displayHeader, other.displayHeader) && - Objects.deepEquals(this.text, other.text); + Utils.enhancedDeepEquals(this.displayHeader, other.displayHeader) && + Utils.enhancedDeepEquals(this.text, other.text); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( displayHeader, text); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQna.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQna.java index 5279cfe2..187b2a00 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQna.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQna.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GeneratedQna { @@ -333,19 +332,19 @@ public boolean equals(java.lang.Object o) { } GeneratedQna other = (GeneratedQna) o; return - Objects.deepEquals(this.question, other.question) && - Objects.deepEquals(this.answer, other.answer) && - Objects.deepEquals(this.followUpPrompts, other.followUpPrompts) && - Objects.deepEquals(this.followupActions, other.followupActions) && - Objects.deepEquals(this.ranges, other.ranges) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.cursor, other.cursor) && - Objects.deepEquals(this.trackingToken, other.trackingToken); + Utils.enhancedDeepEquals(this.question, other.question) && + Utils.enhancedDeepEquals(this.answer, other.answer) && + Utils.enhancedDeepEquals(this.followUpPrompts, other.followUpPrompts) && + Utils.enhancedDeepEquals(this.followupActions, other.followupActions) && + Utils.enhancedDeepEquals(this.ranges, other.ranges) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( question, answer, followUpPrompts, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQnaStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQnaStatus.java index 7b1af4b6..4d5e0c6a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQnaStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GeneratedQnaStatus.java @@ -26,7 +26,7 @@ public enum GeneratedQnaStatus { @JsonValue private final String value; - private GeneratedQnaStatus(String value) { + GeneratedQnaStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerError.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerError.java index b203aa65..42a8eebc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerError.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetAnswerError { @@ -90,13 +89,13 @@ public boolean equals(java.lang.Object o) { } GetAnswerError other = (GetAnswerError) o; return - Objects.deepEquals(this.errorType, other.errorType) && - Objects.deepEquals(this.answerAuthor, other.answerAuthor); + Utils.enhancedDeepEquals(this.errorType, other.errorType) && + Utils.enhancedDeepEquals(this.answerAuthor, other.answerAuthor); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( errorType, answerAuthor); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerErrorErrorType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerErrorErrorType.java index c5f017c9..ba300415 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerErrorErrorType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerErrorErrorType.java @@ -15,7 +15,7 @@ public enum GetAnswerErrorErrorType { @JsonValue private final String value; - private GetAnswerErrorErrorType(String value) { + GetAnswerErrorErrorType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerRequest.java index b0d52a06..76b38bfa 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetAnswerRequest { @@ -112,13 +111,13 @@ public boolean equals(java.lang.Object o) { } GetAnswerRequest other = (GetAnswerRequest) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.docId, other.docId); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.docId, other.docId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, docId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerResponse.java index c8ed5c73..0d19c193 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetAnswerResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetAnswerResponse { @@ -90,13 +89,13 @@ public boolean equals(java.lang.Object o) { } GetAnswerResponse other = (GetAnswerResponse) o; return - Objects.deepEquals(this.answerResult, other.answerResult) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.answerResult, other.answerResult) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( answerResult, error); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationRequest.java index f6a4e869..09b6a2b5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class GetChatApplicationRequest { @@ -58,12 +57,12 @@ public boolean equals(java.lang.Object o) { } GetChatApplicationRequest other = (GetChatApplicationRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationResponse.java index 837534a3..6611c71c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatApplicationResponse.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetChatApplicationResponse { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } GetChatApplicationResponse other = (GetChatApplicationResponse) o; return - Objects.deepEquals(this.application, other.application); + Utils.enhancedDeepEquals(this.application, other.application); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( application); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesRequest.java index f4c7e3f9..cb3e0947 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesRequest.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class GetChatFilesRequest { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } GetChatFilesRequest other = (GetChatFilesRequest) o; return - Objects.deepEquals(this.fileIds, other.fileIds); + Utils.enhancedDeepEquals(this.fileIds, other.fileIds); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( fileIds); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesResponse.java index 62187d95..24ae5821 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatFilesResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class GetChatFilesResponse { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } GetChatFilesResponse other = (GetChatFilesResponse) o; return - Objects.deepEquals(this.files, other.files); + Utils.enhancedDeepEquals(this.files, other.files); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( files); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatRequest.java index 75a78e2e..40f53445 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class GetChatRequest { @@ -58,12 +57,12 @@ public boolean equals(java.lang.Object o) { } GetChatRequest other = (GetChatRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatResponse.java index 9498ccda..392fe10d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetChatResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetChatResponse { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } GetChatResponse other = (GetChatResponse) o; return - Objects.deepEquals(this.chatResult, other.chatResult); + Utils.enhancedDeepEquals(this.chatResult, other.chatResult); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( chatResult); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionRequest.java index d2c0f62a..372b31be 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionRequest.java @@ -13,7 +13,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetCollectionRequest { @@ -176,15 +175,15 @@ public boolean equals(java.lang.Object o) { } GetCollectionRequest other = (GetCollectionRequest) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.withItems, other.withItems) && - Objects.deepEquals(this.withHierarchy, other.withHierarchy) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.withItems, other.withItems) && + Utils.enhancedDeepEquals(this.withHierarchy, other.withHierarchy) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, withItems, withHierarchy, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionResponse.java index 5dcf7369..9eaee25f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetCollectionResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetCollectionResponse { @@ -151,15 +150,15 @@ public boolean equals(java.lang.Object o) { } GetCollectionResponse other = (GetCollectionResponse) o; return - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.rootCollection, other.rootCollection) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.rootCollection, other.rootCollection) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( collection, rootCollection, trackingToken, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDatasourceConfigRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDatasourceConfigRequest.java index 21251f6d..f06b4edd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDatasourceConfigRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDatasourceConfigRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetDatasourceConfigRequest @@ -63,12 +62,12 @@ public boolean equals(java.lang.Object o) { } GetDatasourceConfigRequest other = (GetDatasourceConfigRequest) o; return - Objects.deepEquals(this.datasource, other.datasource); + Utils.enhancedDeepEquals(this.datasource, other.datasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDlpReportResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDlpReportResponse.java index 8d94f33e..66e5cf48 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDlpReportResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDlpReportResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetDlpReportResponse { @@ -77,12 +76,12 @@ public boolean equals(java.lang.Object o) { } GetDlpReportResponse other = (GetDlpReportResponse) o; return - Objects.deepEquals(this.report, other.report); + Utils.enhancedDeepEquals(this.report, other.report); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( report); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsRequest.java index 62b50792..ba374ef2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsRequest.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetDocPermissionsRequest { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } GetDocPermissionsRequest other = (GetDocPermissionsRequest) o; return - Objects.deepEquals(this.documentId, other.documentId); + Utils.enhancedDeepEquals(this.documentId, other.documentId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documentId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsResponse.java index 3b607380..ea85d993 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocPermissionsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GetDocPermissionsResponse { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } GetDocPermissionsResponse other = (GetDocPermissionsResponse) o; return - Objects.deepEquals(this.allowedUserEmails, other.allowedUserEmails); + Utils.enhancedDeepEquals(this.allowedUserEmails, other.allowedUserEmails); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( allowedUserEmails); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountRequest.java index 68d7d0f1..d1dc5eaf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetDocumentCountRequest @@ -63,12 +62,12 @@ public boolean equals(java.lang.Object o) { } GetDocumentCountRequest other = (GetDocumentCountRequest) o; return - Objects.deepEquals(this.datasource, other.datasource); + Utils.enhancedDeepEquals(this.datasource, other.datasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountResponse.java index d1e95961..5df6f86f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentCountResponse.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -81,12 +80,12 @@ public boolean equals(java.lang.Object o) { } GetDocumentCountResponse other = (GetDocumentCountResponse) o; return - Objects.deepEquals(this.documentCount, other.documentCount); + Utils.enhancedDeepEquals(this.documentCount, other.documentCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documentCount); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusRequest.java index 001530e0..169714b2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetDocumentStatusRequest @@ -115,14 +114,14 @@ public boolean equals(java.lang.Object o) { } GetDocumentStatusRequest other = (GetDocumentStatusRequest) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.docId, other.docId); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.docId, other.docId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, objectType, docId); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusResponse.java index ddfff944..006ef009 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentStatusResponse.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -189,15 +188,15 @@ public boolean equals(java.lang.Object o) { } GetDocumentStatusResponse other = (GetDocumentStatusResponse) o; return - Objects.deepEquals(this.uploadStatus, other.uploadStatus) && - Objects.deepEquals(this.lastUploadedAt, other.lastUploadedAt) && - Objects.deepEquals(this.indexingStatus, other.indexingStatus) && - Objects.deepEquals(this.lastIndexedAt, other.lastIndexedAt); + Utils.enhancedDeepEquals(this.uploadStatus, other.uploadStatus) && + Utils.enhancedDeepEquals(this.lastUploadedAt, other.lastUploadedAt) && + Utils.enhancedDeepEquals(this.indexingStatus, other.indexingStatus) && + Utils.enhancedDeepEquals(this.lastIndexedAt, other.lastIndexedAt); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadStatus, lastUploadedAt, indexingStatus, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentVisibilityOverridesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentVisibilityOverridesResponse.java index eda9969a..34c73cc0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentVisibilityOverridesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentVisibilityOverridesResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GetDocumentVisibilityOverridesResponse { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } GetDocumentVisibilityOverridesResponse other = (GetDocumentVisibilityOverridesResponse) o; return - Objects.deepEquals(this.visibilityOverrides, other.visibilityOverrides); + Utils.enhancedDeepEquals(this.visibilityOverrides, other.visibilityOverrides); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( visibilityOverrides); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsRequest.java index 6c968aaf..e9bc9fde 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsRequest.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GetDocumentsByFacetsRequest { @@ -141,14 +140,14 @@ public boolean equals(java.lang.Object o) { } GetDocumentsByFacetsRequest other = (GetDocumentsByFacetsRequest) o; return - Objects.deepEquals(this.datasourcesFilter, other.datasourcesFilter) && - Objects.deepEquals(this.filterSets, other.filterSets) && - Objects.deepEquals(this.cursor, other.cursor); + Utils.enhancedDeepEquals(this.datasourcesFilter, other.datasourcesFilter) && + Utils.enhancedDeepEquals(this.filterSets, other.filterSets) && + Utils.enhancedDeepEquals(this.cursor, other.cursor); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasourcesFilter, filterSets, cursor); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsResponse.java index 7081a4b4..6915df44 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsByFacetsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GetDocumentsByFacetsResponse { @@ -151,14 +150,14 @@ public boolean equals(java.lang.Object o) { } GetDocumentsByFacetsResponse other = (GetDocumentsByFacetsResponse) o; return - Objects.deepEquals(this.documents, other.documents) && - Objects.deepEquals(this.hasMoreResults, other.hasMoreResults) && - Objects.deepEquals(this.cursor, other.cursor); + Utils.enhancedDeepEquals(this.documents, other.documents) && + Utils.enhancedDeepEquals(this.hasMoreResults, other.hasMoreResults) && + Utils.enhancedDeepEquals(this.cursor, other.cursor); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documents, hasMoreResults, cursor); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequest.java index 92e06fd9..382dcee4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequest.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GetDocumentsRequest { @@ -105,13 +104,13 @@ public boolean equals(java.lang.Object o) { } GetDocumentsRequest other = (GetDocumentsRequest) o; return - Objects.deepEquals(this.documentSpecs, other.documentSpecs) && - Objects.deepEquals(this.includeFields, other.includeFields); + Utils.enhancedDeepEquals(this.documentSpecs, other.documentSpecs) && + Utils.enhancedDeepEquals(this.includeFields, other.includeFields); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documentSpecs, includeFields); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequestIncludeField.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequestIncludeField.java index a624439e..7513b437 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequestIncludeField.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsRequestIncludeField.java @@ -17,7 +17,7 @@ public enum GetDocumentsRequestIncludeField { @JsonValue private final String value; - private GetDocumentsRequestIncludeField(String value) { + GetDocumentsRequestIncludeField(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsResponse.java index 3f219a04..d67f7994 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetDocumentsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class GetDocumentsResponse { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } GetDocumentsResponse other = (GetDocumentsResponse) o; return - Objects.deepEquals(this.documents, other.documents); + Utils.enhancedDeepEquals(this.documents, other.documents); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documents); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinRequest.java index 2ab44f4a..63143821 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinRequest.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetPinRequest { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } GetPinRequest other = (GetPinRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinResponse.java index f4afa520..03e066ee 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetPinResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetPinResponse { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } GetPinResponse other = (GetPinResponse) o; return - Objects.deepEquals(this.pin, other.pin); + Utils.enhancedDeepEquals(this.pin, other.pin); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( pin); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequest.java index c59d4a16..7103cfc0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class GetShortcutRequest { @@ -58,12 +57,12 @@ public boolean equals(java.lang.Object o) { } GetShortcutRequest other = (GetShortcutRequest) o; return - Objects.deepEquals(this.alias, other.alias); + Utils.enhancedDeepEquals(this.alias, other.alias); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( alias); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequestUnion.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequestUnion.java index 3aa753dd..11a8db2f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequestUnion.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutRequestUnion.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; @JsonDeserialize(using = GetShortcutRequestUnion._Deserializer.class) public class GetShortcutRequestUnion { @@ -67,12 +66,12 @@ public boolean equals(java.lang.Object o) { return false; } GetShortcutRequestUnion other = (GetShortcutRequestUnion) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutResponse.java index 25858102..acf8f0eb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetShortcutResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class GetShortcutResponse { @@ -90,13 +89,13 @@ public boolean equals(java.lang.Object o) { } GetShortcutResponse other = (GetShortcutResponse) o; return - Objects.deepEquals(this.shortcut, other.shortcut) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.shortcut, other.shortcut) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( shortcut, error); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountRequest.java index 7894116d..a2a9e9c2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetUserCountRequest @@ -63,12 +62,12 @@ public boolean equals(java.lang.Object o) { } GetUserCountRequest other = (GetUserCountRequest) o; return - Objects.deepEquals(this.datasource, other.datasource); + Utils.enhancedDeepEquals(this.datasource, other.datasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountResponse.java index a5a951de..933488da 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GetUserCountResponse.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -81,12 +80,12 @@ public boolean equals(java.lang.Object o) { } GetUserCountResponse other = (GetUserCountResponse) o; return - Objects.deepEquals(this.userCount, other.userCount); + Utils.enhancedDeepEquals(this.userCount, other.userCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( userCount); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanAssistInsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanAssistInsightsResponse.java index 09c5e0e0..b4fbddef 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanAssistInsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanAssistInsightsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GleanAssistInsightsResponse { @@ -225,16 +224,16 @@ public boolean equals(java.lang.Object o) { } GleanAssistInsightsResponse other = (GleanAssistInsightsResponse) o; return - Objects.deepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && - Objects.deepEquals(this.activityInsights, other.activityInsights) && - Objects.deepEquals(this.totalActiveUsers, other.totalActiveUsers) && - Objects.deepEquals(this.datasourceInstances, other.datasourceInstances) && - Objects.deepEquals(this.departments, other.departments); + Utils.enhancedDeepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && + Utils.enhancedDeepEquals(this.activityInsights, other.activityInsights) && + Utils.enhancedDeepEquals(this.totalActiveUsers, other.totalActiveUsers) && + Utils.enhancedDeepEquals(this.datasourceInstances, other.datasourceInstances) && + Utils.enhancedDeepEquals(this.departments, other.departments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastLogTimestamp, activityInsights, totalActiveUsers, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanDataError.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanDataError.java index e9cfbd69..c7043a70 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanDataError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GleanDataError.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GleanDataError { @@ -176,15 +175,15 @@ public boolean equals(java.lang.Object o) { } GleanDataError other = (GleanDataError) o; return - Objects.deepEquals(this.badGmailToken, other.badGmailToken) && - Objects.deepEquals(this.badOutlookToken, other.badOutlookToken) && - Objects.deepEquals(this.invalidOperators, other.invalidOperators) && - Objects.deepEquals(this.errorMessages, other.errorMessages); + Utils.enhancedDeepEquals(this.badGmailToken, other.badGmailToken) && + Utils.enhancedDeepEquals(this.badOutlookToken, other.badOutlookToken) && + Utils.enhancedDeepEquals(this.invalidOperators, other.invalidOperators) && + Utils.enhancedDeepEquals(this.errorMessages, other.errorMessages); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( badGmailToken, badOutlookToken, invalidOperators, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantPermission.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantPermission.java index af2f6159..4f91e2ec 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantPermission.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantPermission.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -82,12 +81,12 @@ public boolean equals(java.lang.Object o) { } GrantPermission other = (GrantPermission) o; return - Objects.deepEquals(this.scopeType, other.scopeType); + Utils.enhancedDeepEquals(this.scopeType, other.scopeType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( scopeType); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantType.java index e60407d7..909ef647 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GrantType.java @@ -20,7 +20,7 @@ public enum GrantType { @JsonValue private final String value; - private GrantType(String value) { + GrantType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GreenlistUsersRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GreenlistUsersRequest.java index 4aeb0718..05b5afe4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GreenlistUsersRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GreenlistUsersRequest.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; /** * GreenlistUsersRequest @@ -90,13 +89,13 @@ public boolean equals(java.lang.Object o) { } GreenlistUsersRequest other = (GreenlistUsersRequest) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.emails, other.emails); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.emails, other.emails); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, emails); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Group.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Group.java index 22c95043..4bdf426f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Group.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Group.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class Group { @@ -129,14 +128,14 @@ public boolean equals(java.lang.Object o) { } Group other = (Group) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( type, id, name); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/GroupType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/GroupType.java index 4a71dc6b..7418cffc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/GroupType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/GroupType.java @@ -26,7 +26,7 @@ public enum GroupType { @JsonValue private final String value; - private GroupType(String value) { + GroupType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/HideBuiltInFacet.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/HideBuiltInFacet.java index 825aed62..0db873d9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/HideBuiltInFacet.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/HideBuiltInFacet.java @@ -17,7 +17,7 @@ public enum HideBuiltInFacet { @JsonValue private final String value; - private HideBuiltInFacet(String value) { + HideBuiltInFacet(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Hotword.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Hotword.java index 58e4750a..7dbd2b1e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Hotword.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Hotword.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class Hotword { @@ -89,13 +88,13 @@ public boolean equals(java.lang.Object o) { } Hotword other = (Hotword) o; return - Objects.deepEquals(this.regex, other.regex) && - Objects.deepEquals(this.proximity, other.proximity); + Utils.enhancedDeepEquals(this.regex, other.regex) && + Utils.enhancedDeepEquals(this.proximity, other.proximity); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( regex, proximity); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/HotwordProximity.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/HotwordProximity.java index 8561a7f5..6e52fe53 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/HotwordProximity.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/HotwordProximity.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class HotwordProximity { @@ -88,13 +87,13 @@ public boolean equals(java.lang.Object o) { } HotwordProximity other = (HotwordProximity) o; return - Objects.deepEquals(this.windowBefore, other.windowBefore) && - Objects.deepEquals(this.windowAfter, other.windowAfter); + Utils.enhancedDeepEquals(this.windowBefore, other.windowBefore) && + Utils.enhancedDeepEquals(this.windowAfter, other.windowAfter); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( windowBefore, windowAfter); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IconConfig.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IconConfig.java index 8bdc5459..85e83a19 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IconConfig.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IconConfig.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -275,19 +274,19 @@ public boolean equals(java.lang.Object o) { } IconConfig other = (IconConfig) o; return - Objects.deepEquals(this.generatedBackgroundColorKey, other.generatedBackgroundColorKey) && - Objects.deepEquals(this.backgroundColor, other.backgroundColor) && - Objects.deepEquals(this.color, other.color) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.iconType, other.iconType) && - Objects.deepEquals(this.masked, other.masked) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.generatedBackgroundColorKey, other.generatedBackgroundColorKey) && + Utils.enhancedDeepEquals(this.backgroundColor, other.backgroundColor) && + Utils.enhancedDeepEquals(this.color, other.color) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.iconType, other.iconType) && + Utils.enhancedDeepEquals(this.masked, other.masked) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( generatedBackgroundColorKey, backgroundColor, color, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IconType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IconType.java index 03cde04d..965456d3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IconType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IconType.java @@ -26,7 +26,7 @@ public enum IconType { @JsonValue private final String value; - private IconType(String value) { + IconType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IdType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IdType.java index 5ad42a75..7a5b7a47 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IdType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IdType.java @@ -21,7 +21,7 @@ public enum IdType { @JsonValue private final String value; - private IdType(String value) { + IdType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Identity.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Identity.java index d6375592..74baa0dd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Identity.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Identity.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Identity { @@ -153,15 +152,15 @@ public boolean equals(java.lang.Object o) { } Identity other = (Identity) o; return - Objects.deepEquals(this.processingHistory, other.processingHistory) && - Objects.deepEquals(this.users, other.users) && - Objects.deepEquals(this.groups, other.groups) && - Objects.deepEquals(this.memberships, other.memberships); + Utils.enhancedDeepEquals(this.processingHistory, other.processingHistory) && + Utils.enhancedDeepEquals(this.users, other.users) && + Utils.enhancedDeepEquals(this.groups, other.groups) && + Utils.enhancedDeepEquals(this.memberships, other.memberships); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( processingHistory, users, groups, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IncludeType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IncludeType.java index 10e1bd4a..f10e8a2e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IncludeType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IncludeType.java @@ -15,7 +15,7 @@ public enum IncludeType { @JsonValue private final String value; - private IncludeType(String value) { + IncludeType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentRequest.java index 4b039880..861ad1c9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -108,13 +107,13 @@ public boolean equals(java.lang.Object o) { } IndexDocumentRequest other = (IndexDocumentRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.document, other.document); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.document, other.document); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, document); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentsRequest.java index d5fa4f63..85688f3f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexDocumentsRequest.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -135,14 +134,14 @@ public boolean equals(java.lang.Object o) { } IndexDocumentsRequest other = (IndexDocumentsRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.documents, other.documents); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.documents, other.documents); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, datasource, documents); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexEmployeeRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexEmployeeRequest.java index 9a46c053..09932063 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexEmployeeRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexEmployeeRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -108,13 +107,13 @@ public boolean equals(java.lang.Object o) { } IndexEmployeeRequest other = (IndexEmployeeRequest) o; return - Objects.deepEquals(this.employee, other.employee) && - Objects.deepEquals(this.version, other.version); + Utils.enhancedDeepEquals(this.employee, other.employee) && + Utils.enhancedDeepEquals(this.version, other.version); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( employee, version); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexGroupRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexGroupRequest.java index 2872c13f..7eee00ae 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexGroupRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexGroupRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -135,14 +134,14 @@ public boolean equals(java.lang.Object o) { } IndexGroupRequest other = (IndexGroupRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.group, other.group); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.group, other.group); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, datasource, group); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexMembershipRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexMembershipRequest.java index bd6cec36..3510e1c6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexMembershipRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexMembershipRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -135,14 +134,14 @@ public boolean equals(java.lang.Object o) { } IndexMembershipRequest other = (IndexMembershipRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.membership, other.membership); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.membership, other.membership); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, datasource, membership); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexStatus.java index 4d4aca9d..be2df076 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexStatus.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class IndexStatus { @@ -112,13 +111,13 @@ public boolean equals(java.lang.Object o) { } IndexStatus other = (IndexStatus) o; return - Objects.deepEquals(this.lastCrawledTime, other.lastCrawledTime) && - Objects.deepEquals(this.lastIndexedTime, other.lastIndexedTime); + Utils.enhancedDeepEquals(this.lastCrawledTime, other.lastCrawledTime) && + Utils.enhancedDeepEquals(this.lastIndexedTime, other.lastIndexedTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastCrawledTime, lastIndexedTime); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexTeamRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexTeamRequest.java index 2789f6ad..bab2ce4a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexTeamRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexTeamRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -108,13 +107,13 @@ public boolean equals(java.lang.Object o) { } IndexTeamRequest other = (IndexTeamRequest) o; return - Objects.deepEquals(this.team, other.team) && - Objects.deepEquals(this.version, other.version); + Utils.enhancedDeepEquals(this.team, other.team) && + Utils.enhancedDeepEquals(this.version, other.version); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( team, version); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexUserRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexUserRequest.java index ca9729cf..ef4c9982 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexUserRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexUserRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -135,14 +134,14 @@ public boolean equals(java.lang.Object o) { } IndexUserRequest other = (IndexUserRequest) o; return - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.user, other.user); + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.user, other.user); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( version, datasource, user); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexingShortcut.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexingShortcut.java index 0ecdba1c..ec1ff117 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexingShortcut.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/IndexingShortcut.java @@ -13,7 +13,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class IndexingShortcut { @@ -338,20 +337,20 @@ public boolean equals(java.lang.Object o) { } IndexingShortcut other = (IndexingShortcut) o; return - Objects.deepEquals(this.inputAlias, other.inputAlias) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.destinationUrl, other.destinationUrl) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.unlisted, other.unlisted) && - Objects.deepEquals(this.urlTemplate, other.urlTemplate); + Utils.enhancedDeepEquals(this.inputAlias, other.inputAlias) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.destinationUrl, other.destinationUrl) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.unlisted, other.unlisted) && + Utils.enhancedDeepEquals(this.urlTemplate, other.urlTemplate); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( inputAlias, description, destinationUrl, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InputOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InputOptions.java index afd3f04c..fdeff4ac 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InputOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InputOptions.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -281,17 +280,17 @@ public boolean equals(java.lang.Object o) { } InputOptions other = (InputOptions) o; return - Objects.deepEquals(this.urlGreenlist, other.urlGreenlist) && - Objects.deepEquals(this.datasourcesType, other.datasourcesType) && - Objects.deepEquals(this.datasources, other.datasources) && - Objects.deepEquals(this.datasourceInstances, other.datasourceInstances) && - Objects.deepEquals(this.timePeriodType, other.timePeriodType) && - Objects.deepEquals(this.customTimeRange, other.customTimeRange); + Utils.enhancedDeepEquals(this.urlGreenlist, other.urlGreenlist) && + Utils.enhancedDeepEquals(this.datasourcesType, other.datasourcesType) && + Utils.enhancedDeepEquals(this.datasources, other.datasources) && + Utils.enhancedDeepEquals(this.datasourceInstances, other.datasourceInstances) && + Utils.enhancedDeepEquals(this.timePeriodType, other.timePeriodType) && + Utils.enhancedDeepEquals(this.customTimeRange, other.customTimeRange); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( urlGreenlist, datasourcesType, datasources, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InputSchema.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InputSchema.java index f28149b9..f869106f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InputSchema.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InputSchema.java @@ -7,7 +7,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * InputSchema @@ -40,7 +39,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAgentsRequestOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAgentsRequestOptions.java index b4f74dd8..614c6710 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAgentsRequestOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAgentsRequestOptions.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class InsightsAgentsRequestOptions { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } InsightsAgentsRequestOptions other = (InsightsAgentsRequestOptions) o; return - Objects.deepEquals(this.agentIds, other.agentIds); + Utils.enhancedDeepEquals(this.agentIds, other.agentIds); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agentIds); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAiAppRequestOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAiAppRequestOptions.java index 6ca45fbe..fd2748e8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAiAppRequestOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsAiAppRequestOptions.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class InsightsAiAppRequestOptions { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } InsightsAiAppRequestOptions other = (InsightsAiAppRequestOptions) o; return - Objects.deepEquals(this.aiAppIds, other.aiAppIds); + Utils.enhancedDeepEquals(this.aiAppIds, other.aiAppIds); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( aiAppIds); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequest.java index bcceeea1..bf71160d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class InsightsRequest { @@ -254,18 +253,18 @@ public boolean equals(java.lang.Object o) { } InsightsRequest other = (InsightsRequest) o; return - Objects.deepEquals(this.categories, other.categories) && - Objects.deepEquals(this.departments, other.departments) && - Objects.deepEquals(this.dayRange, other.dayRange) && - Objects.deepEquals(this.aiAppRequestOptions, other.aiAppRequestOptions) && - Objects.deepEquals(this.agentsRequestOptions, other.agentsRequestOptions) && - Objects.deepEquals(this.assistantActivityTypes, other.assistantActivityTypes) && - Objects.deepEquals(this.disablePerUserInsights, other.disablePerUserInsights); + Utils.enhancedDeepEquals(this.categories, other.categories) && + Utils.enhancedDeepEquals(this.departments, other.departments) && + Utils.enhancedDeepEquals(this.dayRange, other.dayRange) && + Utils.enhancedDeepEquals(this.aiAppRequestOptions, other.aiAppRequestOptions) && + Utils.enhancedDeepEquals(this.agentsRequestOptions, other.agentsRequestOptions) && + Utils.enhancedDeepEquals(this.assistantActivityTypes, other.assistantActivityTypes) && + Utils.enhancedDeepEquals(this.disablePerUserInsights, other.disablePerUserInsights); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( categories, departments, dayRange, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequestCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequestCategory.java index 578cba2f..dd737f04 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequestCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsRequestCategory.java @@ -24,7 +24,7 @@ public enum InsightsRequestCategory { @JsonValue private final String value; - private InsightsRequestCategory(String value) { + InsightsRequestCategory(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsResponse.java index 08da3e12..569fb17e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InsightsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class InsightsResponse { @@ -390,24 +389,24 @@ public boolean equals(java.lang.Object o) { } InsightsResponse other = (InsightsResponse) o; return - Objects.deepEquals(this.timeseries, other.timeseries) && - Objects.deepEquals(this.users, other.users) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.queries, other.queries) && - Objects.deepEquals(this.collections, other.collections) && - Objects.deepEquals(this.collectionsV2, other.collectionsV2) && - Objects.deepEquals(this.shortcuts, other.shortcuts) && - Objects.deepEquals(this.announcements, other.announcements) && - Objects.deepEquals(this.answers, other.answers) && - Objects.deepEquals(this.ai, other.ai) && - Objects.deepEquals(this.aiApps, other.aiApps) && - Objects.deepEquals(this.gleanAssist, other.gleanAssist) && - Objects.deepEquals(this.departments, other.departments); + Utils.enhancedDeepEquals(this.timeseries, other.timeseries) && + Utils.enhancedDeepEquals(this.users, other.users) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.queries, other.queries) && + Utils.enhancedDeepEquals(this.collections, other.collections) && + Utils.enhancedDeepEquals(this.collectionsV2, other.collectionsV2) && + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts) && + Utils.enhancedDeepEquals(this.announcements, other.announcements) && + Utils.enhancedDeepEquals(this.answers, other.answers) && + Utils.enhancedDeepEquals(this.ai, other.ai) && + Utils.enhancedDeepEquals(this.aiApps, other.aiApps) && + Utils.enhancedDeepEquals(this.gleanAssist, other.gleanAssist) && + Utils.enhancedDeepEquals(this.departments, other.departments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timeseries, users, content, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InvalidOperatorValueError.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InvalidOperatorValueError.java index e09b68be..baaf5299 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InvalidOperatorValueError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InvalidOperatorValueError.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class InvalidOperatorValueError { @@ -111,13 +110,13 @@ public boolean equals(java.lang.Object o) { } InvalidOperatorValueError other = (InvalidOperatorValueError) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.value, other.value); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.value, other.value); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( key, value); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/InviteInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/InviteInfo.java index f5d2bc20..4d558a03 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/InviteInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/InviteInfo.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -242,16 +241,16 @@ public boolean equals(java.lang.Object o) { } InviteInfo other = (InviteInfo) o; return - Objects.deepEquals(this.signUpTime, other.signUpTime) && - Objects.deepEquals(this.invites, other.invites) && - Objects.deepEquals(this.inviter, other.inviter) && - Objects.deepEquals(this.inviteTime, other.inviteTime) && - Objects.deepEquals(this.reminderTime, other.reminderTime); + Utils.enhancedDeepEquals(this.signUpTime, other.signUpTime) && + Utils.enhancedDeepEquals(this.invites, other.invites) && + Utils.enhancedDeepEquals(this.inviter, other.inviter) && + Utils.enhancedDeepEquals(this.inviteTime, other.inviteTime) && + Utils.enhancedDeepEquals(this.reminderTime, other.reminderTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( signUpTime, invites, inviter, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Issue.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Issue.java index 2037d4a0..93f0de2c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Issue.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Issue.java @@ -24,7 +24,7 @@ public enum Issue { @JsonValue private final String value; - private Issue(String value) { + Issue(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java index 17afcce5..32f110fd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java @@ -50,7 +50,7 @@ public enum JustificationType { @JsonValue private final String value; - private JustificationType(String value) { + JustificationType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/KnowledgeType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/KnowledgeType.java index 22d05b8f..7d5d53ec 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/KnowledgeType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/KnowledgeType.java @@ -21,7 +21,7 @@ public enum KnowledgeType { @JsonValue private final String value; - private KnowledgeType(String value) { + KnowledgeType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/LabeledCountInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/LabeledCountInfo.java index 9f138bc9..7e3bf70c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/LabeledCountInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/LabeledCountInfo.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class LabeledCountInfo { @@ -105,13 +104,13 @@ public boolean equals(java.lang.Object o) { } LabeledCountInfo other = (LabeledCountInfo) o; return - Objects.deepEquals(this.label, other.label) && - Objects.deepEquals(this.countInfo, other.countInfo); + Utils.enhancedDeepEquals(this.label, other.label) && + Utils.enhancedDeepEquals(this.countInfo, other.countInfo); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( label, countInfo); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/LastScanStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/LastScanStatus.java index db5146e0..12e2539b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/LastScanStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/LastScanStatus.java @@ -19,7 +19,7 @@ public enum LastScanStatus { @JsonValue private final String value; - private LastScanStatus(String value) { + LastScanStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/LikelihoodThreshold.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/LikelihoodThreshold.java index 37dfe3d3..9f928e58 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/LikelihoodThreshold.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/LikelihoodThreshold.java @@ -22,7 +22,7 @@ public enum LikelihoodThreshold { @JsonValue private final String value; - private LikelihoodThreshold(String value) { + LikelihoodThreshold(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersRequest.java index 4d293bf2..66894c29 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ListAnswersRequest { @@ -76,12 +75,12 @@ public boolean equals(java.lang.Object o) { } ListAnswersRequest other = (ListAnswersRequest) o; return - Objects.deepEquals(this.boardId, other.boardId); + Utils.enhancedDeepEquals(this.boardId, other.boardId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( boardId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersResponse.java index db1d9fcb..b9fdff4b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListAnswersResponse.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class ListAnswersResponse { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } ListAnswersResponse other = (ListAnswersResponse) o; return - Objects.deepEquals(this.answerResults, other.answerResults); + Utils.enhancedDeepEquals(this.answerResults, other.answerResults); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( answerResults); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListChatsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListChatsResponse.java index f6de50af..d09a11b4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListChatsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListChatsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ListChatsResponse { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } ListChatsResponse other = (ListChatsResponse) o; return - Objects.deepEquals(this.chatResults, other.chatResults); + Utils.enhancedDeepEquals(this.chatResults, other.chatResults); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( chatResults); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsRequest.java index 89d2aec0..0132aece 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsRequest.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ListCollectionsRequest { @@ -152,14 +151,14 @@ public boolean equals(java.lang.Object o) { } ListCollectionsRequest other = (ListCollectionsRequest) o; return - Objects.deepEquals(this.includeAudience, other.includeAudience) && - Objects.deepEquals(this.includeRoles, other.includeRoles) && - Objects.deepEquals(this.allowedDatasource, other.allowedDatasource); + Utils.enhancedDeepEquals(this.includeAudience, other.includeAudience) && + Utils.enhancedDeepEquals(this.includeRoles, other.includeRoles) && + Utils.enhancedDeepEquals(this.allowedDatasource, other.allowedDatasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( includeAudience, includeRoles, allowedDatasource); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsResponse.java index ea791dc9..eb9ac884 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListCollectionsResponse.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class ListCollectionsResponse { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } ListCollectionsResponse other = (ListCollectionsResponse) o; return - Objects.deepEquals(this.collections, other.collections); + Utils.enhancedDeepEquals(this.collections, other.collections); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( collections); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListDlpReportsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListDlpReportsResponse.java index 1b37472f..2b6248cb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListDlpReportsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListDlpReportsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ListDlpReportsResponse { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } ListDlpReportsResponse other = (ListDlpReportsResponse) o; return - Objects.deepEquals(this.reports, other.reports); + Utils.enhancedDeepEquals(this.reports, other.reports); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( reports); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java index 88525e09..e61bc852 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ListEntitiesRequest { @@ -78,6 +77,13 @@ public class ListEntitiesRequest { @JsonProperty("source") private Optional source; + /** + * The type of request being made. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("requestType") + private Optional requestType; + @JsonCreator public ListEntitiesRequest( @JsonProperty("filter") Optional> filter, @@ -88,7 +94,8 @@ public ListEntitiesRequest( @JsonProperty("includeFields") Optional> includeFields, @JsonProperty("pageSize") Optional pageSize, @JsonProperty("cursor") Optional cursor, - @JsonProperty("source") Optional source) { + @JsonProperty("source") Optional source, + @JsonProperty("requestType") Optional requestType) { Utils.checkNotNull(filter, "filter"); Utils.checkNotNull(sort, "sort"); Utils.checkNotNull(entityType, "entityType"); @@ -98,6 +105,7 @@ public ListEntitiesRequest( Utils.checkNotNull(pageSize, "pageSize"); Utils.checkNotNull(cursor, "cursor"); Utils.checkNotNull(source, "source"); + Utils.checkNotNull(requestType, "requestType"); this.filter = filter; this.sort = sort; this.entityType = entityType; @@ -107,10 +115,11 @@ public ListEntitiesRequest( this.pageSize = pageSize; this.cursor = cursor; this.source = source; + this.requestType = requestType; } public ListEntitiesRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } @SuppressWarnings("unchecked") @@ -183,6 +192,15 @@ public Optional source() { return source; } + /** + * The type of request being made. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional requestType() { + return (Optional) requestType; + } + public final static Builder builder() { return new Builder(); } @@ -337,6 +355,24 @@ public ListEntitiesRequest withSource(Optional source) { return this; } + /** + * The type of request being made. + */ + public ListEntitiesRequest withRequestType(RequestType requestType) { + Utils.checkNotNull(requestType, "requestType"); + this.requestType = Optional.ofNullable(requestType); + return this; + } + + /** + * The type of request being made. + */ + public ListEntitiesRequest withRequestType(Optional requestType) { + Utils.checkNotNull(requestType, "requestType"); + this.requestType = requestType; + return this; + } + @Override public boolean equals(java.lang.Object o) { @@ -348,20 +384,21 @@ public boolean equals(java.lang.Object o) { } ListEntitiesRequest other = (ListEntitiesRequest) o; return - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.sort, other.sort) && - Objects.deepEquals(this.entityType, other.entityType) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.includeFields, other.includeFields) && - Objects.deepEquals(this.pageSize, other.pageSize) && - Objects.deepEquals(this.cursor, other.cursor) && - Objects.deepEquals(this.source, other.source); + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.entityType, other.entityType) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.includeFields, other.includeFields) && + Utils.enhancedDeepEquals(this.pageSize, other.pageSize) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.source, other.source) && + Utils.enhancedDeepEquals(this.requestType, other.requestType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( filter, sort, entityType, @@ -370,7 +407,8 @@ public int hashCode() { includeFields, pageSize, cursor, - source); + source, + requestType); } @Override @@ -384,7 +422,8 @@ public String toString() { "includeFields", includeFields, "pageSize", pageSize, "cursor", cursor, - "source", source); + "source", source, + "requestType", requestType); } public final static class Builder { @@ -406,6 +445,8 @@ public final static class Builder { private Optional cursor = Optional.empty(); private Optional source = Optional.empty(); + + private Optional requestType; private Builder() { // force use of static builder() method @@ -560,11 +601,32 @@ public Builder source(Optional source) { this.source = source; return this; } + + /** + * The type of request being made. + */ + public Builder requestType(RequestType requestType) { + Utils.checkNotNull(requestType, "requestType"); + this.requestType = Optional.ofNullable(requestType); + return this; + } + + /** + * The type of request being made. + */ + public Builder requestType(Optional requestType) { + Utils.checkNotNull(requestType, "requestType"); + this.requestType = requestType; + return this; + } public ListEntitiesRequest build() { if (entityType == null) { entityType = _SINGLETON_VALUE_EntityType.value(); } + if (requestType == null) { + requestType = _SINGLETON_VALUE_RequestType.value(); + } return new ListEntitiesRequest( filter, sort, @@ -574,7 +636,8 @@ public ListEntitiesRequest build() { includeFields, pageSize, cursor, - source); + source, + requestType); } private static final LazySingletonValue> _SINGLETON_VALUE_EntityType = @@ -582,5 +645,11 @@ public ListEntitiesRequest build() { "entityType", "\"PEOPLE\"", new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_RequestType = + new LazySingletonValue<>( + "requestType", + "\"STANDARD\"", + new TypeReference>() {}); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestEntityType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestEntityType.java index bb944633..9171a5c0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestEntityType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestEntityType.java @@ -16,7 +16,7 @@ public enum ListEntitiesRequestEntityType { @JsonValue private final String value; - private ListEntitiesRequestEntityType(String value) { + ListEntitiesRequestEntityType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestIncludeField.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestIncludeField.java index 763439e6..8cb469e5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestIncludeField.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesRequestIncludeField.java @@ -22,7 +22,7 @@ public enum ListEntitiesRequestIncludeField { @JsonValue private final String value; - private ListEntitiesRequestIncludeField(String value) { + ListEntitiesRequestIncludeField(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesResponse.java index d741a232..4aa6d467 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListEntitiesResponse.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ListEntitiesResponse { @@ -325,20 +324,20 @@ public boolean equals(java.lang.Object o) { } ListEntitiesResponse other = (ListEntitiesResponse) o; return - Objects.deepEquals(this.results, other.results) && - Objects.deepEquals(this.teamResults, other.teamResults) && - Objects.deepEquals(this.customEntityResults, other.customEntityResults) && - Objects.deepEquals(this.facetResults, other.facetResults) && - Objects.deepEquals(this.cursor, other.cursor) && - Objects.deepEquals(this.totalCount, other.totalCount) && - Objects.deepEquals(this.hasMoreResults, other.hasMoreResults) && - Objects.deepEquals(this.sortOptions, other.sortOptions) && - Objects.deepEquals(this.customFacetNames, other.customFacetNames); + Utils.enhancedDeepEquals(this.results, other.results) && + Utils.enhancedDeepEquals(this.teamResults, other.teamResults) && + Utils.enhancedDeepEquals(this.customEntityResults, other.customEntityResults) && + Utils.enhancedDeepEquals(this.facetResults, other.facetResults) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.totalCount, other.totalCount) && + Utils.enhancedDeepEquals(this.hasMoreResults, other.hasMoreResults) && + Utils.enhancedDeepEquals(this.sortOptions, other.sortOptions) && + Utils.enhancedDeepEquals(this.customFacetNames, other.customFacetNames); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( results, teamResults, customEntityResults, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListPinsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListPinsResponse.java index 2ce8cdd7..087754db 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListPinsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListPinsResponse.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class ListPinsResponse { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } ListPinsResponse other = (ListPinsResponse) o; return - Objects.deepEquals(this.pins, other.pins); + Utils.enhancedDeepEquals(this.pins, other.pins); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( pins); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequest.java index 459a7728..44498d06 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ListShortcutsPaginatedRequest { @@ -231,17 +230,17 @@ public boolean equals(java.lang.Object o) { } ListShortcutsPaginatedRequest other = (ListShortcutsPaginatedRequest) o; return - Objects.deepEquals(this.includeFields, other.includeFields) && - Objects.deepEquals(this.pageSize, other.pageSize) && - Objects.deepEquals(this.cursor, other.cursor) && - Objects.deepEquals(this.filters, other.filters) && - Objects.deepEquals(this.sort, other.sort) && - Objects.deepEquals(this.query, other.query); + Utils.enhancedDeepEquals(this.includeFields, other.includeFields) && + Utils.enhancedDeepEquals(this.pageSize, other.pageSize) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.filters, other.filters) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.query, other.query); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( includeFields, pageSize, cursor, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequestIncludeField.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequestIncludeField.java index 863ebbee..a3434ecf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequestIncludeField.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedRequestIncludeField.java @@ -15,7 +15,7 @@ public enum ListShortcutsPaginatedRequestIncludeField { @JsonValue private final String value; - private ListShortcutsPaginatedRequestIncludeField(String value) { + ListShortcutsPaginatedRequestIncludeField(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedResponse.java index 6e9363a8..e7da0c5e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ListShortcutsPaginatedResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ListShortcutsPaginatedResponse { @@ -111,14 +110,14 @@ public boolean equals(java.lang.Object o) { } ListShortcutsPaginatedResponse other = (ListShortcutsPaginatedResponse) o; return - Objects.deepEquals(this.shortcuts, other.shortcuts) && - Objects.deepEquals(this.facetResults, other.facetResults) && - Objects.deepEquals(this.meta, other.meta); + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts) && + Utils.enhancedDeepEquals(this.facetResults, other.facetResults) && + Utils.enhancedDeepEquals(this.meta, other.meta); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( shortcuts, facetResults, meta); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfo.java index 2faf6c3f..7c2f2c8e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfo.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ManualFeedbackInfo { @@ -674,28 +673,28 @@ public boolean equals(java.lang.Object o) { } ManualFeedbackInfo other = (ManualFeedbackInfo) o; return - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.source, other.source) && - Objects.deepEquals(this.issue, other.issue) && - Objects.deepEquals(this.issues, other.issues) && - Objects.deepEquals(this.imageUrls, other.imageUrls) && - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.obscuredQuery, other.obscuredQuery) && - Objects.deepEquals(this.activeTab, other.activeTab) && - Objects.deepEquals(this.comments, other.comments) && - Objects.deepEquals(this.searchResults, other.searchResults) && - Objects.deepEquals(this.previousMessages, other.previousMessages) && - Objects.deepEquals(this.chatTranscript, other.chatTranscript) && - Objects.deepEquals(this.numQueriesFromFirstRun, other.numQueriesFromFirstRun) && - Objects.deepEquals(this.vote, other.vote) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.ratingScale, other.ratingScale); + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.source, other.source) && + Utils.enhancedDeepEquals(this.issue, other.issue) && + Utils.enhancedDeepEquals(this.issues, other.issues) && + Utils.enhancedDeepEquals(this.imageUrls, other.imageUrls) && + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.obscuredQuery, other.obscuredQuery) && + Utils.enhancedDeepEquals(this.activeTab, other.activeTab) && + Utils.enhancedDeepEquals(this.comments, other.comments) && + Utils.enhancedDeepEquals(this.searchResults, other.searchResults) && + Utils.enhancedDeepEquals(this.previousMessages, other.previousMessages) && + Utils.enhancedDeepEquals(this.chatTranscript, other.chatTranscript) && + Utils.enhancedDeepEquals(this.numQueriesFromFirstRun, other.numQueriesFromFirstRun) && + Utils.enhancedDeepEquals(this.vote, other.vote) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.ratingScale, other.ratingScale); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( email, source, issue, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfoSource.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfoSource.java index 5bf1d6e2..7fb59bdf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfoSource.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ManualFeedbackInfoSource.java @@ -37,7 +37,7 @@ public enum ManualFeedbackInfoSource { @JsonValue private final String value; - private ManualFeedbackInfoSource(String value) { + ManualFeedbackInfoSource(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Meeting.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Meeting.java index c7ed4c86..4b0a7765 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Meeting.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Meeting.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class Meeting { @@ -210,18 +209,18 @@ public boolean equals(java.lang.Object o) { } Meeting other = (Meeting) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.startTime, other.startTime) && - Objects.deepEquals(this.endTime, other.endTime) && - Objects.deepEquals(this.attendees, other.attendees); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.startTime, other.startTime) && + Utils.enhancedDeepEquals(this.endTime, other.endTime) && + Utils.enhancedDeepEquals(this.attendees, other.attendees); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, title, description, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Message.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Message.java index ba89a9e5..9ecfffe9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Message.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Message.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Message { @@ -114,13 +113,13 @@ public boolean equals(java.lang.Object o) { } Message other = (Message) o; return - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.content, other.content); + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.content, other.content); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( role, content); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageTextBlock.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageTextBlock.java index 53278f94..b6da7ecc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageTextBlock.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageTextBlock.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class MessageTextBlock { @@ -66,13 +65,13 @@ public boolean equals(java.lang.Object o) { } MessageTextBlock other = (MessageTextBlock) o; return - Objects.deepEquals(this.text, other.text) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( text, type); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageType.java index f39e4fd9..d39ad0f8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessageType.java @@ -26,7 +26,7 @@ public enum MessageType { @JsonValue private final String value; - private MessageType(String value) { + MessageType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesRequest.java index 3a070257..b6e82a96 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesRequest.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class MessagesRequest { @@ -314,19 +313,19 @@ public boolean equals(java.lang.Object o) { } MessagesRequest other = (MessagesRequest) o; return - Objects.deepEquals(this.idType, other.idType) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.workspaceId, other.workspaceId) && - Objects.deepEquals(this.direction, other.direction) && - Objects.deepEquals(this.timestampMillis, other.timestampMillis) && - Objects.deepEquals(this.includeRootMessage, other.includeRootMessage) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.datasourceInstanceDisplayName, other.datasourceInstanceDisplayName); + Utils.enhancedDeepEquals(this.idType, other.idType) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.workspaceId, other.workspaceId) && + Utils.enhancedDeepEquals(this.direction, other.direction) && + Utils.enhancedDeepEquals(this.timestampMillis, other.timestampMillis) && + Utils.enhancedDeepEquals(this.includeRootMessage, other.includeRootMessage) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.datasourceInstanceDisplayName, other.datasourceInstanceDisplayName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( idType, id, workspaceId, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesResponse.java index 06180611..e2e10976 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/MessagesResponse.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class MessagesResponse { @@ -118,14 +117,14 @@ public boolean equals(java.lang.Object o) { } MessagesResponse other = (MessagesResponse) o; return - Objects.deepEquals(this.hasMore, other.hasMore) && - Objects.deepEquals(this.searchResponse, other.searchResponse) && - Objects.deepEquals(this.rootMessage, other.rootMessage); + Utils.enhancedDeepEquals(this.hasMore, other.hasMore) && + Utils.enhancedDeepEquals(this.searchResponse, other.searchResponse) && + Utils.enhancedDeepEquals(this.rootMessage, other.rootMessage); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( hasMore, searchResponse, rootMessage); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Mode.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Mode.java index ed7b2d1e..6679f3f9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Mode.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Mode.java @@ -20,7 +20,7 @@ public enum Mode { @JsonValue private final String value; - private Mode(String value) { + Mode(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectDefinition.java index 86007d1c..c76a9fd2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectDefinition.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -254,17 +253,17 @@ public boolean equals(java.lang.Object o) { } ObjectDefinition other = (ObjectDefinition) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.displayLabel, other.displayLabel) && - Objects.deepEquals(this.docCategory, other.docCategory) && - Objects.deepEquals(this.propertyDefinitions, other.propertyDefinitions) && - Objects.deepEquals(this.propertyGroups, other.propertyGroups) && - Objects.deepEquals(this.summarizable, other.summarizable); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.displayLabel, other.displayLabel) && + Utils.enhancedDeepEquals(this.docCategory, other.docCategory) && + Utils.enhancedDeepEquals(this.propertyDefinitions, other.propertyDefinitions) && + Utils.enhancedDeepEquals(this.propertyGroups, other.propertyGroups) && + Utils.enhancedDeepEquals(this.summarizable, other.summarizable); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, displayLabel, docCategory, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectPermissions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectPermissions.java index 0e22c958..dcb619c4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectPermissions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ObjectPermissions.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ObjectPermissions { @@ -77,12 +76,12 @@ public boolean equals(java.lang.Object o) { } ObjectPermissions other = (ObjectPermissions) o; return - Objects.deepEquals(this.write, other.write); + Utils.enhancedDeepEquals(this.write, other.write); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( write); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorMetadata.java index c15d893b..25e81b39 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorMetadata.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class OperatorMetadata { @@ -242,18 +241,18 @@ public boolean equals(java.lang.Object o) { } OperatorMetadata other = (OperatorMetadata) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.isCustom, other.isCustom) && - Objects.deepEquals(this.operatorType, other.operatorType) && - Objects.deepEquals(this.helpText, other.helpText) && - Objects.deepEquals(this.scopes, other.scopes) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.displayValue, other.displayValue); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.isCustom, other.isCustom) && + Utils.enhancedDeepEquals(this.operatorType, other.operatorType) && + Utils.enhancedDeepEquals(this.helpText, other.helpText) && + Utils.enhancedDeepEquals(this.scopes, other.scopes) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.displayValue, other.displayValue); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, isCustom, operatorType, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorScope.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorScope.java index 401ffd00..b52f3210 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorScope.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorScope.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class OperatorScope { @@ -87,13 +86,13 @@ public boolean equals(java.lang.Object o) { } OperatorScope other = (OperatorScope) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.docType, other.docType); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.docType, other.docType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, docType); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorType.java index bea7f95a..d9a4e650 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/OperatorType.java @@ -17,7 +17,7 @@ public enum OperatorType { @JsonValue private final String value; - private OperatorType(String value) { + OperatorType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/OrderBy.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/OrderBy.java index 28f16f93..02e7eb59 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/OrderBy.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/OrderBy.java @@ -15,7 +15,7 @@ public enum OrderBy { @JsonValue private final String value; - private OrderBy(String value) { + OrderBy(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/OutputSchema.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/OutputSchema.java index f0e8e724..06451b4e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/OutputSchema.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/OutputSchema.java @@ -7,7 +7,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * OutputSchema @@ -40,7 +39,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequest.java index 2af98475..047e788f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class PeopleRequest { @@ -262,17 +261,17 @@ public boolean equals(java.lang.Object o) { } PeopleRequest other = (PeopleRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.obfuscatedIds, other.obfuscatedIds) && - Objects.deepEquals(this.emailIds, other.emailIds) && - Objects.deepEquals(this.includeFields, other.includeFields) && - Objects.deepEquals(this.includeTypes, other.includeTypes) && - Objects.deepEquals(this.source, other.source); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.obfuscatedIds, other.obfuscatedIds) && + Utils.enhancedDeepEquals(this.emailIds, other.emailIds) && + Utils.enhancedDeepEquals(this.includeFields, other.includeFields) && + Utils.enhancedDeepEquals(this.includeTypes, other.includeTypes) && + Utils.enhancedDeepEquals(this.source, other.source); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, obfuscatedIds, emailIds, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequestIncludeField.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequestIncludeField.java index 0003d191..e58adcb6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequestIncludeField.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleRequestIncludeField.java @@ -23,7 +23,7 @@ public enum PeopleRequestIncludeField { @JsonValue private final String value; - private PeopleRequestIncludeField(String value) { + PeopleRequestIncludeField(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleResponse.java index 91b34d10..4f9d4a8f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PeopleResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class PeopleResponse { @@ -152,14 +151,14 @@ public boolean equals(java.lang.Object o) { } PeopleResponse other = (PeopleResponse) o; return - Objects.deepEquals(this.results, other.results) && - Objects.deepEquals(this.relatedDocuments, other.relatedDocuments) && - Objects.deepEquals(this.errors, other.errors); + Utils.enhancedDeepEquals(this.results, other.results) && + Utils.enhancedDeepEquals(this.relatedDocuments, other.relatedDocuments) && + Utils.enhancedDeepEquals(this.errors, other.errors); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( results, relatedDocuments, errors); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Period.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Period.java index 87d84bc6..294c3518 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Period.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Period.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class Period { @@ -188,15 +187,15 @@ public boolean equals(java.lang.Object o) { } Period other = (Period) o; return - Objects.deepEquals(this.minDaysFromNow, other.minDaysFromNow) && - Objects.deepEquals(this.maxDaysFromNow, other.maxDaysFromNow) && - Objects.deepEquals(this.start, other.start) && - Objects.deepEquals(this.end, other.end); + Utils.enhancedDeepEquals(this.minDaysFromNow, other.minDaysFromNow) && + Utils.enhancedDeepEquals(this.maxDaysFromNow, other.maxDaysFromNow) && + Utils.enhancedDeepEquals(this.start, other.start) && + Utils.enhancedDeepEquals(this.end, other.end); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( minDaysFromNow, maxDaysFromNow, start, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Permissions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Permissions.java index b094a095..87a1b09f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Permissions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Permissions.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; /** @@ -341,19 +340,19 @@ public boolean equals(java.lang.Object o) { } Permissions other = (Permissions) o; return - Objects.deepEquals(this.canAdminSearch, other.canAdminSearch) && - Objects.deepEquals(this.canAdminClientApiGlobalTokens, other.canAdminClientApiGlobalTokens) && - Objects.deepEquals(this.canDlp, other.canDlp) && - Objects.deepEquals(this.read, other.read) && - Objects.deepEquals(this.write, other.write) && - Objects.deepEquals(this.grant, other.grant) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.roles, other.roles); + Utils.enhancedDeepEquals(this.canAdminSearch, other.canAdminSearch) && + Utils.enhancedDeepEquals(this.canAdminClientApiGlobalTokens, other.canAdminClientApiGlobalTokens) && + Utils.enhancedDeepEquals(this.canDlp, other.canDlp) && + Utils.enhancedDeepEquals(this.read, other.read) && + Utils.enhancedDeepEquals(this.write, other.write) && + Utils.enhancedDeepEquals(this.grant, other.grant) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.roles, other.roles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( canAdminSearch, canAdminClientApiGlobalTokens, canDlp, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PermissionsGroupIntersectionDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PermissionsGroupIntersectionDefinition.java index c81d5c97..c96ab815 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PermissionsGroupIntersectionDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PermissionsGroupIntersectionDefinition.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -71,12 +70,12 @@ public boolean equals(java.lang.Object o) { } PermissionsGroupIntersectionDefinition other = (PermissionsGroupIntersectionDefinition) o; return - Objects.deepEquals(this.requiredGroups, other.requiredGroups); + Utils.enhancedDeepEquals(this.requiredGroups, other.requiredGroups); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( requiredGroups); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Person.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Person.java index 8eefafae..d27d7380 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Person.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Person.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Person { @@ -157,15 +156,15 @@ public boolean equals(java.lang.Object o) { } Person other = (Person) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.obfuscatedId, other.obfuscatedId) && - Objects.deepEquals(this.relatedDocuments, other.relatedDocuments) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.obfuscatedId, other.obfuscatedId) && + Utils.enhancedDeepEquals(this.relatedDocuments, other.relatedDocuments) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, obfuscatedId, relatedDocuments, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonDistance.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonDistance.java index ca22c1b5..8c879ceb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonDistance.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonDistance.java @@ -10,7 +10,6 @@ import java.lang.Float; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class PersonDistance { @@ -111,14 +110,14 @@ public boolean equals(java.lang.Object o) { } PersonDistance other = (PersonDistance) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.obfuscatedId, other.obfuscatedId) && - Objects.deepEquals(this.distance, other.distance); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.obfuscatedId, other.obfuscatedId) && + Utils.enhancedDeepEquals(this.distance, other.distance); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, obfuscatedId, distance); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadata.java index 9c1c24b9..2c26583e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadata.java @@ -19,7 +19,6 @@ import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class PersonMetadata { @@ -1604,55 +1603,55 @@ public boolean equals(java.lang.Object o) { } PersonMetadata other = (PersonMetadata) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.firstName, other.firstName) && - Objects.deepEquals(this.lastName, other.lastName) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.businessUnit, other.businessUnit) && - Objects.deepEquals(this.department, other.department) && - Objects.deepEquals(this.teams, other.teams) && - Objects.deepEquals(this.departmentCount, other.departmentCount) && - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.aliasEmails, other.aliasEmails) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.structuredLocation, other.structuredLocation) && - Objects.deepEquals(this.externalProfileLink, other.externalProfileLink) && - Objects.deepEquals(this.manager, other.manager) && - Objects.deepEquals(this.managementChain, other.managementChain) && - Objects.deepEquals(this.phone, other.phone) && - Objects.deepEquals(this.timezone, other.timezone) && - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.photoUrl, other.photoUrl) && - Objects.deepEquals(this.uneditedPhotoUrl, other.uneditedPhotoUrl) && - Objects.deepEquals(this.bannerUrl, other.bannerUrl) && - Objects.deepEquals(this.reports, other.reports) && - Objects.deepEquals(this.startDate, other.startDate) && - Objects.deepEquals(this.endDate, other.endDate) && - Objects.deepEquals(this.bio, other.bio) && - Objects.deepEquals(this.pronoun, other.pronoun) && - Objects.deepEquals(this.orgSizeCount, other.orgSizeCount) && - Objects.deepEquals(this.directReportsCount, other.directReportsCount) && - Objects.deepEquals(this.preferredName, other.preferredName) && - Objects.deepEquals(this.socialNetwork, other.socialNetwork) && - Objects.deepEquals(this.datasourceProfile, other.datasourceProfile) && - Objects.deepEquals(this.querySuggestions, other.querySuggestions) && - Objects.deepEquals(this.peopleDistance, other.peopleDistance) && - Objects.deepEquals(this.inviteInfo, other.inviteInfo) && - Objects.deepEquals(this.isSignedUp, other.isSignedUp) && - Objects.deepEquals(this.lastExtensionUse, other.lastExtensionUse) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.customFields, other.customFields) && - Objects.deepEquals(this.loggingId, other.loggingId) && - Objects.deepEquals(this.startDatePercentile, other.startDatePercentile) && - Objects.deepEquals(this.busyEvents, other.busyEvents) && - Objects.deepEquals(this.profileBoolSettings, other.profileBoolSettings) && - Objects.deepEquals(this.badges, other.badges) && - Objects.deepEquals(this.isOrgRoot, other.isOrgRoot); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.firstName, other.firstName) && + Utils.enhancedDeepEquals(this.lastName, other.lastName) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.businessUnit, other.businessUnit) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.teams, other.teams) && + Utils.enhancedDeepEquals(this.departmentCount, other.departmentCount) && + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.aliasEmails, other.aliasEmails) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.structuredLocation, other.structuredLocation) && + Utils.enhancedDeepEquals(this.externalProfileLink, other.externalProfileLink) && + Utils.enhancedDeepEquals(this.manager, other.manager) && + Utils.enhancedDeepEquals(this.managementChain, other.managementChain) && + Utils.enhancedDeepEquals(this.phone, other.phone) && + Utils.enhancedDeepEquals(this.timezone, other.timezone) && + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.photoUrl, other.photoUrl) && + Utils.enhancedDeepEquals(this.uneditedPhotoUrl, other.uneditedPhotoUrl) && + Utils.enhancedDeepEquals(this.bannerUrl, other.bannerUrl) && + Utils.enhancedDeepEquals(this.reports, other.reports) && + Utils.enhancedDeepEquals(this.startDate, other.startDate) && + Utils.enhancedDeepEquals(this.endDate, other.endDate) && + Utils.enhancedDeepEquals(this.bio, other.bio) && + Utils.enhancedDeepEquals(this.pronoun, other.pronoun) && + Utils.enhancedDeepEquals(this.orgSizeCount, other.orgSizeCount) && + Utils.enhancedDeepEquals(this.directReportsCount, other.directReportsCount) && + Utils.enhancedDeepEquals(this.preferredName, other.preferredName) && + Utils.enhancedDeepEquals(this.socialNetwork, other.socialNetwork) && + Utils.enhancedDeepEquals(this.datasourceProfile, other.datasourceProfile) && + Utils.enhancedDeepEquals(this.querySuggestions, other.querySuggestions) && + Utils.enhancedDeepEquals(this.peopleDistance, other.peopleDistance) && + Utils.enhancedDeepEquals(this.inviteInfo, other.inviteInfo) && + Utils.enhancedDeepEquals(this.isSignedUp, other.isSignedUp) && + Utils.enhancedDeepEquals(this.lastExtensionUse, other.lastExtensionUse) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.customFields, other.customFields) && + Utils.enhancedDeepEquals(this.loggingId, other.loggingId) && + Utils.enhancedDeepEquals(this.startDatePercentile, other.startDatePercentile) && + Utils.enhancedDeepEquals(this.busyEvents, other.busyEvents) && + Utils.enhancedDeepEquals(this.profileBoolSettings, other.profileBoolSettings) && + Utils.enhancedDeepEquals(this.badges, other.badges) && + Utils.enhancedDeepEquals(this.isOrgRoot, other.isOrgRoot); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( type, firstName, lastName, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadataType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadataType.java index b32b48b2..923f516d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadataType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonMetadataType.java @@ -17,7 +17,7 @@ public enum PersonMetadataType { @JsonValue private final String value; - private PersonMetadataType(String value) { + PersonMetadataType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonObject.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonObject.java index ec8468d2..7bcb2478 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonObject.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonObject.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class PersonObject { @@ -84,13 +83,13 @@ public boolean equals(java.lang.Object o) { } PersonObject other = (PersonObject) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.obfuscatedId, other.obfuscatedId); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.obfuscatedId, other.obfuscatedId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, obfuscatedId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeam.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeam.java index 3a02b6e3..d8001bd2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeam.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeam.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; /** @@ -229,16 +228,16 @@ public boolean equals(java.lang.Object o) { } PersonTeam other = (PersonTeam) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.externalLink, other.externalLink) && - Objects.deepEquals(this.relationship, other.relationship) && - Objects.deepEquals(this.joinDate, other.joinDate); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.externalLink, other.externalLink) && + Utils.enhancedDeepEquals(this.relationship, other.relationship) && + Utils.enhancedDeepEquals(this.joinDate, other.joinDate); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, name, externalLink, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeamRelationship.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeamRelationship.java index 865a8649..35dccb51 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeamRelationship.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonTeamRelationship.java @@ -23,7 +23,7 @@ public enum PersonTeamRelationship { @JsonValue private final String value; - private PersonTeamRelationship(String value) { + PersonTeamRelationship(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationship.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationship.java index 1c25dfda..6144679f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationship.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationship.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; /** @@ -175,15 +174,15 @@ public boolean equals(java.lang.Object o) { } PersonToTeamRelationship other = (PersonToTeamRelationship) o; return - Objects.deepEquals(this.person, other.person) && - Objects.deepEquals(this.relationship, other.relationship) && - Objects.deepEquals(this.customRelationshipStr, other.customRelationshipStr) && - Objects.deepEquals(this.joinDate, other.joinDate); + Utils.enhancedDeepEquals(this.person, other.person) && + Utils.enhancedDeepEquals(this.relationship, other.relationship) && + Utils.enhancedDeepEquals(this.customRelationshipStr, other.customRelationshipStr) && + Utils.enhancedDeepEquals(this.joinDate, other.joinDate); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( person, relationship, customRelationshipStr, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationshipRelationship.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationshipRelationship.java index 552315b3..695355e1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationshipRelationship.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PersonToTeamRelationshipRelationship.java @@ -23,7 +23,7 @@ public enum PersonToTeamRelationshipRelationship { @JsonValue private final String value; - private PersonToTeamRelationshipRelationship(String value) { + PersonToTeamRelationshipRelationship(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PinDocument.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PinDocument.java index 8a9a7672..0fa1993b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PinDocument.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PinDocument.java @@ -14,7 +14,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class PinDocument { @@ -277,19 +276,19 @@ public boolean equals(java.lang.Object o) { } PinDocument other = (PinDocument) o; return - Objects.deepEquals(this.queries, other.queries) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.documentId, other.documentId) && - Objects.deepEquals(this.attribution, other.attribution) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updateTime, other.updateTime); + Utils.enhancedDeepEquals(this.queries, other.queries) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.documentId, other.documentId) && + Utils.enhancedDeepEquals(this.attribution, other.attribution) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( queries, audienceFilters, id, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PinRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PinRequest.java index 4059981b..87d6ca96 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PinRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PinRequest.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class PinRequest { @@ -151,14 +150,14 @@ public boolean equals(java.lang.Object o) { } PinRequest other = (PinRequest) o; return - Objects.deepEquals(this.queries, other.queries) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.documentId, other.documentId); + Utils.enhancedDeepEquals(this.queries, other.queries) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.documentId, other.documentId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( queries, audienceFilters, documentId); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PossibleValue.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PossibleValue.java index 1c0a9fe7..b771279b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PossibleValue.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PossibleValue.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -116,13 +115,13 @@ public boolean equals(java.lang.Object o) { } PossibleValue other = (PossibleValue) o; return - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.label, other.label); + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.label, other.label); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( value, label); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllDocumentsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllDocumentsRequest.java index 201051f1..85857c4e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllDocumentsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllDocumentsRequest.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -80,12 +79,12 @@ public boolean equals(java.lang.Object o) { } ProcessAllDocumentsRequest other = (ProcessAllDocumentsRequest) o; return - Objects.deepEquals(this.datasource, other.datasource); + Utils.enhancedDeepEquals(this.datasource, other.datasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllMembershipsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllMembershipsRequest.java index 3bbb3a91..df544209 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllMembershipsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessAllMembershipsRequest.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -80,12 +79,12 @@ public boolean equals(java.lang.Object o) { } ProcessAllMembershipsRequest other = (ProcessAllMembershipsRequest) o; return - Objects.deepEquals(this.datasource, other.datasource); + Utils.enhancedDeepEquals(this.datasource, other.datasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingHistoryEvent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingHistoryEvent.java index 3c68c7b4..09959724 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingHistoryEvent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingHistoryEvent.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -116,13 +115,13 @@ public boolean equals(java.lang.Object o) { } ProcessingHistoryEvent other = (ProcessingHistoryEvent) o; return - Objects.deepEquals(this.startTime, other.startTime) && - Objects.deepEquals(this.endTime, other.endTime); + Utils.enhancedDeepEquals(this.startTime, other.startTime) && + Utils.enhancedDeepEquals(this.endTime, other.endTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( startTime, endTime); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingState.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingState.java index d9c43868..cc147a34 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingState.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ProcessingState.java @@ -24,7 +24,7 @@ public enum ProcessingState { @JsonValue private final String value; - private ProcessingState(String value) { + ProcessingState(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Prominence.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Prominence.java index e6a650d2..92615edc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Prominence.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Prominence.java @@ -21,7 +21,7 @@ public enum Prominence { @JsonValue private final String value; - private Prominence(String value) { + Prominence(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplate.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplate.java index ebcdac22..a5479b86 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplate.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplate.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class PromptTemplate { @@ -460,24 +459,24 @@ public boolean equals(java.lang.Object o) { } PromptTemplate other = (PromptTemplate) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.template, other.template) && - Objects.deepEquals(this.applicationId, other.applicationId) && - Objects.deepEquals(this.inclusions, other.inclusions) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.createTimestamp, other.createTimestamp) && - Objects.deepEquals(this.lastUpdateTimestamp, other.lastUpdateTimestamp) && - Objects.deepEquals(this.lastUpdatedBy, other.lastUpdatedBy) && - Objects.deepEquals(this.roles, other.roles); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.template, other.template) && + Utils.enhancedDeepEquals(this.applicationId, other.applicationId) && + Utils.enhancedDeepEquals(this.inclusions, other.inclusions) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.createTimestamp, other.createTimestamp) && + Utils.enhancedDeepEquals(this.lastUpdateTimestamp, other.lastUpdateTimestamp) && + Utils.enhancedDeepEquals(this.lastUpdatedBy, other.lastUpdatedBy) && + Utils.enhancedDeepEquals(this.roles, other.roles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, template, applicationId, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplateResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplateResult.java index 6be02c6e..bb9106b8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplateResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PromptTemplateResult.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class PromptTemplateResult { @@ -151,15 +150,15 @@ public boolean equals(java.lang.Object o) { } PromptTemplateResult other = (PromptTemplateResult) o; return - Objects.deepEquals(this.promptTemplate, other.promptTemplate) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.favoriteInfo, other.favoriteInfo) && - Objects.deepEquals(this.runCount, other.runCount); + Utils.enhancedDeepEquals(this.promptTemplate, other.promptTemplate) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.favoriteInfo, other.favoriteInfo) && + Utils.enhancedDeepEquals(this.runCount, other.runCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( promptTemplate, trackingToken, favoriteInfo, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyDefinition.java index 21823400..750776b2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyDefinition.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class PropertyDefinition { @@ -356,20 +355,20 @@ public boolean equals(java.lang.Object o) { } PropertyDefinition other = (PropertyDefinition) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.displayLabel, other.displayLabel) && - Objects.deepEquals(this.displayLabelPlural, other.displayLabelPlural) && - Objects.deepEquals(this.propertyType, other.propertyType) && - Objects.deepEquals(this.uiOptions, other.uiOptions) && - Objects.deepEquals(this.hideUiFacet, other.hideUiFacet) && - Objects.deepEquals(this.uiFacetOrder, other.uiFacetOrder) && - Objects.deepEquals(this.skipIndexing, other.skipIndexing) && - Objects.deepEquals(this.group, other.group); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.displayLabel, other.displayLabel) && + Utils.enhancedDeepEquals(this.displayLabelPlural, other.displayLabelPlural) && + Utils.enhancedDeepEquals(this.propertyType, other.propertyType) && + Utils.enhancedDeepEquals(this.uiOptions, other.uiOptions) && + Utils.enhancedDeepEquals(this.hideUiFacet, other.hideUiFacet) && + Utils.enhancedDeepEquals(this.uiFacetOrder, other.uiFacetOrder) && + Utils.enhancedDeepEquals(this.skipIndexing, other.skipIndexing) && + Utils.enhancedDeepEquals(this.group, other.group); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, displayLabel, displayLabelPlural, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyGroup.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyGroup.java index b5e3d045..5bbc6df3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyGroup.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyGroup.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -116,13 +115,13 @@ public boolean equals(java.lang.Object o) { } PropertyGroup other = (PropertyGroup) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.displayLabel, other.displayLabel); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.displayLabel, other.displayLabel); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, displayLabel); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyType.java index 43cf08c5..11cd3ac5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PropertyType.java @@ -25,7 +25,7 @@ public enum PropertyType { @JsonValue private final String value; - private PropertyType(String value) { + PropertyType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Provider.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Provider.java index cdca5d50..7a2ea27d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Provider.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Provider.java @@ -15,7 +15,7 @@ public enum Provider { @JsonValue private final String value; - private Provider(String value) { + Provider(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsight.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsight.java index d5771031..cbcc8a3f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsight.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsight.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class QueryInsight { @@ -205,17 +204,17 @@ public boolean equals(java.lang.Object o) { } QueryInsight other = (QueryInsight) o; return - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.searchCount, other.searchCount) && - Objects.deepEquals(this.searchorCount, other.searchorCount) && - Objects.deepEquals(this.searchWithClickCount, other.searchWithClickCount) && - Objects.deepEquals(this.clickCount, other.clickCount) && - Objects.deepEquals(this.similarQueries, other.similarQueries); + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.searchCount, other.searchCount) && + Utils.enhancedDeepEquals(this.searchorCount, other.searchorCount) && + Utils.enhancedDeepEquals(this.searchWithClickCount, other.searchWithClickCount) && + Utils.enhancedDeepEquals(this.clickCount, other.clickCount) && + Utils.enhancedDeepEquals(this.similarQueries, other.similarQueries); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( query, searchCount, searchorCount, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsightsResponse.java index 8502ed83..42437c7e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/QueryInsightsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class QueryInsightsResponse { @@ -225,16 +224,16 @@ public boolean equals(java.lang.Object o) { } QueryInsightsResponse other = (QueryInsightsResponse) o; return - Objects.deepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && - Objects.deepEquals(this.queryInsights, other.queryInsights) && - Objects.deepEquals(this.lowPerformingQueryInsights, other.lowPerformingQueryInsights) && - Objects.deepEquals(this.departments, other.departments) && - Objects.deepEquals(this.minVisitorThreshold, other.minVisitorThreshold); + Utils.enhancedDeepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && + Utils.enhancedDeepEquals(this.queryInsights, other.queryInsights) && + Utils.enhancedDeepEquals(this.lowPerformingQueryInsights, other.lowPerformingQueryInsights) && + Utils.enhancedDeepEquals(this.departments, other.departments) && + Utils.enhancedDeepEquals(this.minVisitorThreshold, other.minVisitorThreshold); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastLogTimestamp, queryInsights, lowPerformingQueryInsights, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestion.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestion.java index c75a6fd1..9efee6b7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestion.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestion.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class QuerySuggestion { @@ -288,19 +287,19 @@ public boolean equals(java.lang.Object o) { } QuerySuggestion other = (QuerySuggestion) o; return - Objects.deepEquals(this.missingTerm, other.missingTerm) && - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.searchProviderInfo, other.searchProviderInfo) && - Objects.deepEquals(this.label, other.label) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.requestOptions, other.requestOptions) && - Objects.deepEquals(this.ranges, other.ranges) && - Objects.deepEquals(this.inputDetails, other.inputDetails); + Utils.enhancedDeepEquals(this.missingTerm, other.missingTerm) && + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.searchProviderInfo, other.searchProviderInfo) && + Utils.enhancedDeepEquals(this.label, other.label) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.requestOptions, other.requestOptions) && + Utils.enhancedDeepEquals(this.ranges, other.ranges) && + Utils.enhancedDeepEquals(this.inputDetails, other.inputDetails); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( missingTerm, query, searchProviderInfo, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestionList.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestionList.java index ecee3c92..ff4a0984 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestionList.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/QuerySuggestionList.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class QuerySuggestionList { @@ -91,13 +90,13 @@ public boolean equals(java.lang.Object o) { } QuerySuggestionList other = (QuerySuggestionList) o; return - Objects.deepEquals(this.suggestions, other.suggestions) && - Objects.deepEquals(this.person, other.person); + Utils.enhancedDeepEquals(this.suggestions, other.suggestions) && + Utils.enhancedDeepEquals(this.person, other.person); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( suggestions, person); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Quicklink.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Quicklink.java index 55c3e169..de175647 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Quicklink.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Quicklink.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -264,17 +263,17 @@ public boolean equals(java.lang.Object o) { } Quicklink other = (Quicklink) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.shortName, other.shortName) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.iconConfig, other.iconConfig) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.scopes, other.scopes); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.shortName, other.shortName) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.iconConfig, other.iconConfig) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.scopes, other.scopes); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, shortName, url, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Reaction.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Reaction.java index 32fb03f6..57b5bb6d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Reaction.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Reaction.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Reaction { @@ -164,15 +163,15 @@ public boolean equals(java.lang.Object o) { } Reaction other = (Reaction) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.reactors, other.reactors) && - Objects.deepEquals(this.reactedByViewer, other.reactedByViewer); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.reactors, other.reactors) && + Utils.enhancedDeepEquals(this.reactedByViewer, other.reactedByViewer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( type, count, reactors, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReadPermission.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReadPermission.java index a02ac423..1e3e85e9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReadPermission.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReadPermission.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -82,12 +81,12 @@ public boolean equals(java.lang.Object o) { } ReadPermission other = (ReadPermission) o; return - Objects.deepEquals(this.scopeType, other.scopeType); + Utils.enhancedDeepEquals(this.scopeType, other.scopeType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( scopeType); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequest.java index 694742ea..276bd405 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class RecommendationsRequest { @@ -286,19 +285,19 @@ public boolean equals(java.lang.Object o) { } RecommendationsRequest other = (RecommendationsRequest) o; return - Objects.deepEquals(this.timestamp, other.timestamp) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.sourceDocument, other.sourceDocument) && - Objects.deepEquals(this.pageSize, other.pageSize) && - Objects.deepEquals(this.maxSnippetSize, other.maxSnippetSize) && - Objects.deepEquals(this.recommendationDocumentSpec, other.recommendationDocumentSpec) && - Objects.deepEquals(this.requestOptions, other.requestOptions); + Utils.enhancedDeepEquals(this.timestamp, other.timestamp) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.sourceDocument, other.sourceDocument) && + Utils.enhancedDeepEquals(this.pageSize, other.pageSize) && + Utils.enhancedDeepEquals(this.maxSnippetSize, other.maxSnippetSize) && + Utils.enhancedDeepEquals(this.recommendationDocumentSpec, other.recommendationDocumentSpec) && + Utils.enhancedDeepEquals(this.requestOptions, other.requestOptions); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timestamp, trackingToken, sessionInfo, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequestOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequestOptions.java index bd1c0480..8055bf02 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequestOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RecommendationsRequestOptions.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class RecommendationsRequestOptions { @@ -213,16 +212,16 @@ public boolean equals(java.lang.Object o) { } RecommendationsRequestOptions other = (RecommendationsRequestOptions) o; return - Objects.deepEquals(this.datasourceFilter, other.datasourceFilter) && - Objects.deepEquals(this.datasourcesFilter, other.datasourcesFilter) && - Objects.deepEquals(this.facetFilterSets, other.facetFilterSets) && - Objects.deepEquals(this.context, other.context) && - Objects.deepEquals(this.resultProminence, other.resultProminence); + Utils.enhancedDeepEquals(this.datasourceFilter, other.datasourceFilter) && + Utils.enhancedDeepEquals(this.datasourcesFilter, other.datasourcesFilter) && + Utils.enhancedDeepEquals(this.facetFilterSets, other.facetFilterSets) && + Utils.enhancedDeepEquals(this.context, other.context) && + Utils.enhancedDeepEquals(this.resultProminence, other.resultProminence); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasourceFilter, datasourcesFilter, facetFilterSets, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReferenceRange.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReferenceRange.java index fbe8116c..69f9831a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReferenceRange.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReferenceRange.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -108,13 +107,13 @@ public boolean equals(java.lang.Object o) { } ReferenceRange other = (ReferenceRange) o; return - Objects.deepEquals(this.textRange, other.textRange) && - Objects.deepEquals(this.snippets, other.snippets); + Utils.enhancedDeepEquals(this.textRange, other.textRange) && + Utils.enhancedDeepEquals(this.snippets, other.snippets); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( textRange, snippets); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedDocuments.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedDocuments.java index 17eb5e66..f8eae565 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedDocuments.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedDocuments.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class RelatedDocuments { @@ -226,16 +225,16 @@ public boolean equals(java.lang.Object o) { } RelatedDocuments other = (RelatedDocuments) o; return - Objects.deepEquals(this.relation, other.relation) && - Objects.deepEquals(this.associatedEntityId, other.associatedEntityId) && - Objects.deepEquals(this.querySuggestion, other.querySuggestion) && - Objects.deepEquals(this.documents, other.documents) && - Objects.deepEquals(this.results, other.results); + Utils.enhancedDeepEquals(this.relation, other.relation) && + Utils.enhancedDeepEquals(this.associatedEntityId, other.associatedEntityId) && + Utils.enhancedDeepEquals(this.querySuggestion, other.querySuggestion) && + Utils.enhancedDeepEquals(this.documents, other.documents) && + Utils.enhancedDeepEquals(this.results, other.results); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( relation, associatedEntityId, querySuggestion, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObject.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObject.java index fc3ec334..7d8a6096 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObject.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObject.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class RelatedObject { @@ -104,13 +103,13 @@ public boolean equals(java.lang.Object o) { } RelatedObject other = (RelatedObject) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, metadata); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectEdge.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectEdge.java index 5bc980be..8027513b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectEdge.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectEdge.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class RelatedObjectEdge { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } RelatedObjectEdge other = (RelatedObjectEdge) o; return - Objects.deepEquals(this.objects, other.objects); + Utils.enhancedDeepEquals(this.objects, other.objects); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( objects); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectMetadata.java index b4f6178a..0c3a63b2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedObjectMetadata.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -80,12 +79,12 @@ public boolean equals(java.lang.Object o) { } RelatedObjectMetadata other = (RelatedObjectMetadata) o; return - Objects.deepEquals(this.name, other.name); + Utils.enhancedDeepEquals(this.name, other.name); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedQuestion.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedQuestion.java index e47bbf76..042234af 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedQuestion.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelatedQuestion.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class RelatedQuestion { @@ -150,14 +149,14 @@ public boolean equals(java.lang.Object o) { } RelatedQuestion other = (RelatedQuestion) o; return - Objects.deepEquals(this.question, other.question) && - Objects.deepEquals(this.answer, other.answer) && - Objects.deepEquals(this.ranges, other.ranges); + Utils.enhancedDeepEquals(this.question, other.question) && + Utils.enhancedDeepEquals(this.answer, other.answer) && + Utils.enhancedDeepEquals(this.ranges, other.ranges); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( question, answer, ranges); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Relation.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Relation.java index 9e18b856..c1d0d1e6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Relation.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Relation.java @@ -17,12 +17,14 @@ public enum Relation { ATTACHMENT("ATTACHMENT"), CANONICAL("CANONICAL"), CASE("CASE"), - CONTACT("CONTACT"), + CONTACT_LOWER("contact"), + CONTACT_UPPER("CONTACT"), CONVERSATION_MESSAGES("CONVERSATION_MESSAGES"), EXPERT("EXPERT"), FROM("FROM"), HIGHLIGHT("HIGHLIGHT"), - OPPORTUNITY("OPPORTUNITY"), + OPPORTUNITY_LOWER("opportunity"), + OPPORTUNITY_UPPER("OPPORTUNITY"), RECENT("RECENT"), SOURCE("SOURCE"), TICKET("TICKET"), @@ -32,7 +34,7 @@ public enum Relation { @JsonValue private final String value; - private Relation(String value) { + Relation(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelationType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelationType.java index fcee4c85..a168bfb2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RelationType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RelationType.java @@ -12,12 +12,13 @@ public enum RelationType { EQUALS("EQUALS"), ID_EQUALS("ID_EQUALS"), LT("LT"), - GT("GT"); + GT("GT"), + NOT_EQUALS("NOT_EQUALS"); @JsonValue private final String value; - private RelationType(String value) { + RelationType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Reminder.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Reminder.java index ce08a143..b7a4583b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Reminder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Reminder.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class Reminder { @@ -183,16 +182,16 @@ public boolean equals(java.lang.Object o) { } Reminder other = (Reminder) o; return - Objects.deepEquals(this.assignee, other.assignee) && - Objects.deepEquals(this.requestor, other.requestor) && - Objects.deepEquals(this.remindAt, other.remindAt) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.reason, other.reason); + Utils.enhancedDeepEquals(this.assignee, other.assignee) && + Utils.enhancedDeepEquals(this.requestor, other.requestor) && + Utils.enhancedDeepEquals(this.remindAt, other.remindAt) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.reason, other.reason); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( assignee, requestor, remindAt, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReminderRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReminderRequest.java index 39b6ca1a..f059133b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReminderRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReminderRequest.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ReminderRequest { @@ -175,15 +174,15 @@ public boolean equals(java.lang.Object o) { } ReminderRequest other = (ReminderRequest) o; return - Objects.deepEquals(this.documentId, other.documentId) && - Objects.deepEquals(this.assignee, other.assignee) && - Objects.deepEquals(this.remindInDays, other.remindInDays) && - Objects.deepEquals(this.reason, other.reason); + Utils.enhancedDeepEquals(this.documentId, other.documentId) && + Utils.enhancedDeepEquals(this.assignee, other.assignee) && + Utils.enhancedDeepEquals(this.remindInDays, other.remindInDays) && + Utils.enhancedDeepEquals(this.reason, other.reason); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documentId, assignee, remindInDays, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponse.java index c39c64cf..0d921edd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ReportStatusResponse { @@ -101,13 +100,13 @@ public boolean equals(java.lang.Object o) { } ReportStatusResponse other = (ReportStatusResponse) o; return - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.startTime, other.startTime); + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.startTime, other.startTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( status, startTime); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponseStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponseStatus.java index fa54e7f0..30fa02da 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponseStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ReportStatusResponseStatus.java @@ -19,7 +19,7 @@ public enum ReportStatusResponseStatus { @JsonValue private final String value; - private ReportStatusResponseStatus(String value) { + ReportStatusResponseStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java new file mode 100644 index 00000000..f17068de --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RequestType.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + +/** + * RequestType + * + *

The type of request being made. + */ +public enum RequestType { + STANDARD("STANDARD"), + FULL_DIRECTORY("FULL_DIRECTORY"); + + @JsonValue + private final String value; + + RequestType(String value) { + this.value = value; + } + + public String value() { + return value; + } + + public static Optional fromValue(String value) { + for (RequestType o: RequestType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseHint.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseHint.java index b03dc076..ac720729 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseHint.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseHint.java @@ -23,7 +23,7 @@ public enum ResponseHint { @JsonValue private final String value; - private ResponseHint(String value) { + ResponseHint(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseStatus.java index b5329a78..410a6b11 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResponseStatus.java @@ -17,7 +17,7 @@ public enum ResponseStatus { @JsonValue private final String value; - private ResponseStatus(String value) { + ResponseStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RestrictionFilters.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RestrictionFilters.java index 1d461542..b851e4c7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RestrictionFilters.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RestrictionFilters.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class RestrictionFilters { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } RestrictionFilters other = (RestrictionFilters) o; return - Objects.deepEquals(this.containerSpecs, other.containerSpecs); + Utils.enhancedDeepEquals(this.containerSpecs, other.containerSpecs); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( containerSpecs); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultDocument.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultDocument.java index 830a0c44..0aa6aca2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultDocument.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultDocument.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ResultDocument { @@ -87,13 +86,13 @@ public boolean equals(java.lang.Object o) { } ResultDocument other = (ResultDocument) o; return - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( title, url); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultTab.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultTab.java index 5abf69cd..9800a279 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultTab.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultTab.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ResultTab { @@ -184,15 +183,15 @@ public boolean equals(java.lang.Object o) { } ResultTab other = (ResultTab) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.datasourceInstance, other.datasourceInstance); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.datasourceInstance, other.datasourceInstance); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, count, datasource, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsDescription.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsDescription.java index 7f8a4782..d67af31a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsDescription.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsDescription.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ResultsDescription { @@ -113,13 +112,13 @@ public boolean equals(java.lang.Object o) { } ResultsDescription other = (ResultsDescription) o; return - Objects.deepEquals(this.text, other.text) && - Objects.deepEquals(this.iconConfig, other.iconConfig); + Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.iconConfig, other.iconConfig); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( text, iconConfig); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsResponse.java index 1bf48c75..9de9798b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ResultsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ResultsResponse { @@ -275,19 +274,19 @@ public boolean equals(java.lang.Object o) { } ResultsResponse other = (ResultsResponse) o; return - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.results, other.results) && - Objects.deepEquals(this.structuredResults, other.structuredResults) && - Objects.deepEquals(this.generatedQnaResult, other.generatedQnaResult) && - Objects.deepEquals(this.gleanDataError, other.gleanDataError) && - Objects.deepEquals(this.requestID, other.requestID) && - Objects.deepEquals(this.backendTimeMillis, other.backendTimeMillis); + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.results, other.results) && + Utils.enhancedDeepEquals(this.structuredResults, other.structuredResults) && + Utils.enhancedDeepEquals(this.generatedQnaResult, other.generatedQnaResult) && + Utils.enhancedDeepEquals(this.gleanDataError, other.gleanDataError) && + Utils.enhancedDeepEquals(this.requestID, other.requestID) && + Utils.enhancedDeepEquals(this.backendTimeMillis, other.backendTimeMillis); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( trackingToken, sessionInfo, results, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Role.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Role.java index 7816def0..1b338c82 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Role.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Role.java @@ -25,7 +25,7 @@ public enum Role { @JsonValue private final String value; - private Role(String value) { + Role(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/RotateTokenResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/RotateTokenResponse.java index 8e5b300c..1a26c6e2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/RotateTokenResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/RotateTokenResponse.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -153,14 +152,14 @@ public boolean equals(java.lang.Object o) { } RotateTokenResponse other = (RotateTokenResponse) o; return - Objects.deepEquals(this.rawSecret, other.rawSecret) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.rotationPeriodMinutes, other.rotationPeriodMinutes); + Utils.enhancedDeepEquals(this.rawSecret, other.rawSecret) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.rotationPeriodMinutes, other.rotationPeriodMinutes); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( rawSecret, createdAt, rotationPeriodMinutes); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Scope.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Scope.java index bde5bb88..c918116d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Scope.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Scope.java @@ -18,7 +18,7 @@ public enum Scope { @JsonValue private final String value; - private Scope(String value) { + Scope(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ScopeType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ScopeType.java index 96f975a8..30ab7566 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ScopeType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ScopeType.java @@ -20,7 +20,7 @@ public enum ScopeType { @JsonValue private final String value; - private ScopeType(String value) { + ScopeType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsRequest.java index a4ee4be3..a33daf2f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsRequest.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class SearchAgentsRequest { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } SearchAgentsRequest other = (SearchAgentsRequest) o; return - Objects.deepEquals(this.name, other.name); + Utils.enhancedDeepEquals(this.name, other.name); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsResponse.java index c0af84e2..b1893f24 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchAgentsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchAgentsResponse { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } SearchAgentsResponse other = (SearchAgentsResponse) o; return - Objects.deepEquals(this.agents, other.agents); + Utils.enhancedDeepEquals(this.agents, other.agents); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( agents); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchProviderInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchProviderInfo.java index d5c8ebb4..723e2a28 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchProviderInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchProviderInfo.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class SearchProviderInfo { @@ -147,14 +146,14 @@ public boolean equals(java.lang.Object o) { } SearchProviderInfo other = (SearchProviderInfo) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.logoUrl, other.logoUrl) && - Objects.deepEquals(this.searchLinkUrlTemplate, other.searchLinkUrlTemplate); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.logoUrl, other.logoUrl) && + Utils.enhancedDeepEquals(this.searchLinkUrlTemplate, other.searchLinkUrlTemplate); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, logoUrl, searchLinkUrlTemplate); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequest.java index 57af1474..40021ca2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequest.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchRequest { @@ -497,25 +496,25 @@ public boolean equals(java.lang.Object o) { } SearchRequest other = (SearchRequest) o; return - Objects.deepEquals(this.timestamp, other.timestamp) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.sourceDocument, other.sourceDocument) && - Objects.deepEquals(this.pageSize, other.pageSize) && - Objects.deepEquals(this.maxSnippetSize, other.maxSnippetSize) && - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.cursor, other.cursor) && - Objects.deepEquals(this.resultTabIds, other.resultTabIds) && - Objects.deepEquals(this.inputDetails, other.inputDetails) && - Objects.deepEquals(this.requestOptions, other.requestOptions) && - Objects.deepEquals(this.timeoutMillis, other.timeoutMillis) && - Objects.deepEquals(this.people, other.people) && - Objects.deepEquals(this.disableSpellcheck, other.disableSpellcheck); + Utils.enhancedDeepEquals(this.timestamp, other.timestamp) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.sourceDocument, other.sourceDocument) && + Utils.enhancedDeepEquals(this.pageSize, other.pageSize) && + Utils.enhancedDeepEquals(this.maxSnippetSize, other.maxSnippetSize) && + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.resultTabIds, other.resultTabIds) && + Utils.enhancedDeepEquals(this.inputDetails, other.inputDetails) && + Utils.enhancedDeepEquals(this.requestOptions, other.requestOptions) && + Utils.enhancedDeepEquals(this.timeoutMillis, other.timeoutMillis) && + Utils.enhancedDeepEquals(this.people, other.people) && + Utils.enhancedDeepEquals(this.disableSpellcheck, other.disableSpellcheck); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timestamp, trackingToken, sessionInfo, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestInputDetails.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestInputDetails.java index cc037323..dcc16ed3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestInputDetails.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestInputDetails.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class SearchRequestInputDetails { @@ -76,12 +75,12 @@ public boolean equals(java.lang.Object o) { } SearchRequestInputDetails other = (SearchRequestInputDetails) o; return - Objects.deepEquals(this.hasCopyPaste, other.hasCopyPaste); + Utils.enhancedDeepEquals(this.hasCopyPaste, other.hasCopyPaste); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( hasCopyPaste); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestOptions.java index 86af59ac..e05d9ce6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchRequestOptions.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchRequestOptions { @@ -619,28 +618,28 @@ public boolean equals(java.lang.Object o) { } SearchRequestOptions other = (SearchRequestOptions) o; return - Objects.deepEquals(this.datasourceFilter, other.datasourceFilter) && - Objects.deepEquals(this.datasourcesFilter, other.datasourcesFilter) && - Objects.deepEquals(this.queryOverridesFacetFilters, other.queryOverridesFacetFilters) && - Objects.deepEquals(this.facetFilters, other.facetFilters) && - Objects.deepEquals(this.facetFilterSets, other.facetFilterSets) && - Objects.deepEquals(this.facetBucketFilter, other.facetBucketFilter) && - Objects.deepEquals(this.facetBucketSize, other.facetBucketSize) && - Objects.deepEquals(this.defaultFacets, other.defaultFacets) && - Objects.deepEquals(this.authTokens, other.authTokens) && - Objects.deepEquals(this.fetchAllDatasourceCounts, other.fetchAllDatasourceCounts) && - Objects.deepEquals(this.responseHints, other.responseHints) && - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.disableSpellcheck, other.disableSpellcheck) && - Objects.deepEquals(this.disableQueryAutocorrect, other.disableQueryAutocorrect) && - Objects.deepEquals(this.returnLlmContentOverSnippets, other.returnLlmContentOverSnippets) && - Objects.deepEquals(this.inclusions, other.inclusions) && - Objects.deepEquals(this.exclusions, other.exclusions); + Utils.enhancedDeepEquals(this.datasourceFilter, other.datasourceFilter) && + Utils.enhancedDeepEquals(this.datasourcesFilter, other.datasourcesFilter) && + Utils.enhancedDeepEquals(this.queryOverridesFacetFilters, other.queryOverridesFacetFilters) && + Utils.enhancedDeepEquals(this.facetFilters, other.facetFilters) && + Utils.enhancedDeepEquals(this.facetFilterSets, other.facetFilterSets) && + Utils.enhancedDeepEquals(this.facetBucketFilter, other.facetBucketFilter) && + Utils.enhancedDeepEquals(this.facetBucketSize, other.facetBucketSize) && + Utils.enhancedDeepEquals(this.defaultFacets, other.defaultFacets) && + Utils.enhancedDeepEquals(this.authTokens, other.authTokens) && + Utils.enhancedDeepEquals(this.fetchAllDatasourceCounts, other.fetchAllDatasourceCounts) && + Utils.enhancedDeepEquals(this.responseHints, other.responseHints) && + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.disableSpellcheck, other.disableSpellcheck) && + Utils.enhancedDeepEquals(this.disableQueryAutocorrect, other.disableQueryAutocorrect) && + Utils.enhancedDeepEquals(this.returnLlmContentOverSnippets, other.returnLlmContentOverSnippets) && + Utils.enhancedDeepEquals(this.inclusions, other.inclusions) && + Utils.enhancedDeepEquals(this.exclusions, other.exclusions); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasourceFilter, datasourcesFilter, queryOverridesFacetFilters, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponse.java index e39ef50b..4571eb84 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponse.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchResponse { @@ -571,28 +570,28 @@ public boolean equals(java.lang.Object o) { } SearchResponse other = (SearchResponse) o; return - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.sessionInfo, other.sessionInfo) && - Objects.deepEquals(this.results, other.results) && - Objects.deepEquals(this.structuredResults, other.structuredResults) && - Objects.deepEquals(this.generatedQnaResult, other.generatedQnaResult) && - Objects.deepEquals(this.gleanDataError, other.gleanDataError) && - Objects.deepEquals(this.requestID, other.requestID) && - Objects.deepEquals(this.backendTimeMillis, other.backendTimeMillis) && - Objects.deepEquals(this.experimentIds, other.experimentIds) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.facetResults, other.facetResults) && - Objects.deepEquals(this.resultTabs, other.resultTabs) && - Objects.deepEquals(this.resultTabIds, other.resultTabIds) && - Objects.deepEquals(this.resultsDescription, other.resultsDescription) && - Objects.deepEquals(this.rewrittenFacetFilters, other.rewrittenFacetFilters) && - Objects.deepEquals(this.cursor, other.cursor) && - Objects.deepEquals(this.hasMoreResults, other.hasMoreResults); + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.sessionInfo, other.sessionInfo) && + Utils.enhancedDeepEquals(this.results, other.results) && + Utils.enhancedDeepEquals(this.structuredResults, other.structuredResults) && + Utils.enhancedDeepEquals(this.generatedQnaResult, other.generatedQnaResult) && + Utils.enhancedDeepEquals(this.gleanDataError, other.gleanDataError) && + Utils.enhancedDeepEquals(this.requestID, other.requestID) && + Utils.enhancedDeepEquals(this.backendTimeMillis, other.backendTimeMillis) && + Utils.enhancedDeepEquals(this.experimentIds, other.experimentIds) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.facetResults, other.facetResults) && + Utils.enhancedDeepEquals(this.resultTabs, other.resultTabs) && + Utils.enhancedDeepEquals(this.resultTabIds, other.resultTabIds) && + Utils.enhancedDeepEquals(this.resultsDescription, other.resultsDescription) && + Utils.enhancedDeepEquals(this.rewrittenFacetFilters, other.rewrittenFacetFilters) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.hasMoreResults, other.hasMoreResults); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( trackingToken, sessionInfo, results, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponseMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponseMetadata.java index 932246a8..fbabe1e3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponseMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResponseMetadata.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchResponseMetadata { @@ -443,23 +442,23 @@ public boolean equals(java.lang.Object o) { } SearchResponseMetadata other = (SearchResponseMetadata) o; return - Objects.deepEquals(this.rewrittenQuery, other.rewrittenQuery) && - Objects.deepEquals(this.searchedQuery, other.searchedQuery) && - Objects.deepEquals(this.searchedQueryRanges, other.searchedQueryRanges) && - Objects.deepEquals(this.originalQuery, other.originalQuery) && - Objects.deepEquals(this.querySuggestion, other.querySuggestion) && - Objects.deepEquals(this.additionalQuerySuggestions, other.additionalQuerySuggestions) && - Objects.deepEquals(this.negatedTerms, other.negatedTerms) && - Objects.deepEquals(this.modifiedQueryWasUsed, other.modifiedQueryWasUsed) && - Objects.deepEquals(this.originalQueryHadNoResults, other.originalQueryHadNoResults) && - Objects.deepEquals(this.searchWarning, other.searchWarning) && - Objects.deepEquals(this.triggeredExpertDetection, other.triggeredExpertDetection) && - Objects.deepEquals(this.isNoQuotesSuggestion, other.isNoQuotesSuggestion); + Utils.enhancedDeepEquals(this.rewrittenQuery, other.rewrittenQuery) && + Utils.enhancedDeepEquals(this.searchedQuery, other.searchedQuery) && + Utils.enhancedDeepEquals(this.searchedQueryRanges, other.searchedQueryRanges) && + Utils.enhancedDeepEquals(this.originalQuery, other.originalQuery) && + Utils.enhancedDeepEquals(this.querySuggestion, other.querySuggestion) && + Utils.enhancedDeepEquals(this.additionalQuerySuggestions, other.additionalQuerySuggestions) && + Utils.enhancedDeepEquals(this.negatedTerms, other.negatedTerms) && + Utils.enhancedDeepEquals(this.modifiedQueryWasUsed, other.modifiedQueryWasUsed) && + Utils.enhancedDeepEquals(this.originalQueryHadNoResults, other.originalQueryHadNoResults) && + Utils.enhancedDeepEquals(this.searchWarning, other.searchWarning) && + Utils.enhancedDeepEquals(this.triggeredExpertDetection, other.triggeredExpertDetection) && + Utils.enhancedDeepEquals(this.isNoQuotesSuggestion, other.isNoQuotesSuggestion); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( rewrittenQuery, searchedQuery, searchedQueryRanges, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResult.java index ea2c6fec..e02d502c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResult.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchResult { @@ -746,32 +745,32 @@ public boolean equals(java.lang.Object o) { } SearchResult other = (SearchResult) o; return - Objects.deepEquals(this.structuredResults, other.structuredResults) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.nativeAppUrl, other.nativeAppUrl) && - Objects.deepEquals(this.snippets, other.snippets) && - Objects.deepEquals(this.fullText, other.fullText) && - Objects.deepEquals(this.fullTextList, other.fullTextList) && - Objects.deepEquals(this.relatedResults, other.relatedResults) && - Objects.deepEquals(this.clusteredResults, other.clusteredResults) && - Objects.deepEquals(this.allClusteredResults, other.allClusteredResults) && - Objects.deepEquals(this.attachmentCount, other.attachmentCount) && - Objects.deepEquals(this.attachments, other.attachments) && - Objects.deepEquals(this.backlinkResults, other.backlinkResults) && - Objects.deepEquals(this.clusterType, other.clusterType) && - Objects.deepEquals(this.mustIncludeSuggestions, other.mustIncludeSuggestions) && - Objects.deepEquals(this.querySuggestion, other.querySuggestion) && - Objects.deepEquals(this.prominence, other.prominence) && - Objects.deepEquals(this.attachmentContext, other.attachmentContext) && - Objects.deepEquals(this.pins, other.pins); + Utils.enhancedDeepEquals(this.structuredResults, other.structuredResults) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.nativeAppUrl, other.nativeAppUrl) && + Utils.enhancedDeepEquals(this.snippets, other.snippets) && + Utils.enhancedDeepEquals(this.fullText, other.fullText) && + Utils.enhancedDeepEquals(this.fullTextList, other.fullTextList) && + Utils.enhancedDeepEquals(this.relatedResults, other.relatedResults) && + Utils.enhancedDeepEquals(this.clusteredResults, other.clusteredResults) && + Utils.enhancedDeepEquals(this.allClusteredResults, other.allClusteredResults) && + Utils.enhancedDeepEquals(this.attachmentCount, other.attachmentCount) && + Utils.enhancedDeepEquals(this.attachments, other.attachments) && + Utils.enhancedDeepEquals(this.backlinkResults, other.backlinkResults) && + Utils.enhancedDeepEquals(this.clusterType, other.clusterType) && + Utils.enhancedDeepEquals(this.mustIncludeSuggestions, other.mustIncludeSuggestions) && + Utils.enhancedDeepEquals(this.querySuggestion, other.querySuggestion) && + Utils.enhancedDeepEquals(this.prominence, other.prominence) && + Utils.enhancedDeepEquals(this.attachmentContext, other.attachmentContext) && + Utils.enhancedDeepEquals(this.pins, other.pins); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( structuredResults, trackingToken, document, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultProminenceEnum.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultProminenceEnum.java index b6104825..1cab9d2f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultProminenceEnum.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultProminenceEnum.java @@ -21,7 +21,7 @@ public enum SearchResultProminenceEnum { @JsonValue private final String value; - private SearchResultProminenceEnum(String value) { + SearchResultProminenceEnum(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultSnippet.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultSnippet.java index 3ffbaf79..dbb9cd14 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultSnippet.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchResultSnippet.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchResultSnippet { @@ -250,17 +249,17 @@ public boolean equals(java.lang.Object o) { } SearchResultSnippet other = (SearchResultSnippet) o; return - Objects.deepEquals(this.snippet, other.snippet) && - Objects.deepEquals(this.mimeType, other.mimeType) && - Objects.deepEquals(this.text, other.text) && - Objects.deepEquals(this.snippetTextOrdering, other.snippetTextOrdering) && - Objects.deepEquals(this.ranges, other.ranges) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.snippet, other.snippet) && + Utils.enhancedDeepEquals(this.mimeType, other.mimeType) && + Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.snippetTextOrdering, other.snippetTextOrdering) && + Utils.enhancedDeepEquals(this.ranges, other.ranges) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( snippet, mimeType, text, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchWarning.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchWarning.java index 1af459c0..31581857 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchWarning.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SearchWarning.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SearchWarning { @@ -177,15 +176,15 @@ public boolean equals(java.lang.Object o) { } SearchWarning other = (SearchWarning) o; return - Objects.deepEquals(this.warningType, other.warningType) && - Objects.deepEquals(this.lastUsedTerm, other.lastUsedTerm) && - Objects.deepEquals(this.quotesIgnoredQuery, other.quotesIgnoredQuery) && - Objects.deepEquals(this.ignoredTerms, other.ignoredTerms); + Utils.enhancedDeepEquals(this.warningType, other.warningType) && + Utils.enhancedDeepEquals(this.lastUsedTerm, other.lastUsedTerm) && + Utils.enhancedDeepEquals(this.quotesIgnoredQuery, other.quotesIgnoredQuery) && + Utils.enhancedDeepEquals(this.ignoredTerms, other.ignoredTerms); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( warningType, lastUsedTerm, quotesIgnoredQuery, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Security.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Security.java index b98d4a73..595b36b9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Security.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Security.java @@ -10,7 +10,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class Security implements HasSecurity { @@ -50,12 +49,12 @@ public boolean equals(java.lang.Object o) { } Security other = (Security) o; return - Objects.deepEquals(this.apiToken, other.apiToken); + Utils.enhancedDeepEquals(this.apiToken, other.apiToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( apiToken); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SeenFeedbackInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SeenFeedbackInfo.java index c1d124df..6b2a8404 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SeenFeedbackInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SeenFeedbackInfo.java @@ -12,7 +12,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class SeenFeedbackInfo { @@ -76,12 +75,12 @@ public boolean equals(java.lang.Object o) { } SeenFeedbackInfo other = (SeenFeedbackInfo) o; return - Objects.deepEquals(this.isExplicit, other.isExplicit); + Utils.enhancedDeepEquals(this.isExplicit, other.isExplicit); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( isExplicit); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveContentOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveContentOptions.java index e31fcfe0..33e3ca42 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveContentOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveContentOptions.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -157,14 +156,14 @@ public boolean equals(java.lang.Object o) { } SensitiveContentOptions other = (SensitiveContentOptions) o; return - Objects.deepEquals(this.sensitiveInfoTypes, other.sensitiveInfoTypes) && - Objects.deepEquals(this.sensitiveTerms, other.sensitiveTerms) && - Objects.deepEquals(this.sensitiveRegexes, other.sensitiveRegexes); + Utils.enhancedDeepEquals(this.sensitiveInfoTypes, other.sensitiveInfoTypes) && + Utils.enhancedDeepEquals(this.sensitiveTerms, other.sensitiveTerms) && + Utils.enhancedDeepEquals(this.sensitiveRegexes, other.sensitiveRegexes); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( sensitiveInfoTypes, sensitiveTerms, sensitiveRegexes); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveExpression.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveExpression.java index a74a12a0..dd05f12d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveExpression.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveExpression.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class SensitiveExpression { @@ -114,13 +113,13 @@ public boolean equals(java.lang.Object o) { } SensitiveExpression other = (SensitiveExpression) o; return - Objects.deepEquals(this.expression, other.expression) && - Objects.deepEquals(this.hotwords, other.hotwords); + Utils.enhancedDeepEquals(this.expression, other.expression) && + Utils.enhancedDeepEquals(this.hotwords, other.hotwords); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( expression, hotwords); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveInfoType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveInfoType.java index d41f67ab..f04d39ec 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveInfoType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SensitiveInfoType.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class SensitiveInfoType { @@ -122,13 +121,13 @@ public boolean equals(java.lang.Object o) { } SensitiveInfoType other = (SensitiveInfoType) o; return - Objects.deepEquals(this.likelihoodThreshold, other.likelihoodThreshold) && - Objects.deepEquals(this.infoType, other.infoType); + Utils.enhancedDeepEquals(this.likelihoodThreshold, other.likelihoodThreshold) && + Utils.enhancedDeepEquals(this.infoType, other.infoType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( likelihoodThreshold, infoType); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SessionInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SessionInfo.java index c5d3cfbc..ef040970 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SessionInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SessionInfo.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class SessionInfo { @@ -184,15 +183,15 @@ public boolean equals(java.lang.Object o) { } SessionInfo other = (SessionInfo) o; return - Objects.deepEquals(this.sessionTrackingToken, other.sessionTrackingToken) && - Objects.deepEquals(this.tabId, other.tabId) && - Objects.deepEquals(this.lastSeen, other.lastSeen) && - Objects.deepEquals(this.lastQuery, other.lastQuery); + Utils.enhancedDeepEquals(this.sessionTrackingToken, other.sessionTrackingToken) && + Utils.enhancedDeepEquals(this.tabId, other.tabId) && + Utils.enhancedDeepEquals(this.lastSeen, other.lastSeen) && + Utils.enhancedDeepEquals(this.lastQuery, other.lastQuery); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( sessionTrackingToken, tabId, lastSeen, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Share.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Share.java index f1266510..fd7d8143 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Share.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Share.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -123,14 +122,14 @@ public boolean equals(java.lang.Object o) { } Share other = (Share) o; return - Objects.deepEquals(this.numDaysAgo, other.numDaysAgo) && - Objects.deepEquals(this.sharer, other.sharer) && - Objects.deepEquals(this.sharingDocument, other.sharingDocument); + Utils.enhancedDeepEquals(this.numDaysAgo, other.numDaysAgo) && + Utils.enhancedDeepEquals(this.sharer, other.sharer) && + Utils.enhancedDeepEquals(this.sharingDocument, other.sharingDocument); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( numDaysAgo, sharer, sharingDocument); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SharingOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SharingOptions.java index 982df2be..026b82f6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SharingOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SharingOptions.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -354,19 +353,19 @@ public boolean equals(java.lang.Object o) { } SharingOptions other = (SharingOptions) o; return - Objects.deepEquals(this.enabled, other.enabled) && - Objects.deepEquals(this.threshold, other.threshold) && - Objects.deepEquals(this.thresholdEnabled, other.thresholdEnabled) && - Objects.deepEquals(this.anyoneWithLinkEnabled, other.anyoneWithLinkEnabled) && - Objects.deepEquals(this.anyoneInternalEnabled, other.anyoneInternalEnabled) && - Objects.deepEquals(this.anonymousAccessEnabled, other.anonymousAccessEnabled) && - Objects.deepEquals(this.userAccessEnabled, other.userAccessEnabled) && - Objects.deepEquals(this.userIds, other.userIds); + Utils.enhancedDeepEquals(this.enabled, other.enabled) && + Utils.enhancedDeepEquals(this.threshold, other.threshold) && + Utils.enhancedDeepEquals(this.thresholdEnabled, other.thresholdEnabled) && + Utils.enhancedDeepEquals(this.anyoneWithLinkEnabled, other.anyoneWithLinkEnabled) && + Utils.enhancedDeepEquals(this.anyoneInternalEnabled, other.anyoneInternalEnabled) && + Utils.enhancedDeepEquals(this.anonymousAccessEnabled, other.anonymousAccessEnabled) && + Utils.enhancedDeepEquals(this.userAccessEnabled, other.userAccessEnabled) && + Utils.enhancedDeepEquals(this.userIds, other.userIds); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( enabled, threshold, thresholdEnabled, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Shortcut.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Shortcut.java index 20cddd2e..d8808a91 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Shortcut.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Shortcut.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Shortcut { @@ -786,33 +785,33 @@ public boolean equals(java.lang.Object o) { } Shortcut other = (Shortcut) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.inputAlias, other.inputAlias) && - Objects.deepEquals(this.destinationUrl, other.destinationUrl) && - Objects.deepEquals(this.destinationDocumentId, other.destinationDocumentId) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.unlisted, other.unlisted) && - Objects.deepEquals(this.urlTemplate, other.urlTemplate) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.createTime, other.createTime) && - Objects.deepEquals(this.updatedBy, other.updatedBy) && - Objects.deepEquals(this.updateTime, other.updateTime) && - Objects.deepEquals(this.destinationDocument, other.destinationDocument) && - Objects.deepEquals(this.intermediateUrl, other.intermediateUrl) && - Objects.deepEquals(this.viewPrefix, other.viewPrefix) && - Objects.deepEquals(this.isExternal, other.isExternal) && - Objects.deepEquals(this.editUrl, other.editUrl) && - Objects.deepEquals(this.alias, other.alias) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.roles, other.roles); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.inputAlias, other.inputAlias) && + Utils.enhancedDeepEquals(this.destinationUrl, other.destinationUrl) && + Utils.enhancedDeepEquals(this.destinationDocumentId, other.destinationDocumentId) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.unlisted, other.unlisted) && + Utils.enhancedDeepEquals(this.urlTemplate, other.urlTemplate) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.createTime, other.createTime) && + Utils.enhancedDeepEquals(this.updatedBy, other.updatedBy) && + Utils.enhancedDeepEquals(this.updateTime, other.updateTime) && + Utils.enhancedDeepEquals(this.destinationDocument, other.destinationDocument) && + Utils.enhancedDeepEquals(this.intermediateUrl, other.intermediateUrl) && + Utils.enhancedDeepEquals(this.viewPrefix, other.viewPrefix) && + Utils.enhancedDeepEquals(this.isExternal, other.isExternal) && + Utils.enhancedDeepEquals(this.editUrl, other.editUrl) && + Utils.enhancedDeepEquals(this.alias, other.alias) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.roles, other.roles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, inputAlias, destinationUrl, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutError.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutError.java index 8865d0f5..41d2ca43 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutError.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ShortcutError { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } ShortcutError other = (ShortcutError) o; return - Objects.deepEquals(this.errorType, other.errorType); + Utils.enhancedDeepEquals(this.errorType, other.errorType); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( errorType); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutErrorErrorType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutErrorErrorType.java index df00fbe7..66ed90a1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutErrorErrorType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutErrorErrorType.java @@ -17,7 +17,7 @@ public enum ShortcutErrorErrorType { @JsonValue private final String value; - private ShortcutErrorErrorType(String value) { + ShortcutErrorErrorType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsight.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsight.java index 6cbce19c..40a7580a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsight.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsight.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class ShortcutInsight { @@ -108,14 +107,14 @@ public boolean equals(java.lang.Object o) { } ShortcutInsight other = (ShortcutInsight) o; return - Objects.deepEquals(this.shortcut, other.shortcut) && - Objects.deepEquals(this.visitCount, other.visitCount) && - Objects.deepEquals(this.visitorCount, other.visitorCount); + Utils.enhancedDeepEquals(this.shortcut, other.shortcut) && + Utils.enhancedDeepEquals(this.visitCount, other.visitCount) && + Utils.enhancedDeepEquals(this.visitorCount, other.visitorCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( shortcut, visitCount, visitorCount); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsightsResponse.java index fac53904..07f7e114 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutInsightsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ShortcutInsightsResponse { @@ -188,15 +187,15 @@ public boolean equals(java.lang.Object o) { } ShortcutInsightsResponse other = (ShortcutInsightsResponse) o; return - Objects.deepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && - Objects.deepEquals(this.shortcutInsights, other.shortcutInsights) && - Objects.deepEquals(this.departments, other.departments) && - Objects.deepEquals(this.minVisitorThreshold, other.minVisitorThreshold); + Utils.enhancedDeepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && + Utils.enhancedDeepEquals(this.shortcutInsights, other.shortcutInsights) && + Utils.enhancedDeepEquals(this.departments, other.departments) && + Utils.enhancedDeepEquals(this.minVisitorThreshold, other.minVisitorThreshold); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastLogTimestamp, shortcutInsights, departments, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutMutableProperties.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutMutableProperties.java index 66ca1231..17ac41ad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutMutableProperties.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutMutableProperties.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ShortcutMutableProperties { @@ -332,19 +331,19 @@ public boolean equals(java.lang.Object o) { } ShortcutMutableProperties other = (ShortcutMutableProperties) o; return - Objects.deepEquals(this.inputAlias, other.inputAlias) && - Objects.deepEquals(this.destinationUrl, other.destinationUrl) && - Objects.deepEquals(this.destinationDocumentId, other.destinationDocumentId) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.unlisted, other.unlisted) && - Objects.deepEquals(this.urlTemplate, other.urlTemplate) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles); + Utils.enhancedDeepEquals(this.inputAlias, other.inputAlias) && + Utils.enhancedDeepEquals(this.destinationUrl, other.destinationUrl) && + Utils.enhancedDeepEquals(this.destinationDocumentId, other.destinationDocumentId) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.unlisted, other.unlisted) && + Utils.enhancedDeepEquals(this.urlTemplate, other.urlTemplate) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( inputAlias, destinationUrl, destinationDocumentId, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutsPaginationMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutsPaginationMetadata.java index fa36f336..51014f12 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutsPaginationMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ShortcutsPaginationMetadata.java @@ -13,7 +13,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ShortcutsPaginationMetadata { @@ -125,14 +124,14 @@ public boolean equals(java.lang.Object o) { } ShortcutsPaginationMetadata other = (ShortcutsPaginationMetadata) o; return - Objects.deepEquals(this.cursor, other.cursor) && - Objects.deepEquals(this.hasNextPage, other.hasNextPage) && - Objects.deepEquals(this.totalItemCount, other.totalItemCount); + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.hasNextPage, other.hasNextPage) && + Utils.enhancedDeepEquals(this.totalItemCount, other.totalItemCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( cursor, hasNextPage, totalItemCount); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetwork.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetwork.java index 7f56538c..6c2816e3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetwork.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetwork.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class SocialNetwork { @@ -129,14 +128,14 @@ public boolean equals(java.lang.Object o) { } SocialNetwork other = (SocialNetwork) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.profileName, other.profileName) && - Objects.deepEquals(this.profileUrl, other.profileUrl); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.profileName, other.profileName) && + Utils.enhancedDeepEquals(this.profileUrl, other.profileUrl); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, profileName, profileUrl); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetworkDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetworkDefinition.java index c4116224..847ecd20 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetworkDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SocialNetworkDefinition.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -152,14 +151,14 @@ public boolean equals(java.lang.Object o) { } SocialNetworkDefinition other = (SocialNetworkDefinition) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.profileName, other.profileName) && - Objects.deepEquals(this.profileUrl, other.profileUrl); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.profileName, other.profileName) && + Utils.enhancedDeepEquals(this.profileUrl, other.profileUrl); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, profileName, profileUrl); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SortOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SortOptions.java index 2af48af1..312a18a5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SortOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SortOptions.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class SortOptions { @@ -89,13 +88,13 @@ public boolean equals(java.lang.Object o) { } SortOptions other = (SortOptions) o; return - Objects.deepEquals(this.orderBy, other.orderBy) && - Objects.deepEquals(this.sortBy, other.sortBy); + Utils.enhancedDeepEquals(this.orderBy, other.orderBy) && + Utils.enhancedDeepEquals(this.sortBy, other.sortBy); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( orderBy, sortBy); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/State.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/State.java index 118f0db7..f1ae2d74 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/State.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/State.java @@ -21,7 +21,7 @@ public enum State { @JsonValue private final String value; - private State(String value) { + State(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLink.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLink.java index 0eab6891..f98421e0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLink.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLink.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -154,14 +153,14 @@ public boolean equals(java.lang.Object o) { } StructuredLink other = (StructuredLink) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.iconConfig, other.iconConfig); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.iconConfig, other.iconConfig); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, url, iconConfig); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLocation.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLocation.java index d46962f6..f087fcef 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLocation.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredLocation.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -368,20 +367,20 @@ public boolean equals(java.lang.Object o) { } StructuredLocation other = (StructuredLocation) o; return - Objects.deepEquals(this.deskLocation, other.deskLocation) && - Objects.deepEquals(this.timezone, other.timezone) && - Objects.deepEquals(this.address, other.address) && - Objects.deepEquals(this.city, other.city) && - Objects.deepEquals(this.state, other.state) && - Objects.deepEquals(this.region, other.region) && - Objects.deepEquals(this.zipCode, other.zipCode) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.countryCode, other.countryCode); + Utils.enhancedDeepEquals(this.deskLocation, other.deskLocation) && + Utils.enhancedDeepEquals(this.timezone, other.timezone) && + Utils.enhancedDeepEquals(this.address, other.address) && + Utils.enhancedDeepEquals(this.city, other.city) && + Utils.enhancedDeepEquals(this.state, other.state) && + Utils.enhancedDeepEquals(this.region, other.region) && + Utils.enhancedDeepEquals(this.zipCode, other.zipCode) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.countryCode, other.countryCode); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( deskLocation, timezone, address, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResult.java index bf7c26e5..d0c175e6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResult.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -642,32 +641,32 @@ public boolean equals(java.lang.Object o) { } StructuredResult other = (StructuredResult) o; return - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.person, other.person) && - Objects.deepEquals(this.customer, other.customer) && - Objects.deepEquals(this.team, other.team) && - Objects.deepEquals(this.customEntity, other.customEntity) && - Objects.deepEquals(this.answer, other.answer) && - Objects.deepEquals(this.extractedQnA, other.extractedQnA) && - Objects.deepEquals(this.meeting, other.meeting) && - Objects.deepEquals(this.app, other.app) && - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.answerBoard, other.answerBoard) && - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.shortcut, other.shortcut) && - Objects.deepEquals(this.querySuggestions, other.querySuggestions) && - Objects.deepEquals(this.relatedDocuments, other.relatedDocuments) && - Objects.deepEquals(this.relatedQuestion, other.relatedQuestion) && - Objects.deepEquals(this.disambiguation, other.disambiguation) && - Objects.deepEquals(this.snippets, other.snippets) && - Objects.deepEquals(this.trackingToken, other.trackingToken) && - Objects.deepEquals(this.prominence, other.prominence) && - Objects.deepEquals(this.source, other.source); + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.person, other.person) && + Utils.enhancedDeepEquals(this.customer, other.customer) && + Utils.enhancedDeepEquals(this.team, other.team) && + Utils.enhancedDeepEquals(this.customEntity, other.customEntity) && + Utils.enhancedDeepEquals(this.answer, other.answer) && + Utils.enhancedDeepEquals(this.extractedQnA, other.extractedQnA) && + Utils.enhancedDeepEquals(this.meeting, other.meeting) && + Utils.enhancedDeepEquals(this.app, other.app) && + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.answerBoard, other.answerBoard) && + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.shortcut, other.shortcut) && + Utils.enhancedDeepEquals(this.querySuggestions, other.querySuggestions) && + Utils.enhancedDeepEquals(this.relatedDocuments, other.relatedDocuments) && + Utils.enhancedDeepEquals(this.relatedQuestion, other.relatedQuestion) && + Utils.enhancedDeepEquals(this.disambiguation, other.disambiguation) && + Utils.enhancedDeepEquals(this.snippets, other.snippets) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken) && + Utils.enhancedDeepEquals(this.prominence, other.prominence) && + Utils.enhancedDeepEquals(this.source, other.source); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( document, person, customer, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResultSource.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResultSource.java index b93b4cb3..66f87264 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResultSource.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResultSource.java @@ -20,7 +20,7 @@ public enum StructuredResultSource { @JsonValue private final String value; - private StructuredResultSource(String value) { + StructuredResultSource(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredText.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredText.java index 206121e5..6dcd7c33 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredText.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredText.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class StructuredText { @@ -96,13 +95,13 @@ public boolean equals(java.lang.Object o) { } StructuredText other = (StructuredText) o; return - Objects.deepEquals(this.text, other.text) && - Objects.deepEquals(this.structuredList, other.structuredList); + Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.structuredList, other.structuredList); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( text, structuredList); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextItem.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextItem.java index e3644579..8225f8dd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextItem.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextItem.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class StructuredTextItem { @@ -150,15 +149,15 @@ public boolean equals(java.lang.Object o) { } StructuredTextItem other = (StructuredTextItem) o; return - Objects.deepEquals(this.link, other.link) && - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.text, other.text) && - Objects.deepEquals(this.structuredResult, other.structuredResult); + Utils.enhancedDeepEquals(this.link, other.link) && + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.structuredResult, other.structuredResult); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( link, document, text, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextMutableProperties.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextMutableProperties.java index 768d1405..36d40a2f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextMutableProperties.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredTextMutableProperties.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class StructuredTextMutableProperties { @@ -49,12 +48,12 @@ public boolean equals(java.lang.Object o) { } StructuredTextMutableProperties other = (StructuredTextMutableProperties) o; return - Objects.deepEquals(this.text, other.text); + Utils.enhancedDeepEquals(this.text, other.text); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( text); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeRequest.java index 054e81f2..0f91d54b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeRequest.java @@ -14,7 +14,6 @@ import java.lang.String; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -218,16 +217,16 @@ public boolean equals(java.lang.Object o) { } SummarizeRequest other = (SummarizeRequest) o; return - Objects.deepEquals(this.timestamp, other.timestamp) && - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.preferredSummaryLength, other.preferredSummaryLength) && - Objects.deepEquals(this.documentSpecs, other.documentSpecs) && - Objects.deepEquals(this.trackingToken, other.trackingToken); + Utils.enhancedDeepEquals(this.timestamp, other.timestamp) && + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.preferredSummaryLength, other.preferredSummaryLength) && + Utils.enhancedDeepEquals(this.documentSpecs, other.documentSpecs) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timestamp, query, preferredSummaryLength, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeResponse.java index 6c6f8fc9..0c5fbea4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/SummarizeResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class SummarizeResponse { @@ -126,14 +125,14 @@ public boolean equals(java.lang.Object o) { } SummarizeResponse other = (SummarizeResponse) o; return - Objects.deepEquals(this.error, other.error) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.trackingToken, other.trackingToken); + Utils.enhancedDeepEquals(this.error, other.error) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.trackingToken, other.trackingToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( error, summary, trackingToken); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Summary.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Summary.java index 011021e2..6c1b08ee 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Summary.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Summary.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class Summary { @@ -102,13 +101,13 @@ public boolean equals(java.lang.Object o) { } Summary other = (Summary) o; return - Objects.deepEquals(this.text, other.text) && - Objects.deepEquals(this.followUpPrompts, other.followUpPrompts); + Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.followUpPrompts, other.followUpPrompts); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( text, followUpPrompts); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Team.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Team.java index 597d3edb..0a8b8ebc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Team.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Team.java @@ -19,7 +19,6 @@ import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class Team { @@ -780,32 +779,32 @@ public boolean equals(java.lang.Object o) { } Team other = (Team) o; return - Objects.deepEquals(this.relatedObjects, other.relatedObjects) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.businessUnit, other.businessUnit) && - Objects.deepEquals(this.department, other.department) && - Objects.deepEquals(this.photoUrl, other.photoUrl) && - Objects.deepEquals(this.bannerUrl, other.bannerUrl) && - Objects.deepEquals(this.externalLink, other.externalLink) && - Objects.deepEquals(this.members, other.members) && - Objects.deepEquals(this.memberCount, other.memberCount) && - Objects.deepEquals(this.emails, other.emails) && - Objects.deepEquals(this.customFields, other.customFields) && - Objects.deepEquals(this.datasourceProfiles, other.datasourceProfiles) && - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.createdFrom, other.createdFrom) && - Objects.deepEquals(this.lastUpdatedAt, other.lastUpdatedAt) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.canBeDeleted, other.canBeDeleted) && - Objects.deepEquals(this.loggingId, other.loggingId); + Utils.enhancedDeepEquals(this.relatedObjects, other.relatedObjects) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.businessUnit, other.businessUnit) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.photoUrl, other.photoUrl) && + Utils.enhancedDeepEquals(this.bannerUrl, other.bannerUrl) && + Utils.enhancedDeepEquals(this.externalLink, other.externalLink) && + Utils.enhancedDeepEquals(this.members, other.members) && + Utils.enhancedDeepEquals(this.memberCount, other.memberCount) && + Utils.enhancedDeepEquals(this.emails, other.emails) && + Utils.enhancedDeepEquals(this.customFields, other.customFields) && + Utils.enhancedDeepEquals(this.datasourceProfiles, other.datasourceProfiles) && + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.createdFrom, other.createdFrom) && + Utils.enhancedDeepEquals(this.lastUpdatedAt, other.lastUpdatedAt) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.canBeDeleted, other.canBeDeleted) && + Utils.enhancedDeepEquals(this.loggingId, other.loggingId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( relatedObjects, permissions, id, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamEmail.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamEmail.java index 32f6eaac..71d1bb3c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamEmail.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamEmail.java @@ -13,7 +13,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -109,13 +108,13 @@ public boolean equals(java.lang.Object o) { } TeamEmail other = (TeamEmail) o; return - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( email, type); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamInfoDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamInfoDefinition.java index b56c747f..38973761 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamInfoDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamInfoDefinition.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -418,22 +417,22 @@ public boolean equals(java.lang.Object o) { } TeamInfoDefinition other = (TeamInfoDefinition) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.businessUnit, other.businessUnit) && - Objects.deepEquals(this.department, other.department) && - Objects.deepEquals(this.photoUrl, other.photoUrl) && - Objects.deepEquals(this.externalLink, other.externalLink) && - Objects.deepEquals(this.emails, other.emails) && - Objects.deepEquals(this.datasourceProfiles, other.datasourceProfiles) && - Objects.deepEquals(this.members, other.members) && - Objects.deepEquals(this.additionalFields, other.additionalFields); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.businessUnit, other.businessUnit) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.photoUrl, other.photoUrl) && + Utils.enhancedDeepEquals(this.externalLink, other.externalLink) && + Utils.enhancedDeepEquals(this.emails, other.emails) && + Utils.enhancedDeepEquals(this.datasourceProfiles, other.datasourceProfiles) && + Utils.enhancedDeepEquals(this.members, other.members) && + Utils.enhancedDeepEquals(this.additionalFields, other.additionalFields); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, name, description, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamMember.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamMember.java index 4fbc5f06..6c4e01e4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamMember.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamMember.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.time.LocalDate; -import java.util.Objects; import java.util.Optional; /** @@ -146,14 +145,14 @@ public boolean equals(java.lang.Object o) { } TeamMember other = (TeamMember) o; return - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.relationship, other.relationship) && - Objects.deepEquals(this.joinDate, other.joinDate); + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.relationship, other.relationship) && + Utils.enhancedDeepEquals(this.joinDate, other.joinDate); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( email, relationship, joinDate); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamStatus.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamStatus.java index fcb39a73..0f6202ad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamStatus.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TeamStatus.java @@ -21,7 +21,7 @@ public enum TeamStatus { @JsonValue private final String value; - private TeamStatus(String value) { + TeamStatus(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRange.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRange.java index 798752d3..a8ee2583 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRange.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRange.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -195,16 +194,16 @@ public boolean equals(java.lang.Object o) { } TextRange other = (TextRange) o; return - Objects.deepEquals(this.startIndex, other.startIndex) && - Objects.deepEquals(this.endIndex, other.endIndex) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.document, other.document); + Utils.enhancedDeepEquals(this.startIndex, other.startIndex) && + Utils.enhancedDeepEquals(this.endIndex, other.endIndex) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.document, other.document); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( startIndex, endIndex, type, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRangeType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRangeType.java index cf09973a..a13b16e3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRangeType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TextRangeType.java @@ -17,7 +17,7 @@ public enum TextRangeType { @JsonValue private final String value; - private TextRangeType(String value) { + TextRangeType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Thumbnail.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Thumbnail.java index f06d4a0c..d84662d7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Thumbnail.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Thumbnail.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class Thumbnail { @@ -111,13 +110,13 @@ public boolean equals(java.lang.Object o) { } Thumbnail other = (Thumbnail) o; return - Objects.deepEquals(this.photoId, other.photoId) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.photoId, other.photoId) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( photoId, url); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeInterval.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeInterval.java index fb69262d..ca403291 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeInterval.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeInterval.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class TimeInterval { @@ -84,13 +83,13 @@ public boolean equals(java.lang.Object o) { } TimeInterval other = (TimeInterval) o; return - Objects.deepEquals(this.start, other.start) && - Objects.deepEquals(this.end, other.end); + Utils.enhancedDeepEquals(this.start, other.start) && + Utils.enhancedDeepEquals(this.end, other.end); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( start, end); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePeriodType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePeriodType.java index e1ed5774..d86da1b8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePeriodType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePeriodType.java @@ -17,12 +17,13 @@ public enum TimePeriodType { ALL_TIME("ALL_TIME"), PAST_YEAR("PAST_YEAR"), PAST_DAY("PAST_DAY"), - CUSTOM("CUSTOM"); + CUSTOM("CUSTOM"), + LAST_N_DAYS("LAST_N_DAYS"); @JsonValue private final String value; - private TimePeriodType(String value) { + TimePeriodType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePoint.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePoint.java index 18115577..ef26c932 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePoint.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimePoint.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class TimePoint { @@ -112,13 +111,13 @@ public boolean equals(java.lang.Object o) { } TimePoint other = (TimePoint) o; return - Objects.deepEquals(this.epochSeconds, other.epochSeconds) && - Objects.deepEquals(this.daysFromNow, other.daysFromNow); + Utils.enhancedDeepEquals(this.epochSeconds, other.epochSeconds) && + Utils.enhancedDeepEquals(this.daysFromNow, other.daysFromNow); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( epochSeconds, daysFromNow); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeRange.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeRange.java index 8f4d20a7..c6cf19e1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeRange.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/TimeRange.java @@ -9,10 +9,10 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Long; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class TimeRange { @@ -31,18 +31,28 @@ public class TimeRange { @JsonProperty("endTime") private Optional endTime; + /** + * The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lastNDaysValue") + private Optional lastNDaysValue; + @JsonCreator public TimeRange( @JsonProperty("startTime") Optional startTime, - @JsonProperty("endTime") Optional endTime) { + @JsonProperty("endTime") Optional endTime, + @JsonProperty("lastNDaysValue") Optional lastNDaysValue) { Utils.checkNotNull(startTime, "startTime"); Utils.checkNotNull(endTime, "endTime"); + Utils.checkNotNull(lastNDaysValue, "lastNDaysValue"); this.startTime = startTime; this.endTime = endTime; + this.lastNDaysValue = lastNDaysValue; } public TimeRange() { - this(Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -61,6 +71,14 @@ public Optional endTime() { return endTime; } + /** + * The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + */ + @JsonIgnore + public Optional lastNDaysValue() { + return lastNDaysValue; + } + public final static Builder builder() { return new Builder(); } @@ -101,6 +119,24 @@ public TimeRange withEndTime(Optional endTime) { return this; } + /** + * The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + */ + public TimeRange withLastNDaysValue(long lastNDaysValue) { + Utils.checkNotNull(lastNDaysValue, "lastNDaysValue"); + this.lastNDaysValue = Optional.ofNullable(lastNDaysValue); + return this; + } + + /** + * The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + */ + public TimeRange withLastNDaysValue(Optional lastNDaysValue) { + Utils.checkNotNull(lastNDaysValue, "lastNDaysValue"); + this.lastNDaysValue = lastNDaysValue; + return this; + } + @Override public boolean equals(java.lang.Object o) { @@ -112,22 +148,25 @@ public boolean equals(java.lang.Object o) { } TimeRange other = (TimeRange) o; return - Objects.deepEquals(this.startTime, other.startTime) && - Objects.deepEquals(this.endTime, other.endTime); + Utils.enhancedDeepEquals(this.startTime, other.startTime) && + Utils.enhancedDeepEquals(this.endTime, other.endTime) && + Utils.enhancedDeepEquals(this.lastNDaysValue, other.lastNDaysValue); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( startTime, - endTime); + endTime, + lastNDaysValue); } @Override public String toString() { return Utils.toString(TimeRange.class, "startTime", startTime, - "endTime", endTime); + "endTime", endTime, + "lastNDaysValue", lastNDaysValue); } public final static class Builder { @@ -135,6 +174,8 @@ public final static class Builder { private Optional startTime = Optional.empty(); private Optional endTime = Optional.empty(); + + private Optional lastNDaysValue = Optional.empty(); private Builder() { // force use of static builder() method @@ -175,11 +216,30 @@ public Builder endTime(Optional endTime) { this.endTime = endTime; return this; } + + /** + * The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + */ + public Builder lastNDaysValue(long lastNDaysValue) { + Utils.checkNotNull(lastNDaysValue, "lastNDaysValue"); + this.lastNDaysValue = Optional.ofNullable(lastNDaysValue); + return this; + } + + /** + * The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + */ + public Builder lastNDaysValue(Optional lastNDaysValue) { + Utils.checkNotNull(lastNDaysValue, "lastNDaysValue"); + this.lastNDaysValue = lastNDaysValue; + return this; + } public TimeRange build() { return new TimeRange( startTime, - endTime); + endTime, + lastNDaysValue); } } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Tool.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Tool.java index 8c1b9d82..7e01d399 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Tool.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Tool.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class Tool { @@ -223,16 +222,16 @@ public boolean equals(java.lang.Object o) { } Tool other = (Tool) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.displayName, other.displayName) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.parameters, other.parameters); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.parameters, other.parameters); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( type, name, displayName, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolInfo.java index 0bf1ad89..0dadea06 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolInfo.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class ToolInfo { @@ -115,13 +114,13 @@ public boolean equals(java.lang.Object o) { } ToolInfo other = (ToolInfo) o; return - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.parameters, other.parameters); + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.parameters, other.parameters); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( metadata, parameters); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadata.java index a99d3de3..b85e315e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadata.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; /** @@ -646,29 +645,29 @@ public boolean equals(java.lang.Object o) { } ToolMetadata other = (ToolMetadata) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.displayName, other.displayName) && - Objects.deepEquals(this.toolId, other.toolId) && - Objects.deepEquals(this.displayDescription, other.displayDescription) && - Objects.deepEquals(this.logoUrl, other.logoUrl) && - Objects.deepEquals(this.objectName, other.objectName) && - Objects.deepEquals(this.knowledgeType, other.knowledgeType) && - Objects.deepEquals(this.createdBy, other.createdBy) && - Objects.deepEquals(this.lastUpdatedBy, other.lastUpdatedBy) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.lastUpdatedAt, other.lastUpdatedAt) && - Objects.deepEquals(this.writeActionType, other.writeActionType) && - Objects.deepEquals(this.authType, other.authType) && - Objects.deepEquals(this.auth, other.auth) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.usageInstructions, other.usageInstructions) && - Objects.deepEquals(this.isSetupFinished, other.isSetupFinished); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.toolId, other.toolId) && + Utils.enhancedDeepEquals(this.displayDescription, other.displayDescription) && + Utils.enhancedDeepEquals(this.logoUrl, other.logoUrl) && + Utils.enhancedDeepEquals(this.objectName, other.objectName) && + Utils.enhancedDeepEquals(this.knowledgeType, other.knowledgeType) && + Utils.enhancedDeepEquals(this.createdBy, other.createdBy) && + Utils.enhancedDeepEquals(this.lastUpdatedBy, other.lastUpdatedBy) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.lastUpdatedAt, other.lastUpdatedAt) && + Utils.enhancedDeepEquals(this.writeActionType, other.writeActionType) && + Utils.enhancedDeepEquals(this.authType, other.authType) && + Utils.enhancedDeepEquals(this.auth, other.auth) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.usageInstructions, other.usageInstructions) && + Utils.enhancedDeepEquals(this.isSetupFinished, other.isSetupFinished); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( type, name, displayName, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadataType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadataType.java index f183d4fd..2f4ad38c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadataType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolMetadataType.java @@ -20,7 +20,7 @@ public enum ToolMetadataType { @JsonValue private final String value; - private ToolMetadataType(String value) { + ToolMetadataType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameter.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameter.java index a8d492fd..7d7dde7f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameter.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameter.java @@ -15,7 +15,6 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class ToolParameter { @@ -287,18 +286,18 @@ public boolean equals(java.lang.Object o) { } ToolParameter other = (ToolParameter) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.isRequired, other.isRequired) && - Objects.deepEquals(this.possibleValues, other.possibleValues) && - Objects.deepEquals(this.items, other.items) && - Objects.deepEquals(this.properties, other.properties); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.isRequired, other.isRequired) && + Utils.enhancedDeepEquals(this.possibleValues, other.possibleValues) && + Utils.enhancedDeepEquals(this.items, other.items) && + Utils.enhancedDeepEquals(this.properties, other.properties); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( type, name, description, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameterType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameterType.java index bc33c293..c5609c45 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameterType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolParameterType.java @@ -23,7 +23,7 @@ public enum ToolParameterType { @JsonValue private final String value; - private ToolParameterType(String value) { + ToolParameterType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolType.java index 7eb81bb4..958c8644 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolType.java @@ -20,7 +20,7 @@ public enum ToolType { @JsonValue private final String value; - private ToolType(String value) { + ToolType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallParameter.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallParameter.java index 150bb00e..ece7ca2f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallParameter.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallParameter.java @@ -14,7 +14,6 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class ToolsCallParameter { @@ -170,15 +169,15 @@ public boolean equals(java.lang.Object o) { } ToolsCallParameter other = (ToolsCallParameter) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.items, other.items) && - Objects.deepEquals(this.properties, other.properties); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.items, other.items) && + Utils.enhancedDeepEquals(this.properties, other.properties); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, value, items, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallRequest.java index 4db7aba1..80de38e5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallRequest.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.Map; -import java.util.Objects; public class ToolsCallRequest { @@ -85,13 +84,13 @@ public boolean equals(java.lang.Object o) { } ToolsCallRequest other = (ToolsCallRequest) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.parameters, other.parameters); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.parameters, other.parameters); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, parameters); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallResponse.java index 93e96702..fef9d009 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsCallResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.Map; -import java.util.Objects; import java.util.Optional; public class ToolsCallResponse { @@ -115,13 +114,13 @@ public boolean equals(java.lang.Object o) { } ToolsCallResponse other = (ToolsCallResponse) o; return - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( rawResponse, error); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsListResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsListResponse.java index dd8c9977..bc7fe8f2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsListResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ToolsListResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class ToolsListResponse { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } ToolsListResponse other = (ToolsListResponse) o; return - Objects.deepEquals(this.tools, other.tools); + Utils.enhancedDeepEquals(this.tools, other.tools); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tools); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UgcType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UgcType.java index 7badaab7..050128b8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UgcType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UgcType.java @@ -19,7 +19,7 @@ public enum UgcType { @JsonValue private final String value; - private UgcType(String value) { + UgcType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UiConfig.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UiConfig.java index f0ae9e94..ab80f361 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UiConfig.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UiConfig.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UiConfig { @@ -114,13 +113,13 @@ public boolean equals(java.lang.Object o) { } UiConfig other = (UiConfig) o; return - Objects.deepEquals(this.format, other.format) && - Objects.deepEquals(this.additionalFlags, other.additionalFlags); + Utils.enhancedDeepEquals(this.format, other.format) && + Utils.enhancedDeepEquals(this.additionalFlags, other.additionalFlags); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( format, additionalFlags); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UiOptions.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UiOptions.java index 9ae3b453..3b680f97 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UiOptions.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UiOptions.java @@ -16,7 +16,7 @@ public enum UiOptions { @JsonValue private final String value; - private UiOptions(String value) { + UiOptions(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Unpin.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Unpin.java index 8ba0b6f4..0cc6696f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Unpin.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Unpin.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class Unpin { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } Unpin other = (Unpin) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequest.java index 391ccb61..2cc12066 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequest.java @@ -16,7 +16,6 @@ import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; public class UpdateAnnouncementRequest { @@ -518,26 +517,26 @@ public boolean equals(java.lang.Object o) { } UpdateAnnouncementRequest other = (UpdateAnnouncementRequest) o; return - Objects.deepEquals(this.startTime, other.startTime) && - Objects.deepEquals(this.endTime, other.endTime) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.body, other.body) && - Objects.deepEquals(this.emoji, other.emoji) && - Objects.deepEquals(this.thumbnail, other.thumbnail) && - Objects.deepEquals(this.banner, other.banner) && - Objects.deepEquals(this.audienceFilters, other.audienceFilters) && - Objects.deepEquals(this.sourceDocumentId, other.sourceDocumentId) && - Objects.deepEquals(this.hideAttribution, other.hideAttribution) && - Objects.deepEquals(this.channel, other.channel) && - Objects.deepEquals(this.postType, other.postType) && - Objects.deepEquals(this.isPrioritized, other.isPrioritized) && - Objects.deepEquals(this.viewUrl, other.viewUrl) && - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.startTime, other.startTime) && + Utils.enhancedDeepEquals(this.endTime, other.endTime) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.body, other.body) && + Utils.enhancedDeepEquals(this.emoji, other.emoji) && + Utils.enhancedDeepEquals(this.thumbnail, other.thumbnail) && + Utils.enhancedDeepEquals(this.banner, other.banner) && + Utils.enhancedDeepEquals(this.audienceFilters, other.audienceFilters) && + Utils.enhancedDeepEquals(this.sourceDocumentId, other.sourceDocumentId) && + Utils.enhancedDeepEquals(this.hideAttribution, other.hideAttribution) && + Utils.enhancedDeepEquals(this.channel, other.channel) && + Utils.enhancedDeepEquals(this.postType, other.postType) && + Utils.enhancedDeepEquals(this.isPrioritized, other.isPrioritized) && + Utils.enhancedDeepEquals(this.viewUrl, other.viewUrl) && + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( startTime, endTime, title, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestChannel.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestChannel.java index 51781722..e4921d52 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestChannel.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestChannel.java @@ -20,7 +20,7 @@ public enum UpdateAnnouncementRequestChannel { @JsonValue private final String value; - private UpdateAnnouncementRequestChannel(String value) { + UpdateAnnouncementRequestChannel(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestPostType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestPostType.java index 6222b38b..f34d3e7d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestPostType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateAnnouncementRequestPostType.java @@ -20,7 +20,7 @@ public enum UpdateAnnouncementRequestPostType { @JsonValue private final String value; - private UpdateAnnouncementRequestPostType(String value) { + UpdateAnnouncementRequestPostType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigRequest.java index f7d7bf53..cfbd4bfc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigRequest.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UpdateDlpConfigRequest { @@ -113,13 +112,13 @@ public boolean equals(java.lang.Object o) { } UpdateDlpConfigRequest other = (UpdateDlpConfigRequest) o; return - Objects.deepEquals(this.config, other.config) && - Objects.deepEquals(this.frequency, other.frequency); + Utils.enhancedDeepEquals(this.config, other.config) && + Utils.enhancedDeepEquals(this.frequency, other.frequency); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( config, frequency); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigResponse.java index 5325cdcb..b66de318 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpConfigResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UpdateDlpConfigResponse { @@ -101,13 +100,13 @@ public boolean equals(java.lang.Object o) { } UpdateDlpConfigResponse other = (UpdateDlpConfigResponse) o; return - Objects.deepEquals(this.result, other.result) && - Objects.deepEquals(this.reportId, other.reportId); + Utils.enhancedDeepEquals(this.result, other.result) && + Utils.enhancedDeepEquals(this.reportId, other.reportId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( result, reportId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportRequest.java index ff702f52..42ab8376 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UpdateDlpReportRequest { @@ -224,16 +223,16 @@ public boolean equals(java.lang.Object o) { } UpdateDlpReportRequest other = (UpdateDlpReportRequest) o; return - Objects.deepEquals(this.config, other.config) && - Objects.deepEquals(this.frequency, other.frequency) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.autoHideDocs, other.autoHideDocs) && - Objects.deepEquals(this.reportName, other.reportName); + Utils.enhancedDeepEquals(this.config, other.config) && + Utils.enhancedDeepEquals(this.frequency, other.frequency) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.autoHideDocs, other.autoHideDocs) && + Utils.enhancedDeepEquals(this.reportName, other.reportName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( config, frequency, status, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportResponse.java index 4c914cd6..7a7d0470 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDlpReportResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UpdateDlpReportResponse { @@ -65,12 +64,12 @@ public boolean equals(java.lang.Object o) { } UpdateDlpReportResponse other = (UpdateDlpReportResponse) o; return - Objects.deepEquals(this.result, other.result); + Utils.enhancedDeepEquals(this.result, other.result); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( result); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesRequest.java index 5f08df29..d1d2d402 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesRequest.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class UpdateDocumentVisibilityOverridesRequest { @@ -66,12 +65,12 @@ public boolean equals(java.lang.Object o) { } UpdateDocumentVisibilityOverridesRequest other = (UpdateDocumentVisibilityOverridesRequest) o; return - Objects.deepEquals(this.visibilityOverrides, other.visibilityOverrides); + Utils.enhancedDeepEquals(this.visibilityOverrides, other.visibilityOverrides); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( visibilityOverrides); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesResponse.java index fe33fa65..78fb9dbe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateDocumentVisibilityOverridesResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class UpdateDocumentVisibilityOverridesResponse { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } UpdateDocumentVisibilityOverridesResponse other = (UpdateDocumentVisibilityOverridesResponse) o; return - Objects.deepEquals(this.results, other.results); + Utils.enhancedDeepEquals(this.results, other.results); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( results); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdatePermissionsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdatePermissionsRequest.java index c3a2dce3..84bb13d0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdatePermissionsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdatePermissionsRequest.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -197,16 +196,16 @@ public boolean equals(java.lang.Object o) { } UpdatePermissionsRequest other = (UpdatePermissionsRequest) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.objectType, other.objectType) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.viewURL, other.viewURL) && - Objects.deepEquals(this.permissions, other.permissions); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.objectType, other.objectType) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.viewURL, other.viewURL) && + Utils.enhancedDeepEquals(this.permissions, other.permissions); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, objectType, id, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutRequest.java index 82312ca9..b5fd479a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutRequest.java @@ -15,7 +15,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class UpdateShortcutRequest { @@ -360,20 +359,20 @@ public boolean equals(java.lang.Object o) { } UpdateShortcutRequest other = (UpdateShortcutRequest) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.inputAlias, other.inputAlias) && - Objects.deepEquals(this.destinationUrl, other.destinationUrl) && - Objects.deepEquals(this.destinationDocumentId, other.destinationDocumentId) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.unlisted, other.unlisted) && - Objects.deepEquals(this.urlTemplate, other.urlTemplate) && - Objects.deepEquals(this.addedRoles, other.addedRoles) && - Objects.deepEquals(this.removedRoles, other.removedRoles); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.inputAlias, other.inputAlias) && + Utils.enhancedDeepEquals(this.destinationUrl, other.destinationUrl) && + Utils.enhancedDeepEquals(this.destinationDocumentId, other.destinationDocumentId) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.unlisted, other.unlisted) && + Utils.enhancedDeepEquals(this.urlTemplate, other.urlTemplate) && + Utils.enhancedDeepEquals(this.addedRoles, other.addedRoles) && + Utils.enhancedDeepEquals(this.removedRoles, other.removedRoles); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, inputAlias, destinationUrl, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutResponse.java index 495d24c8..695308c6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UpdateShortcutResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UpdateShortcutResponse { @@ -90,13 +89,13 @@ public boolean equals(java.lang.Object o) { } UpdateShortcutResponse other = (UpdateShortcutResponse) o; return - Objects.deepEquals(this.shortcut, other.shortcut) && - Objects.deepEquals(this.error, other.error); + Utils.enhancedDeepEquals(this.shortcut, other.shortcut) && + Utils.enhancedDeepEquals(this.error, other.error); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( shortcut, error); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java index c597c22e..7eff5016 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesRequest.java @@ -10,7 +10,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; public class UploadChatFilesRequest { @@ -59,12 +58,12 @@ public boolean equals(java.lang.Object o) { } UploadChatFilesRequest other = (UploadChatFilesRequest) o; return - Objects.deepEquals(this.files, other.files); + Utils.enhancedDeepEquals(this.files, other.files); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( files); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesResponse.java index 80260b4a..3a749e5a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadChatFilesResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class UploadChatFilesResponse { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } UploadChatFilesResponse other = (UploadChatFilesResponse) o; return - Objects.deepEquals(this.files, other.files); + Utils.enhancedDeepEquals(this.files, other.files); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( files); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadShortcutsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadShortcutsRequest.java index 60c0fc11..96b1866d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadShortcutsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadShortcutsRequest.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -208,16 +207,16 @@ public boolean equals(java.lang.Object o) { } UploadShortcutsRequest other = (UploadShortcutsRequest) o; return - Objects.deepEquals(this.uploadId, other.uploadId) && - Objects.deepEquals(this.isFirstPage, other.isFirstPage) && - Objects.deepEquals(this.isLastPage, other.isLastPage) && - Objects.deepEquals(this.forceRestartUpload, other.forceRestartUpload) && - Objects.deepEquals(this.shortcuts, other.shortcuts); + Utils.enhancedDeepEquals(this.uploadId, other.uploadId) && + Utils.enhancedDeepEquals(this.isFirstPage, other.isFirstPage) && + Utils.enhancedDeepEquals(this.isLastPage, other.isLastPage) && + Utils.enhancedDeepEquals(this.forceRestartUpload, other.forceRestartUpload) && + Utils.enhancedDeepEquals(this.shortcuts, other.shortcuts); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( uploadId, isFirstPage, isLastPage, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadStatusEnum.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadStatusEnum.java index 122d7b42..9fff5b88 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadStatusEnum.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UploadStatusEnum.java @@ -21,7 +21,7 @@ public enum UploadStatusEnum { @JsonValue private final String value; - private UploadStatusEnum(String value) { + UploadStatusEnum(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/User.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/User.java index eb79ec80..e46be748 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/User.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/User.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class User { @@ -111,13 +110,13 @@ public boolean equals(java.lang.Object o) { } User other = (User) o; return - Objects.deepEquals(this.userID, other.userID) && - Objects.deepEquals(this.origID, other.origID); + Utils.enhancedDeepEquals(this.userID, other.userID) && + Utils.enhancedDeepEquals(this.origID, other.origID); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( userID, origID); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivity.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivity.java index fa68b09f..eb20785f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivity.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivity.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UserActivity { @@ -164,15 +163,15 @@ public boolean equals(java.lang.Object o) { } UserActivity other = (UserActivity) o; return - Objects.deepEquals(this.actor, other.actor) && - Objects.deepEquals(this.timestamp, other.timestamp) && - Objects.deepEquals(this.action, other.action) && - Objects.deepEquals(this.aggregateVisitCount, other.aggregateVisitCount); + Utils.enhancedDeepEquals(this.actor, other.actor) && + Utils.enhancedDeepEquals(this.timestamp, other.timestamp) && + Utils.enhancedDeepEquals(this.action, other.action) && + Utils.enhancedDeepEquals(this.aggregateVisitCount, other.aggregateVisitCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( actor, timestamp, action, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityAction.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityAction.java index 6d5583b6..f0340fd6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityAction.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityAction.java @@ -32,7 +32,7 @@ public enum UserActivityAction { @JsonValue private final String value; - private UserActivityAction(String value) { + UserActivityAction(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityInsight.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityInsight.java index 545d8e8e..d0083c77 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityInsight.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserActivityInsight.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UserActivityInsight { @@ -172,16 +171,16 @@ public boolean equals(java.lang.Object o) { } UserActivityInsight other = (UserActivityInsight) o; return - Objects.deepEquals(this.user, other.user) && - Objects.deepEquals(this.activity, other.activity) && - Objects.deepEquals(this.lastActivityTimestamp, other.lastActivityTimestamp) && - Objects.deepEquals(this.activityCount, other.activityCount) && - Objects.deepEquals(this.activeDayCount, other.activeDayCount); + Utils.enhancedDeepEquals(this.user, other.user) && + Utils.enhancedDeepEquals(this.activity, other.activity) && + Utils.enhancedDeepEquals(this.lastActivityTimestamp, other.lastActivityTimestamp) && + Utils.enhancedDeepEquals(this.activityCount, other.activityCount) && + Utils.enhancedDeepEquals(this.activeDayCount, other.activeDayCount); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( user, activity, lastActivityTimestamp, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserGeneratedContentId.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserGeneratedContentId.java index b4d15c01..fd3a1d9a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserGeneratedContentId.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserGeneratedContentId.java @@ -12,7 +12,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class UserGeneratedContentId { @@ -76,12 +75,12 @@ public boolean equals(java.lang.Object o) { } UserGeneratedContentId other = (UserGeneratedContentId) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserInsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserInsightsResponse.java index ccf39fda..afa109e4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserInsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserInsightsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class UserInsightsResponse { @@ -261,17 +260,17 @@ public boolean equals(java.lang.Object o) { } UserInsightsResponse other = (UserInsightsResponse) o; return - Objects.deepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && - Objects.deepEquals(this.activityInsights, other.activityInsights) && - Objects.deepEquals(this.inactiveInsights, other.inactiveInsights) && - Objects.deepEquals(this.totalTeammates, other.totalTeammates) && - Objects.deepEquals(this.totalActiveUsers, other.totalActiveUsers) && - Objects.deepEquals(this.departments, other.departments); + Utils.enhancedDeepEquals(this.lastLogTimestamp, other.lastLogTimestamp) && + Utils.enhancedDeepEquals(this.activityInsights, other.activityInsights) && + Utils.enhancedDeepEquals(this.inactiveInsights, other.inactiveInsights) && + Utils.enhancedDeepEquals(this.totalTeammates, other.totalTeammates) && + Utils.enhancedDeepEquals(this.totalActiveUsers, other.totalActiveUsers) && + Utils.enhancedDeepEquals(this.departments, other.departments); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastLogTimestamp, activityInsights, inactiveInsights, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserReferenceDefinition.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserReferenceDefinition.java index f578e9c5..8eb70655 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserReferenceDefinition.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserReferenceDefinition.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -128,14 +127,14 @@ public boolean equals(java.lang.Object o) { } UserReferenceDefinition other = (UserReferenceDefinition) o; return - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.datasourceUserId, other.datasourceUserId) && - Objects.deepEquals(this.name, other.name); + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.datasourceUserId, other.datasourceUserId) && + Utils.enhancedDeepEquals(this.name, other.name); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( email, datasourceUserId, name); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRole.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRole.java index 809223b2..0f4c5ce3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRole.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRole.java @@ -23,7 +23,7 @@ public enum UserRole { @JsonValue private final String value; - private UserRole(String value) { + UserRole(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRoleSpecification.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRoleSpecification.java index c6413e3e..0796aa30 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRoleSpecification.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserRoleSpecification.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class UserRoleSpecification { @@ -142,15 +141,15 @@ public boolean equals(java.lang.Object o) { } UserRoleSpecification other = (UserRoleSpecification) o; return - Objects.deepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && - Objects.deepEquals(this.person, other.person) && - Objects.deepEquals(this.group, other.group) && - Objects.deepEquals(this.role, other.role); + Utils.enhancedDeepEquals(this.sourceDocumentSpec, other.sourceDocumentSpec) && + Utils.enhancedDeepEquals(this.person, other.person) && + Utils.enhancedDeepEquals(this.group, other.group) && + Utils.enhancedDeepEquals(this.role, other.role); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( sourceDocumentSpec, person, group, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserStatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserStatusResponse.java index 76d136eb..dee9bbcd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserStatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserStatusResponse.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -155,14 +154,14 @@ public boolean equals(java.lang.Object o) { } UserStatusResponse other = (UserStatusResponse) o; return - Objects.deepEquals(this.isActiveUser, other.isActiveUser) && - Objects.deepEquals(this.uploadStatus, other.uploadStatus) && - Objects.deepEquals(this.lastUploadedAt, other.lastUploadedAt); + Utils.enhancedDeepEquals(this.isActiveUser, other.isActiveUser) && + Utils.enhancedDeepEquals(this.uploadStatus, other.uploadStatus) && + Utils.enhancedDeepEquals(this.lastUploadedAt, other.lastUploadedAt); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( isActiveUser, uploadStatus, lastUploadedAt); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserViewInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserViewInfo.java index 81bf50ec..fb9b4392 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/UserViewInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/UserViewInfo.java @@ -11,7 +11,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class UserViewInfo { @@ -147,14 +146,14 @@ public boolean equals(java.lang.Object o) { } UserViewInfo other = (UserViewInfo) o; return - Objects.deepEquals(this.docId, other.docId) && - Objects.deepEquals(this.docTitle, other.docTitle) && - Objects.deepEquals(this.docUrl, other.docUrl); + Utils.enhancedDeepEquals(this.docId, other.docId) && + Utils.enhancedDeepEquals(this.docTitle, other.docTitle) && + Utils.enhancedDeepEquals(this.docUrl, other.docUrl); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( docId, docTitle, docUrl); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Value.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Value.java index d6efd84c..0c7ada55 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Value.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Value.java @@ -7,7 +7,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * Value @@ -40,7 +39,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Verification.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Verification.java index 79763d7e..fd024824 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Verification.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Verification.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class Verification { @@ -92,13 +91,13 @@ public boolean equals(java.lang.Object o) { } Verification other = (Verification) o; return - Objects.deepEquals(this.state, other.state) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.state, other.state) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( state, metadata); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationFeed.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationFeed.java index 5c39b387..d1c16423 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationFeed.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationFeed.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class VerificationFeed { @@ -78,12 +77,12 @@ public boolean equals(java.lang.Object o) { } VerificationFeed other = (VerificationFeed) o; return - Objects.deepEquals(this.documents, other.documents); + Utils.enhancedDeepEquals(this.documents, other.documents); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documents); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationMetadata.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationMetadata.java index 4035d7a6..bd8f9eef 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationMetadata.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerificationMetadata.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class VerificationMetadata { @@ -300,19 +299,19 @@ public boolean equals(java.lang.Object o) { } VerificationMetadata other = (VerificationMetadata) o; return - Objects.deepEquals(this.lastVerifier, other.lastVerifier) && - Objects.deepEquals(this.lastVerificationTs, other.lastVerificationTs) && - Objects.deepEquals(this.expirationTs, other.expirationTs) && - Objects.deepEquals(this.document, other.document) && - Objects.deepEquals(this.reminders, other.reminders) && - Objects.deepEquals(this.lastReminder, other.lastReminder) && - Objects.deepEquals(this.visitorCount, other.visitorCount) && - Objects.deepEquals(this.candidateVerifiers, other.candidateVerifiers); + Utils.enhancedDeepEquals(this.lastVerifier, other.lastVerifier) && + Utils.enhancedDeepEquals(this.lastVerificationTs, other.lastVerificationTs) && + Utils.enhancedDeepEquals(this.expirationTs, other.expirationTs) && + Utils.enhancedDeepEquals(this.document, other.document) && + Utils.enhancedDeepEquals(this.reminders, other.reminders) && + Utils.enhancedDeepEquals(this.lastReminder, other.lastReminder) && + Utils.enhancedDeepEquals(this.visitorCount, other.visitorCount) && + Utils.enhancedDeepEquals(this.candidateVerifiers, other.candidateVerifiers); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( lastVerifier, lastVerificationTs, expirationTs, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequest.java index 1a6fa1e5..d93af940 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequest.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class VerifyRequest { @@ -104,13 +103,13 @@ public boolean equals(java.lang.Object o) { } VerifyRequest other = (VerifyRequest) o; return - Objects.deepEquals(this.documentId, other.documentId) && - Objects.deepEquals(this.action, other.action); + Utils.enhancedDeepEquals(this.documentId, other.documentId) && + Utils.enhancedDeepEquals(this.action, other.action); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( documentId, action); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequestAction.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequestAction.java index 7c116fe6..7795b6cb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequestAction.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/VerifyRequestAction.java @@ -21,7 +21,7 @@ public enum VerifyRequestAction { @JsonValue private final String value; - private VerifyRequestAction(String value) { + VerifyRequestAction(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ViewerInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ViewerInfo.java index c19a7326..fc74f956 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/ViewerInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ViewerInfo.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; public class ViewerInfo { @@ -115,13 +114,13 @@ public boolean equals(java.lang.Object o) { } ViewerInfo other = (ViewerInfo) o; return - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.lastViewedTime, other.lastViewedTime); + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.lastViewedTime, other.lastViewedTime); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( role, lastViewedTime); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Vote.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Vote.java index 5844aeba..5b1ce597 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Vote.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Vote.java @@ -20,7 +20,7 @@ public enum Vote { @JsonValue private final String value; - private Vote(String value) { + Vote(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WarningType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WarningType.java index d8ca819a..80c8970e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WarningType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WarningType.java @@ -19,12 +19,13 @@ public enum WarningType { PUNCTUATION_ONLY("PUNCTUATION_ONLY"), COPYPASTED_QUOTES("COPYPASTED_QUOTES"), INVALID_OPERATOR("INVALID_OPERATOR"), - MAYBE_INVALID_FACET_QUERY("MAYBE_INVALID_FACET_QUERY"); + MAYBE_INVALID_FACET_QUERY("MAYBE_INVALID_FACET_QUERY"), + TOO_MANY_DATASOURCE_GROUPS("TOO_MANY_DATASOURCE_GROUPS"); @JsonValue private final String value; - private WarningType(String value) { + WarningType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/Workflow.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/Workflow.java index e40ff281..bc7f6fce 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/Workflow.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/Workflow.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class Workflow { @@ -260,18 +259,18 @@ public boolean equals(java.lang.Object o) { } Workflow other = (Workflow) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.author, other.author) && - Objects.deepEquals(this.createTimestamp, other.createTimestamp) && - Objects.deepEquals(this.lastUpdateTimestamp, other.lastUpdateTimestamp) && - Objects.deepEquals(this.lastUpdatedBy, other.lastUpdatedBy) && - Objects.deepEquals(this.permissions, other.permissions) && - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.author, other.author) && + Utils.enhancedDeepEquals(this.createTimestamp, other.createTimestamp) && + Utils.enhancedDeepEquals(this.lastUpdateTimestamp, other.lastUpdateTimestamp) && + Utils.enhancedDeepEquals(this.lastUpdatedBy, other.lastUpdatedBy) && + Utils.enhancedDeepEquals(this.permissions, other.permissions) && + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( name, author, createTimestamp, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfo.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfo.java index 49b3db0a..de3ad8cb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfo.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfo.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class WorkflowFeedbackInfo { @@ -77,12 +76,12 @@ public boolean equals(java.lang.Object o) { } WorkflowFeedbackInfo other = (WorkflowFeedbackInfo) o; return - Objects.deepEquals(this.source, other.source); + Utils.enhancedDeepEquals(this.source, other.source); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( source); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfoSource.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfoSource.java index bef5bad5..28320b3c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfoSource.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowFeedbackInfoSource.java @@ -21,7 +21,7 @@ public enum WorkflowFeedbackInfoSource { @JsonValue private final String value; - private WorkflowFeedbackInfoSource(String value) { + WorkflowFeedbackInfoSource(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowResult.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowResult.java index 6840458b..462c9723 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowResult.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WorkflowResult.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class WorkflowResult { @@ -49,12 +48,12 @@ public boolean equals(java.lang.Object o) { } WorkflowResult other = (WorkflowResult) o; return - Objects.deepEquals(this.workflow, other.workflow); + Utils.enhancedDeepEquals(this.workflow, other.workflow); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( workflow); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameter.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameter.java index 37f83d75..eaddd8bc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameter.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameter.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class WriteActionParameter { @@ -260,17 +259,17 @@ public boolean equals(java.lang.Object o) { } WriteActionParameter other = (WriteActionParameter) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.displayName, other.displayName) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.isRequired, other.isRequired) && - Objects.deepEquals(this.description, other.description) && - Objects.deepEquals(this.possibleValues, other.possibleValues); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.isRequired, other.isRequired) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.possibleValues, other.possibleValues); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( type, displayName, value, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameterType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameterType.java index f71d82f5..3495caf6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameterType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionParameterType.java @@ -22,7 +22,7 @@ public enum WriteActionParameterType { @JsonValue private final String value; - private WriteActionParameterType(String value) { + WriteActionParameterType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionType.java index 55cdfa2a..9f18c7b2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WriteActionType.java @@ -20,7 +20,7 @@ public enum WriteActionType { @JsonValue private final String value; - private WriteActionType(String value) { + WriteActionType(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/WritePermission.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/WritePermission.java index 0159de58..75e50570 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/WritePermission.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/WritePermission.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -191,15 +190,15 @@ public boolean equals(java.lang.Object o) { } WritePermission other = (WritePermission) o; return - Objects.deepEquals(this.scopeType, other.scopeType) && - Objects.deepEquals(this.create, other.create) && - Objects.deepEquals(this.update, other.update) && - Objects.deepEquals(this.delete, other.delete); + Utils.enhancedDeepEquals(this.scopeType, other.scopeType) && + Utils.enhancedDeepEquals(this.create, other.create) && + Utils.enhancedDeepEquals(this.update, other.update) && + Utils.enhancedDeepEquals(this.delete, other.delete); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( scopeType, create, update, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/errors/APIException.java b/src/main/java/com/glean/api_client/glean_api_client/models/errors/APIException.java index a43b2123..371e62d8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/errors/APIException.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/errors/APIException.java @@ -5,6 +5,7 @@ import java.net.http.HttpResponse; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import com.glean.api_client.glean_api_client.utils.Utils; /** @@ -23,6 +24,7 @@ public APIException( int code, String message, byte[] body) { + super(message); Utils.checkNotNull(rawResponse, "rawResponse"); Utils.checkNotNull(message, "message"); Utils.checkNotNull(body, "body"); @@ -81,4 +83,8 @@ public String message() { public byte[] body() { return this.body; } -} + + public String bodyAsString() { + return new String(body(), StandardCharsets.UTF_8); + } +} \ No newline at end of file diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/errors/CollectionError.java b/src/main/java/com/glean/api_client/glean_api_client/models/errors/CollectionError.java index b2619734..94b87032 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/errors/CollectionError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/errors/CollectionError.java @@ -11,7 +11,6 @@ import java.lang.RuntimeException; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; @SuppressWarnings("serial") public class CollectionError extends RuntimeException { @@ -22,6 +21,7 @@ public class CollectionError extends RuntimeException { @JsonCreator public CollectionError( @JsonProperty("errorCode") ErrorCode errorCode) { + super("API error occurred"); Utils.checkNotNull(errorCode, "errorCode"); this.errorCode = errorCode; } @@ -52,12 +52,12 @@ public boolean equals(java.lang.Object o) { } CollectionError other = (CollectionError) o; return - Objects.deepEquals(this.errorCode, other.errorCode); + Utils.enhancedDeepEquals(this.errorCode, other.errorCode); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( errorCode); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/errors/ErrorCode.java b/src/main/java/com/glean/api_client/glean_api_client/models/errors/ErrorCode.java index 80f4b50d..aa3d4a58 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/errors/ErrorCode.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/errors/ErrorCode.java @@ -20,7 +20,7 @@ public enum ErrorCode { @JsonValue private final String value; - private ErrorCode(String value) { + ErrorCode(String value) { this.value = value; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/errors/GleanDataError.java b/src/main/java/com/glean/api_client/glean_api_client/models/errors/GleanDataError.java index 0a3e47a6..dadadc69 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/errors/GleanDataError.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/errors/GleanDataError.java @@ -17,7 +17,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; @SuppressWarnings("serial") @@ -54,6 +53,7 @@ public GleanDataError( @JsonProperty("badOutlookToken") Optional badOutlookToken, @JsonProperty("invalidOperators") Optional> invalidOperators, @JsonProperty("errorMessages") Optional> errorMessages) { + super("API error occurred"); Utils.checkNotNull(badGmailToken, "badGmailToken"); Utils.checkNotNull(badOutlookToken, "badOutlookToken"); Utils.checkNotNull(invalidOperators, "invalidOperators"); @@ -180,15 +180,15 @@ public boolean equals(java.lang.Object o) { } GleanDataError other = (GleanDataError) o; return - Objects.deepEquals(this.badGmailToken, other.badGmailToken) && - Objects.deepEquals(this.badOutlookToken, other.badOutlookToken) && - Objects.deepEquals(this.invalidOperators, other.invalidOperators) && - Objects.deepEquals(this.errorMessages, other.errorMessages); + Utils.enhancedDeepEquals(this.badGmailToken, other.badGmailToken) && + Utils.enhancedDeepEquals(this.badOutlookToken, other.badOutlookToken) && + Utils.enhancedDeepEquals(this.invalidOperators, other.invalidOperators) && + Utils.enhancedDeepEquals(this.errorMessages, other.errorMessages); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( badGmailToken, badOutlookToken, invalidOperators, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityRequestBuilder.java index ee4b0916..edf6964c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.Activity; +import com.glean.api_client.glean_api_client.operations.ActivityOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class ActivityRequestBuilder { private Activity request; - private final SDKMethodInterfaces.MethodCallActivity sdk; + private final SDKConfiguration sdkConfiguration; - public ActivityRequestBuilder(SDKMethodInterfaces.MethodCallActivity sdk) { - this.sdk = sdk; + public ActivityRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ActivityRequestBuilder request(Activity request) { @@ -23,8 +27,10 @@ public ActivityRequestBuilder request(Activity request) { } public ActivityResponse call() throws Exception { + + RequestOperation operation + = new ActivityOperation( sdkConfiguration); - return sdk.report( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityResponse.java index 5e945de9..c157e47e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ActivityResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class ActivityResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } ActivityResponse other = (ActivityResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsRequestBuilder.java index 32538857..5c10ccb0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.AddCollectionItemsRequest; +import com.glean.api_client.glean_api_client.operations.AddcollectionitemsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class AddcollectionitemsRequestBuilder { private AddCollectionItemsRequest request; - private final SDKMethodInterfaces.MethodCallAddcollectionitems sdk; + private final SDKConfiguration sdkConfiguration; - public AddcollectionitemsRequestBuilder(SDKMethodInterfaces.MethodCallAddcollectionitems sdk) { - this.sdk = sdk; + public AddcollectionitemsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public AddcollectionitemsRequestBuilder request(AddCollectionItemsRequest request) { @@ -23,8 +27,10 @@ public AddcollectionitemsRequestBuilder request(AddCollectionItemsRequest reques } public AddcollectionitemsResponse call() throws Exception { + + RequestOperation operation + = new AddcollectionitemsOperation( sdkConfiguration); - return sdk.addItems( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsResponse.java index 259aa5c8..6e0efb6d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddcollectionitemsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class AddcollectionitemsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } AddcollectionitemsResponse other = (AddcollectionitemsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.addCollectionItemsResponse, other.addCollectionItemsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.addCollectionItemsResponse, other.addCollectionItemsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderRequestBuilder.java index cc918d24..9b8b500e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ReminderRequest; +import com.glean.api_client.glean_api_client.operations.AddverificationreminderOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class AddverificationreminderRequestBuilder { private ReminderRequest request; - private final SDKMethodInterfaces.MethodCallAddverificationreminder sdk; + private final SDKConfiguration sdkConfiguration; - public AddverificationreminderRequestBuilder(SDKMethodInterfaces.MethodCallAddverificationreminder sdk) { - this.sdk = sdk; + public AddverificationreminderRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public AddverificationreminderRequestBuilder request(ReminderRequest request) { @@ -23,8 +27,10 @@ public AddverificationreminderRequestBuilder request(ReminderRequest request) { } public AddverificationreminderResponse call() throws Exception { + + RequestOperation operation + = new AddverificationreminderOperation( sdkConfiguration); - return sdk.addReminder( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderResponse.java index 97625746..9d2f9f2a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AddverificationreminderResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class AddverificationreminderResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } AddverificationreminderResponse other = (AddverificationreminderResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.verification, other.verification); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.verification, other.verification); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchRequestBuilder.java index 9af04693..5d3208b0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.SearchRequest; +import com.glean.api_client.glean_api_client.operations.AdminsearchOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class AdminsearchRequestBuilder { private SearchRequest request; - private final SDKMethodInterfaces.MethodCallAdminsearch sdk; + private final SDKConfiguration sdkConfiguration; - public AdminsearchRequestBuilder(SDKMethodInterfaces.MethodCallAdminsearch sdk) { - this.sdk = sdk; + public AdminsearchRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public AdminsearchRequestBuilder request(SearchRequest request) { @@ -23,8 +27,10 @@ public AdminsearchRequestBuilder request(SearchRequest request) { } public AdminsearchResponse call() throws Exception { + + RequestOperation operation + = new AdminsearchOperation( sdkConfiguration); - return sdk.queryAsAdmin( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchResponse.java index 8a23599d..21fe8729 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AdminsearchResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class AdminsearchResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } AdminsearchResponse other = (AdminsearchResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.searchResponse, other.searchResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.searchResponse, other.searchResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteRequestBuilder.java index 7e5ce67b..e8d6219d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.AutocompleteRequest; +import com.glean.api_client.glean_api_client.operations.AutocompleteOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class AutocompleteRequestBuilder { private AutocompleteRequest request; - private final SDKMethodInterfaces.MethodCallAutocomplete sdk; + private final SDKConfiguration sdkConfiguration; - public AutocompleteRequestBuilder(SDKMethodInterfaces.MethodCallAutocomplete sdk) { - this.sdk = sdk; + public AutocompleteRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public AutocompleteRequestBuilder request(AutocompleteRequest request) { @@ -23,8 +27,10 @@ public AutocompleteRequestBuilder request(AutocompleteRequest request) { } public AutocompleteResponse call() throws Exception { + + RequestOperation operation + = new AutocompleteOperation( sdkConfiguration); - return sdk.autocomplete( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteResponse.java index 1f30624e..ca7747f4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/AutocompleteResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class AutocompleteResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } AutocompleteResponse other = (AutocompleteResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.autocompleteResponse, other.autocompleteResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.autocompleteResponse, other.autocompleteResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequest.java index 9f939eb2..4f5ae6b2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ChatRequest { @@ -100,13 +99,13 @@ public boolean equals(java.lang.Object o) { } ChatRequest other = (ChatRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.chatRequest, other.chatRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.chatRequest, other.chatRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, chatRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequestBuilder.java index 8f874906..bd8f71b2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ChatRequest; +import com.glean.api_client.glean_api_client.operations.ChatOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class ChatRequestBuilder { private Optional timezoneOffset = Optional.empty(); private ChatRequest chatRequest; - private final SDKMethodInterfaces.MethodCallChat sdk; + private final SDKConfiguration sdkConfiguration; - public ChatRequestBuilder(SDKMethodInterfaces.MethodCallChat sdk) { - this.sdk = sdk; + public ChatRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ChatRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public ChatRequestBuilder chatRequest(ChatRequest chatRequest) { return this; } - public ChatResponse call() throws Exception { - return sdk.create( - timezoneOffset, + private com.glean.api_client.glean_api_client.models.operations.ChatRequest buildRequest() { + + com.glean.api_client.glean_api_client.models.operations.ChatRequest request = new com.glean.api_client.glean_api_client.models.operations.ChatRequest(timezoneOffset, chatRequest); + + return request; + } + + public ChatResponse call() throws Exception { + + RequestOperation operation + = new ChatOperation( sdkConfiguration); + com.glean.api_client.glean_api_client.models.operations.ChatRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatResponse.java index fc77ecd0..3c32c8bb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ChatResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } ChatResponse other = (ChatResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.chatResponse, other.chatResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.chatResponse, other.chatResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequest.java index a42f88ee..b1820032 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequest.java @@ -11,7 +11,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ChatStreamRequest { @@ -101,13 +100,13 @@ public boolean equals(java.lang.Object o) { } ChatStreamRequest other = (ChatStreamRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.chatRequest, other.chatRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.chatRequest, other.chatRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, chatRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequestBuilder.java index a781faf2..94ef2391 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ChatRequest; +import com.glean.api_client.glean_api_client.operations.ChatStreamOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class ChatStreamRequestBuilder { private Optional timezoneOffset = Optional.empty(); private ChatRequest chatRequest; - private final SDKMethodInterfaces.MethodCallChatStream sdk; + private final SDKConfiguration sdkConfiguration; - public ChatStreamRequestBuilder(SDKMethodInterfaces.MethodCallChatStream sdk) { - this.sdk = sdk; + public ChatStreamRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ChatStreamRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public ChatStreamRequestBuilder chatRequest(ChatRequest chatRequest) { return this; } - public ChatStreamResponse call() throws Exception { - return sdk.createStream( - timezoneOffset, + private ChatStreamRequest buildRequest() { + + ChatStreamRequest request = new ChatStreamRequest(timezoneOffset, chatRequest); + + return request; + } + + public ChatStreamResponse call() throws Exception { + + RequestOperation operation + = new ChatStreamOperation( sdkConfiguration); + ChatStreamRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamResponse.java index 87170d35..97b10a28 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ChatStreamResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ChatStreamResponse implements Response { @@ -152,15 +151,15 @@ public boolean equals(java.lang.Object o) { } ChatStreamResponse other = (ChatStreamResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.chatRequestStream, other.chatRequestStream); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.chatRequestStream, other.chatRequestStream); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunRequestBuilder.java index 31299896..d3a80568 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; +import com.glean.api_client.glean_api_client.operations.CreateAndStreamRunOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreateAndStreamRunRequestBuilder { private AgentRunCreate request; - private final SDKMethodInterfaces.MethodCallCreateAndStreamRun sdk; + private final SDKConfiguration sdkConfiguration; - public CreateAndStreamRunRequestBuilder(SDKMethodInterfaces.MethodCallCreateAndStreamRun sdk) { - this.sdk = sdk; + public CreateAndStreamRunRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreateAndStreamRunRequestBuilder request(AgentRunCreate request) { @@ -23,8 +27,10 @@ public CreateAndStreamRunRequestBuilder request(AgentRunCreate request) { } public CreateAndStreamRunResponse call() throws Exception { + + RequestOperation operation + = new CreateAndStreamRunOperation( sdkConfiguration); - return sdk.runStream( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunResponse.java index 52ec25c7..cf43392c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndStreamRunResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreateAndStreamRunResponse implements Response { @@ -152,15 +151,15 @@ public boolean equals(java.lang.Object o) { } CreateAndStreamRunResponse other = (CreateAndStreamRunResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.res, other.res); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.res, other.res); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunRequestBuilder.java index b60b83a2..d2f1fdbb 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; +import com.glean.api_client.glean_api_client.operations.CreateAndWaitRunOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreateAndWaitRunRequestBuilder { private AgentRunCreate request; - private final SDKMethodInterfaces.MethodCallCreateAndWaitRun sdk; + private final SDKConfiguration sdkConfiguration; - public CreateAndWaitRunRequestBuilder(SDKMethodInterfaces.MethodCallCreateAndWaitRun sdk) { - this.sdk = sdk; + public CreateAndWaitRunRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreateAndWaitRunRequestBuilder request(AgentRunCreate request) { @@ -23,8 +27,10 @@ public CreateAndWaitRunRequestBuilder request(AgentRunCreate request) { } public CreateAndWaitRunResponse call() throws Exception { + + RequestOperation operation + = new CreateAndWaitRunOperation( sdkConfiguration); - return sdk.run( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunResponse.java index a07352df..2cc47ab8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateAndWaitRunResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreateAndWaitRunResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreateAndWaitRunResponse other = (CreateAndWaitRunResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.agentRunWaitResponse, other.agentRunWaitResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.agentRunWaitResponse, other.agentRunWaitResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementRequestBuilder.java index fb51972a..9bdcbde6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.CreateAnnouncementRequest; +import com.glean.api_client.glean_api_client.operations.CreateannouncementOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreateannouncementRequestBuilder { private CreateAnnouncementRequest request; - private final SDKMethodInterfaces.MethodCallCreateannouncement sdk; + private final SDKConfiguration sdkConfiguration; - public CreateannouncementRequestBuilder(SDKMethodInterfaces.MethodCallCreateannouncement sdk) { - this.sdk = sdk; + public CreateannouncementRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreateannouncementRequestBuilder request(CreateAnnouncementRequest request) { @@ -23,8 +27,10 @@ public CreateannouncementRequestBuilder request(CreateAnnouncementRequest reques } public CreateannouncementResponse call() throws Exception { + + RequestOperation operation + = new CreateannouncementOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementResponse.java index 8e1e50ad..ff458545 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateannouncementResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreateannouncementResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreateannouncementResponse other = (CreateannouncementResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.announcement, other.announcement); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.announcement, other.announcement); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerRequestBuilder.java index e8f39fb3..33c33177 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.CreateAnswerRequest; +import com.glean.api_client.glean_api_client.operations.CreateanswerOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreateanswerRequestBuilder { private CreateAnswerRequest request; - private final SDKMethodInterfaces.MethodCallCreateanswer sdk; + private final SDKConfiguration sdkConfiguration; - public CreateanswerRequestBuilder(SDKMethodInterfaces.MethodCallCreateanswer sdk) { - this.sdk = sdk; + public CreateanswerRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreateanswerRequestBuilder request(CreateAnswerRequest request) { @@ -23,8 +27,10 @@ public CreateanswerRequestBuilder request(CreateAnswerRequest request) { } public CreateanswerResponse call() throws Exception { + + RequestOperation operation + = new CreateanswerOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerResponse.java index eecf02de..c890d288 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateanswerResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreateanswerResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreateanswerResponse other = (CreateanswerResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.answer, other.answer); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.answer, other.answer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenRequestBuilder.java index db50f0e7..0d3c248d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenRequestBuilder.java @@ -3,18 +3,25 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.CreateauthtokenOperation; import java.lang.Exception; public class CreateauthtokenRequestBuilder { - private final SDKMethodInterfaces.MethodCallCreateauthtoken sdk; + private final SDKConfiguration sdkConfiguration; - public CreateauthtokenRequestBuilder(SDKMethodInterfaces.MethodCallCreateauthtoken sdk) { - this.sdk = sdk; + public CreateauthtokenRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreateauthtokenResponse call() throws Exception { + + RequestlessOperation operation + = new CreateauthtokenOperation( sdkConfiguration); - return sdk.createTokenDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenResponse.java index 61c463d1..848ff600 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateauthtokenResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreateauthtokenResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreateauthtokenResponse other = (CreateauthtokenResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.createAuthTokenResponse, other.createAuthTokenResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createAuthTokenResponse, other.createAuthTokenResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionRequestBuilder.java index 60aecf76..47ac32ac 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.CreateCollectionRequest; +import com.glean.api_client.glean_api_client.operations.CreatecollectionOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreatecollectionRequestBuilder { private CreateCollectionRequest request; - private final SDKMethodInterfaces.MethodCallCreatecollection sdk; + private final SDKConfiguration sdkConfiguration; - public CreatecollectionRequestBuilder(SDKMethodInterfaces.MethodCallCreatecollection sdk) { - this.sdk = sdk; + public CreatecollectionRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreatecollectionRequestBuilder request(CreateCollectionRequest request) { @@ -23,8 +27,10 @@ public CreatecollectionRequestBuilder request(CreateCollectionRequest request) { } public CreatecollectionResponse call() throws Exception { + + RequestOperation operation + = new CreatecollectionOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionResponse.java index 2dec24b4..30398bf5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatecollectionResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreatecollectionResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreatecollectionResponse other = (CreatecollectionResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.createCollectionResponse, other.createCollectionResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createCollectionResponse, other.createCollectionResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyRequestBuilder.java index 8a848ad2..f61fcb89 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.CreateDlpReportRequest; +import com.glean.api_client.glean_api_client.operations.CreatepolicyOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreatepolicyRequestBuilder { private CreateDlpReportRequest request; - private final SDKMethodInterfaces.MethodCallCreatepolicy sdk; + private final SDKConfiguration sdkConfiguration; - public CreatepolicyRequestBuilder(SDKMethodInterfaces.MethodCallCreatepolicy sdk) { - this.sdk = sdk; + public CreatepolicyRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreatepolicyRequestBuilder request(CreateDlpReportRequest request) { @@ -23,8 +27,10 @@ public CreatepolicyRequestBuilder request(CreateDlpReportRequest request) { } public CreatepolicyResponse call() throws Exception { + + RequestOperation operation + = new CreatepolicyOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyResponse.java index 75dba914..152bc86e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatepolicyResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreatepolicyResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreatepolicyResponse other = (CreatepolicyResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.createDlpReportResponse, other.createDlpReportResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createDlpReportResponse, other.createDlpReportResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportRequestBuilder.java index fa2d0be3..16fcba38 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UpdateDlpConfigRequest; +import com.glean.api_client.glean_api_client.operations.CreatereportOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreatereportRequestBuilder { private UpdateDlpConfigRequest request; - private final SDKMethodInterfaces.MethodCallCreatereport sdk; + private final SDKConfiguration sdkConfiguration; - public CreatereportRequestBuilder(SDKMethodInterfaces.MethodCallCreatereport sdk) { - this.sdk = sdk; + public CreatereportRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreatereportRequestBuilder request(UpdateDlpConfigRequest request) { @@ -23,8 +27,10 @@ public CreatereportRequestBuilder request(UpdateDlpConfigRequest request) { } public CreatereportResponse call() throws Exception { + + RequestOperation operation + = new CreatereportOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportResponse.java index dbf695fd..85b7eb36 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreatereportResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreatereportResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreatereportResponse other = (CreatereportResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.updateDlpConfigResponse, other.updateDlpConfigResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateDlpConfigResponse, other.updateDlpConfigResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutRequestBuilder.java index 768f3cfc..952bb3da 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.CreateShortcutRequest; +import com.glean.api_client.glean_api_client.operations.CreateshortcutOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class CreateshortcutRequestBuilder { private CreateShortcutRequest request; - private final SDKMethodInterfaces.MethodCallCreateshortcut sdk; + private final SDKConfiguration sdkConfiguration; - public CreateshortcutRequestBuilder(SDKMethodInterfaces.MethodCallCreateshortcut sdk) { - this.sdk = sdk; + public CreateshortcutRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreateshortcutRequestBuilder request(CreateShortcutRequest request) { @@ -23,8 +27,10 @@ public CreateshortcutRequestBuilder request(CreateShortcutRequest request) { } public CreateshortcutResponse call() throws Exception { + + RequestOperation operation + = new CreateshortcutOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutResponse.java index b51a7232..c2672a30 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/CreateshortcutResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class CreateshortcutResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } CreateshortcutResponse other = (CreateshortcutResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.createShortcutResponse, other.createShortcutResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createShortcutResponse, other.createShortcutResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequest.java index fed21cb3..058dd7df 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DeleteallchatsRequest { @@ -73,12 +72,12 @@ public boolean equals(java.lang.Object o) { } DeleteallchatsRequest other = (DeleteallchatsRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequestBuilder.java index 666823fc..67b8da63 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.DeleteallchatsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -11,10 +15,10 @@ public class DeleteallchatsRequestBuilder { private Optional timezoneOffset = Optional.empty(); - private final SDKMethodInterfaces.MethodCallDeleteallchats sdk; + private final SDKConfiguration sdkConfiguration; - public DeleteallchatsRequestBuilder(SDKMethodInterfaces.MethodCallDeleteallchats sdk) { - this.sdk = sdk; + public DeleteallchatsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeleteallchatsRequestBuilder timezoneOffset(long timezoneOffset) { @@ -29,9 +33,20 @@ public DeleteallchatsRequestBuilder timezoneOffset(Optional timezoneOffset return this; } + + private DeleteallchatsRequest buildRequest() { + + DeleteallchatsRequest request = new DeleteallchatsRequest(timezoneOffset); + + return request; + } + public DeleteallchatsResponse call() throws Exception { + + RequestOperation operation + = new DeleteallchatsOperation( sdkConfiguration); + DeleteallchatsRequest request = buildRequest(); - return sdk.deleteAll( - timezoneOffset); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsResponse.java index 7c079116..1a6d7f79 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteallchatsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class DeleteallchatsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } DeleteallchatsResponse other = (DeleteallchatsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementRequestBuilder.java index ceca7f9b..9b7c3ede 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteAnnouncementRequest; +import com.glean.api_client.glean_api_client.operations.DeleteannouncementOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class DeleteannouncementRequestBuilder { private DeleteAnnouncementRequest request; - private final SDKMethodInterfaces.MethodCallDeleteannouncement sdk; + private final SDKConfiguration sdkConfiguration; - public DeleteannouncementRequestBuilder(SDKMethodInterfaces.MethodCallDeleteannouncement sdk) { - this.sdk = sdk; + public DeleteannouncementRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeleteannouncementRequestBuilder request(DeleteAnnouncementRequest request) { @@ -23,8 +27,10 @@ public DeleteannouncementRequestBuilder request(DeleteAnnouncementRequest reques } public DeleteannouncementResponse call() throws Exception { + + RequestOperation operation + = new DeleteannouncementOperation( sdkConfiguration); - return sdk.delete( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementResponse.java index a6f34ecc..8af2034b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteannouncementResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class DeleteannouncementResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } DeleteannouncementResponse other = (DeleteannouncementResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerRequestBuilder.java index 185ab3bd..8fd95958 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteAnswerRequest; +import com.glean.api_client.glean_api_client.operations.DeleteanswerOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class DeleteanswerRequestBuilder { private DeleteAnswerRequest request; - private final SDKMethodInterfaces.MethodCallDeleteanswer sdk; + private final SDKConfiguration sdkConfiguration; - public DeleteanswerRequestBuilder(SDKMethodInterfaces.MethodCallDeleteanswer sdk) { - this.sdk = sdk; + public DeleteanswerRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeleteanswerRequestBuilder request(DeleteAnswerRequest request) { @@ -23,8 +27,10 @@ public DeleteanswerRequestBuilder request(DeleteAnswerRequest request) { } public DeleteanswerResponse call() throws Exception { + + RequestOperation operation + = new DeleteanswerOperation( sdkConfiguration); - return sdk.delete( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerResponse.java index d56b9c17..e8be7a1b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteanswerResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class DeleteanswerResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } DeleteanswerResponse other = (DeleteanswerResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequest.java index 853442f4..8c6953d1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequest.java @@ -11,7 +11,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DeletechatfilesRequest { @@ -92,13 +91,13 @@ public boolean equals(java.lang.Object o) { } DeletechatfilesRequest other = (DeletechatfilesRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.deleteChatFilesRequest, other.deleteChatFilesRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.deleteChatFilesRequest, other.deleteChatFilesRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, deleteChatFilesRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequestBuilder.java index 6c01b25e..78290520 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteChatFilesRequest; +import com.glean.api_client.glean_api_client.operations.DeletechatfilesOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class DeletechatfilesRequestBuilder { private Optional timezoneOffset = Optional.empty(); private DeleteChatFilesRequest deleteChatFilesRequest; - private final SDKMethodInterfaces.MethodCallDeletechatfiles sdk; + private final SDKConfiguration sdkConfiguration; - public DeletechatfilesRequestBuilder(SDKMethodInterfaces.MethodCallDeletechatfiles sdk) { - this.sdk = sdk; + public DeletechatfilesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeletechatfilesRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public DeletechatfilesRequestBuilder deleteChatFilesRequest(DeleteChatFilesReque return this; } - public DeletechatfilesResponse call() throws Exception { - return sdk.deleteFiles( - timezoneOffset, + private DeletechatfilesRequest buildRequest() { + + DeletechatfilesRequest request = new DeletechatfilesRequest(timezoneOffset, deleteChatFilesRequest); + + return request; + } + + public DeletechatfilesResponse call() throws Exception { + + RequestOperation operation + = new DeletechatfilesOperation( sdkConfiguration); + DeletechatfilesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesResponse.java index 4d8beeb4..60b123c4 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatfilesResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class DeletechatfilesResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } DeletechatfilesResponse other = (DeletechatfilesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequest.java index d9fd860b..b76109a3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequest.java @@ -11,7 +11,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class DeletechatsRequest { @@ -92,13 +91,13 @@ public boolean equals(java.lang.Object o) { } DeletechatsRequest other = (DeletechatsRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.deleteChatsRequest, other.deleteChatsRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.deleteChatsRequest, other.deleteChatsRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, deleteChatsRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequestBuilder.java index 285994a8..6ab8365e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteChatsRequest; +import com.glean.api_client.glean_api_client.operations.DeletechatsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class DeletechatsRequestBuilder { private Optional timezoneOffset = Optional.empty(); private DeleteChatsRequest deleteChatsRequest; - private final SDKMethodInterfaces.MethodCallDeletechats sdk; + private final SDKConfiguration sdkConfiguration; - public DeletechatsRequestBuilder(SDKMethodInterfaces.MethodCallDeletechats sdk) { - this.sdk = sdk; + public DeletechatsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeletechatsRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public DeletechatsRequestBuilder deleteChatsRequest(DeleteChatsRequest deleteCha return this; } - public DeletechatsResponse call() throws Exception { - return sdk.delete( - timezoneOffset, + private DeletechatsRequest buildRequest() { + + DeletechatsRequest request = new DeletechatsRequest(timezoneOffset, deleteChatsRequest); + + return request; + } + + public DeletechatsResponse call() throws Exception { + + RequestOperation operation + = new DeletechatsOperation( sdkConfiguration); + DeletechatsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsResponse.java index 4fc12388..33bc810d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletechatsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class DeletechatsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } DeletechatsResponse other = (DeletechatsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionRequestBuilder.java index 8b9b1416..5a0ad08f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteCollectionRequest; +import com.glean.api_client.glean_api_client.operations.DeletecollectionOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class DeletecollectionRequestBuilder { private DeleteCollectionRequest request; - private final SDKMethodInterfaces.MethodCallDeletecollection sdk; + private final SDKConfiguration sdkConfiguration; - public DeletecollectionRequestBuilder(SDKMethodInterfaces.MethodCallDeletecollection sdk) { - this.sdk = sdk; + public DeletecollectionRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeletecollectionRequestBuilder request(DeleteCollectionRequest request) { @@ -23,8 +27,10 @@ public DeletecollectionRequestBuilder request(DeleteCollectionRequest request) { } public DeletecollectionResponse call() throws Exception { + + RequestOperation operation + = new DeletecollectionOperation( sdkConfiguration); - return sdk.delete( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionResponse.java index e00613b4..d3a87a76 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class DeletecollectionResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } DeletecollectionResponse other = (DeletecollectionResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemRequestBuilder.java index 31dc48c7..fd167723 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteCollectionItemRequest; +import com.glean.api_client.glean_api_client.operations.DeletecollectionitemOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class DeletecollectionitemRequestBuilder { private DeleteCollectionItemRequest request; - private final SDKMethodInterfaces.MethodCallDeletecollectionitem sdk; + private final SDKConfiguration sdkConfiguration; - public DeletecollectionitemRequestBuilder(SDKMethodInterfaces.MethodCallDeletecollectionitem sdk) { - this.sdk = sdk; + public DeletecollectionitemRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeletecollectionitemRequestBuilder request(DeleteCollectionItemRequest request) { @@ -23,8 +27,10 @@ public DeletecollectionitemRequestBuilder request(DeleteCollectionItemRequest re } public DeletecollectionitemResponse call() throws Exception { + + RequestOperation operation + = new DeletecollectionitemOperation( sdkConfiguration); - return sdk.deleteItem( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemResponse.java index 1a81c76c..c65b4880 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeletecollectionitemResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class DeletecollectionitemResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } DeletecollectionitemResponse other = (DeletecollectionitemResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.deleteCollectionItemResponse, other.deleteCollectionItemResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.deleteCollectionItemResponse, other.deleteCollectionItemResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutRequestBuilder.java index f53fd7c2..133f01ee 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteShortcutRequest; +import com.glean.api_client.glean_api_client.operations.DeleteshortcutOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class DeleteshortcutRequestBuilder { private DeleteShortcutRequest request; - private final SDKMethodInterfaces.MethodCallDeleteshortcut sdk; + private final SDKConfiguration sdkConfiguration; - public DeleteshortcutRequestBuilder(SDKMethodInterfaces.MethodCallDeleteshortcut sdk) { - this.sdk = sdk; + public DeleteshortcutRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeleteshortcutRequestBuilder request(DeleteShortcutRequest request) { @@ -23,8 +27,10 @@ public DeleteshortcutRequestBuilder request(DeleteShortcutRequest request) { } public DeleteshortcutResponse call() throws Exception { + + RequestOperation operation + = new DeleteshortcutOperation( sdkConfiguration); - return sdk.delete( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutResponse.java index 68f3fc69..cd463b4d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DeleteshortcutResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class DeleteshortcutResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } DeleteshortcutResponse other = (DeleteshortcutResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequest.java index bbb40e23..ac1401ff 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class DownloadpolicycsvRequest { @@ -58,12 +57,12 @@ public boolean equals(java.lang.Object o) { } DownloadpolicycsvRequest other = (DownloadpolicycsvRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequestBuilder.java index 42e368ce..67c2aedc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.DownloadpolicycsvOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ public class DownloadpolicycsvRequestBuilder { private String id; - private final SDKMethodInterfaces.MethodCallDownloadpolicycsv sdk; + private final SDKConfiguration sdkConfiguration; - public DownloadpolicycsvRequestBuilder(SDKMethodInterfaces.MethodCallDownloadpolicycsv sdk) { - this.sdk = sdk; + public DownloadpolicycsvRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DownloadpolicycsvRequestBuilder id(String id) { @@ -22,9 +26,20 @@ public DownloadpolicycsvRequestBuilder id(String id) { return this; } + + private DownloadpolicycsvRequest buildRequest() { + + DownloadpolicycsvRequest request = new DownloadpolicycsvRequest(id); + + return request; + } + public DownloadpolicycsvResponse call() throws Exception { + + RequestOperation operation + = new DownloadpolicycsvOperation( sdkConfiguration); + DownloadpolicycsvRequest request = buildRequest(); - return sdk.download( - id); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvResponse.java index 7a304022..fb750005 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadpolicycsvResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class DownloadpolicycsvResponse implements Response { @@ -152,15 +151,15 @@ public boolean equals(java.lang.Object o) { } DownloadpolicycsvResponse other = (DownloadpolicycsvResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.res, other.res); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.res, other.res); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequest.java index 6685eab8..26e8a4c8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class DownloadreportcsvRequest { @@ -58,12 +57,12 @@ public boolean equals(java.lang.Object o) { } DownloadreportcsvRequest other = (DownloadreportcsvRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequestBuilder.java index d4574b69..5f0738c9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.DownloadreportcsvOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ public class DownloadreportcsvRequestBuilder { private String id; - private final SDKMethodInterfaces.MethodCallDownloadreportcsv sdk; + private final SDKConfiguration sdkConfiguration; - public DownloadreportcsvRequestBuilder(SDKMethodInterfaces.MethodCallDownloadreportcsv sdk) { - this.sdk = sdk; + public DownloadreportcsvRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DownloadreportcsvRequestBuilder id(String id) { @@ -22,9 +26,20 @@ public DownloadreportcsvRequestBuilder id(String id) { return this; } + + private DownloadreportcsvRequest buildRequest() { + + DownloadreportcsvRequest request = new DownloadreportcsvRequest(id); + + return request; + } + public DownloadreportcsvResponse call() throws Exception { + + RequestOperation operation + = new DownloadreportcsvOperation( sdkConfiguration); + DownloadreportcsvRequest request = buildRequest(); - return sdk.download( - id); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvResponse.java index 5385893d..66ebd9fd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/DownloadreportcsvResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class DownloadreportcsvResponse implements Response { @@ -152,15 +151,15 @@ public boolean equals(java.lang.Object o) { } DownloadreportcsvResponse other = (DownloadreportcsvResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.res, other.res); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.res, other.res); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerRequestBuilder.java index 00796883..76a58ff9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.EditAnswerRequest; +import com.glean.api_client.glean_api_client.operations.EditanswerOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class EditanswerRequestBuilder { private EditAnswerRequest request; - private final SDKMethodInterfaces.MethodCallEditanswer sdk; + private final SDKConfiguration sdkConfiguration; - public EditanswerRequestBuilder(SDKMethodInterfaces.MethodCallEditanswer sdk) { - this.sdk = sdk; + public EditanswerRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public EditanswerRequestBuilder request(EditAnswerRequest request) { @@ -23,8 +27,10 @@ public EditanswerRequestBuilder request(EditAnswerRequest request) { } public EditanswerResponse call() throws Exception { + + RequestOperation operation + = new EditanswerOperation( sdkConfiguration); - return sdk.update( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerResponse.java index 40f18746..4c2a958d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditanswerResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class EditanswerResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } EditanswerResponse other = (EditanswerResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.answer, other.answer); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.answer, other.answer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionRequestBuilder.java index e6e3c20f..c1b43f64 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.EditCollectionRequest; +import com.glean.api_client.glean_api_client.operations.EditcollectionOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class EditcollectionRequestBuilder { private EditCollectionRequest request; - private final SDKMethodInterfaces.MethodCallEditcollection sdk; + private final SDKConfiguration sdkConfiguration; - public EditcollectionRequestBuilder(SDKMethodInterfaces.MethodCallEditcollection sdk) { - this.sdk = sdk; + public EditcollectionRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public EditcollectionRequestBuilder request(EditCollectionRequest request) { @@ -23,8 +27,10 @@ public EditcollectionRequestBuilder request(EditCollectionRequest request) { } public EditcollectionResponse call() throws Exception { + + RequestOperation operation + = new EditcollectionOperation( sdkConfiguration); - return sdk.update( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionResponse.java index 853e05d4..43a8bf4c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class EditcollectionResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } EditcollectionResponse other = (EditcollectionResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.editCollectionResponse, other.editCollectionResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.editCollectionResponse, other.editCollectionResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemRequestBuilder.java index 68bfcbf1..0c979164 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.EditCollectionItemRequest; +import com.glean.api_client.glean_api_client.operations.EditcollectionitemOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class EditcollectionitemRequestBuilder { private EditCollectionItemRequest request; - private final SDKMethodInterfaces.MethodCallEditcollectionitem sdk; + private final SDKConfiguration sdkConfiguration; - public EditcollectionitemRequestBuilder(SDKMethodInterfaces.MethodCallEditcollectionitem sdk) { - this.sdk = sdk; + public EditcollectionitemRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public EditcollectionitemRequestBuilder request(EditCollectionItemRequest request) { @@ -23,8 +27,10 @@ public EditcollectionitemRequestBuilder request(EditCollectionItemRequest reques } public EditcollectionitemResponse call() throws Exception { + + RequestOperation operation + = new EditcollectionitemOperation( sdkConfiguration); - return sdk.updateItem( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemResponse.java index 221fd6a5..1669e40c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditcollectionitemResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class EditcollectionitemResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } EditcollectionitemResponse other = (EditcollectionitemResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.editCollectionItemResponse, other.editCollectionItemResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.editCollectionItemResponse, other.editCollectionItemResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinRequestBuilder.java index af89bc15..c193f004 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.EditPinRequest; +import com.glean.api_client.glean_api_client.operations.EditpinOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class EditpinRequestBuilder { private EditPinRequest request; - private final SDKMethodInterfaces.MethodCallEditpin sdk; + private final SDKConfiguration sdkConfiguration; - public EditpinRequestBuilder(SDKMethodInterfaces.MethodCallEditpin sdk) { - this.sdk = sdk; + public EditpinRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public EditpinRequestBuilder request(EditPinRequest request) { @@ -23,8 +27,10 @@ public EditpinRequestBuilder request(EditPinRequest request) { } public EditpinResponse call() throws Exception { + + RequestOperation operation + = new EditpinOperation( sdkConfiguration); - return sdk.update( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinResponse.java index bde4d4a1..e2d29c2c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/EditpinResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class EditpinResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } EditpinResponse other = (EditpinResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.pinDocument, other.pinDocument); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.pinDocument, other.pinDocument); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedRequestBuilder.java index 61818f65..34750aa3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.FeedRequest; +import com.glean.api_client.glean_api_client.operations.FeedOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class FeedRequestBuilder { private FeedRequest request; - private final SDKMethodInterfaces.MethodCallFeed sdk; + private final SDKConfiguration sdkConfiguration; - public FeedRequestBuilder(SDKMethodInterfaces.MethodCallFeed sdk) { - this.sdk = sdk; + public FeedRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public FeedRequestBuilder request(FeedRequest request) { @@ -23,8 +27,10 @@ public FeedRequestBuilder request(FeedRequest request) { } public FeedResponse call() throws Exception { + + RequestOperation operation + = new FeedOperation( sdkConfiguration); - return sdk.retrieveFeed( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedResponse.java index 71eee02c..088468a2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class FeedResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } FeedResponse other = (FeedResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.feedResponse, other.feedResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.feedResponse, other.feedResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequest.java index 2687bfa1..0f2a78ed 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequest.java @@ -11,7 +11,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; public class FeedbackRequest { @@ -98,13 +97,13 @@ public boolean equals(java.lang.Object o) { } FeedbackRequest other = (FeedbackRequest) o; return - Objects.deepEquals(this.feedbackQueryParameter, other.feedbackQueryParameter) && - Objects.deepEquals(this.feedback1, other.feedback1); + Utils.enhancedDeepEquals(this.feedbackQueryParameter, other.feedbackQueryParameter) && + Utils.enhancedDeepEquals(this.feedback1, other.feedback1); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( feedbackQueryParameter, feedback1); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequestBuilder.java index 1096f19b..359d6882 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.Feedback; +import com.glean.api_client.glean_api_client.operations.FeedbackOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -13,10 +17,10 @@ public class FeedbackRequestBuilder { private Optional feedbackQueryParameter = Optional.empty(); private Optional feedback1 = Optional.empty(); - private final SDKMethodInterfaces.MethodCallFeedback sdk; + private final SDKConfiguration sdkConfiguration; - public FeedbackRequestBuilder(SDKMethodInterfaces.MethodCallFeedback sdk) { - this.sdk = sdk; + public FeedbackRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public FeedbackRequestBuilder feedbackQueryParameter(String feedbackQueryParameter) { @@ -43,10 +47,21 @@ public FeedbackRequestBuilder feedback1(Optional feedback1) return this; } - public FeedbackResponse call() throws Exception { - return sdk.feedback( - feedbackQueryParameter, + private FeedbackRequest buildRequest() { + + FeedbackRequest request = new FeedbackRequest(feedbackQueryParameter, feedback1); + + return request; + } + + public FeedbackResponse call() throws Exception { + + RequestOperation operation + = new FeedbackOperation( sdkConfiguration); + FeedbackRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackResponse.java index be1f1b35..ce2fd5f9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/FeedbackResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class FeedbackResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } FeedbackResponse other = (FeedbackResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequest.java index a9926e1d..55c197f6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetAgentRequest { @@ -100,13 +99,13 @@ public boolean equals(java.lang.Object o) { } GetAgentRequest other = (GetAgentRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.agentId, other.agentId); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.agentId, other.agentId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, agentId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequestBuilder.java index 71f0ed31..5f4b101b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.GetAgentOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class GetAgentRequestBuilder { private Optional timezoneOffset = Optional.empty(); private String agentId; - private final SDKMethodInterfaces.MethodCallGetAgent sdk; + private final SDKConfiguration sdkConfiguration; - public GetAgentRequestBuilder(SDKMethodInterfaces.MethodCallGetAgent sdk) { - this.sdk = sdk; + public GetAgentRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetAgentRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public GetAgentRequestBuilder agentId(String agentId) { return this; } - public GetAgentResponse call() throws Exception { - return sdk.retrieve( - timezoneOffset, + private GetAgentRequest buildRequest() { + + GetAgentRequest request = new GetAgentRequest(timezoneOffset, agentId); + + return request; + } + + public GetAgentResponse call() throws Exception { + + RequestOperation operation + = new GetAgentOperation( sdkConfiguration); + GetAgentRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentResponse.java index 9cb26d3c..89133550 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetAgentResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetAgentResponse other = (GetAgentResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.agent, other.agent); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.agent, other.agent); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequest.java index 4373f911..62938043 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetAgentSchemasRequest { @@ -100,13 +99,13 @@ public boolean equals(java.lang.Object o) { } GetAgentSchemasRequest other = (GetAgentSchemasRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.agentId, other.agentId); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.agentId, other.agentId); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, agentId); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequestBuilder.java index 3c316060..afd78ab7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.GetAgentSchemasOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class GetAgentSchemasRequestBuilder { private Optional timezoneOffset = Optional.empty(); private String agentId; - private final SDKMethodInterfaces.MethodCallGetAgentSchemas sdk; + private final SDKConfiguration sdkConfiguration; - public GetAgentSchemasRequestBuilder(SDKMethodInterfaces.MethodCallGetAgentSchemas sdk) { - this.sdk = sdk; + public GetAgentSchemasRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetAgentSchemasRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public GetAgentSchemasRequestBuilder agentId(String agentId) { return this; } - public GetAgentSchemasResponse call() throws Exception { - return sdk.retrieveSchemas( - timezoneOffset, + private GetAgentSchemasRequest buildRequest() { + + GetAgentSchemasRequest request = new GetAgentSchemasRequest(timezoneOffset, agentId); + + return request; + } + + public GetAgentSchemasResponse call() throws Exception { + + RequestOperation operation + = new GetAgentSchemasOperation( sdkConfiguration); + GetAgentSchemasRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasResponse.java index 3ffe618e..545e4c31 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetAgentSchemasResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetAgentSchemasResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetAgentSchemasResponse other = (GetAgentSchemasResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.agentSchemas, other.agentSchemas); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.agentSchemas, other.agentSchemas); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequest.java index 50893963..602e265b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequest.java @@ -11,7 +11,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GetRestApiV1ToolsListRequest { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } GetRestApiV1ToolsListRequest other = (GetRestApiV1ToolsListRequest) o; return - Objects.deepEquals(this.toolNames, other.toolNames); + Utils.enhancedDeepEquals(this.toolNames, other.toolNames); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( toolNames); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequestBuilder.java index 8b54f94e..a1af3b5a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.GetRestApiV1ToolsListOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class GetRestApiV1ToolsListRequestBuilder { private Optional> toolNames = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetRestApiV1ToolsList sdk; + private final SDKConfiguration sdkConfiguration; - public GetRestApiV1ToolsListRequestBuilder(SDKMethodInterfaces.MethodCallGetRestApiV1ToolsList sdk) { - this.sdk = sdk; + public GetRestApiV1ToolsListRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetRestApiV1ToolsListRequestBuilder toolNames(List toolNames) { @@ -30,9 +34,20 @@ public GetRestApiV1ToolsListRequestBuilder toolNames(Optional operation + = new GetRestApiV1ToolsListOperation( sdkConfiguration); + GetRestApiV1ToolsListRequest request = buildRequest(); - return sdk.list( - toolNames); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListResponse.java index ede28016..1a7c0666 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetRestApiV1ToolsListResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetRestApiV1ToolsListResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetRestApiV1ToolsListResponse other = (GetRestApiV1ToolsListResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.toolsListResponse, other.toolsListResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.toolsListResponse, other.toolsListResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerRequestBuilder.java index e44958fb..17ae7a08 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetAnswerRequest; +import com.glean.api_client.glean_api_client.operations.GetanswerOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class GetanswerRequestBuilder { private GetAnswerRequest request; - private final SDKMethodInterfaces.MethodCallGetanswer sdk; + private final SDKConfiguration sdkConfiguration; - public GetanswerRequestBuilder(SDKMethodInterfaces.MethodCallGetanswer sdk) { - this.sdk = sdk; + public GetanswerRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetanswerRequestBuilder request(GetAnswerRequest request) { @@ -23,8 +27,10 @@ public GetanswerRequestBuilder request(GetAnswerRequest request) { } public GetanswerResponse call() throws Exception { + + RequestOperation operation + = new GetanswerOperation( sdkConfiguration); - return sdk.retrieve( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerResponse.java index 69e0fda8..28f480de 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetanswerResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetanswerResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetanswerResponse other = (GetanswerResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getAnswerResponse, other.getAnswerResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getAnswerResponse, other.getAnswerResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequest.java index 87f00568..d86fd951 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequest.java @@ -11,7 +11,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetchatRequest { @@ -92,13 +91,13 @@ public boolean equals(java.lang.Object o) { } GetchatRequest other = (GetchatRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.getChatRequest, other.getChatRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.getChatRequest, other.getChatRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, getChatRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequestBuilder.java index 6de6093f..9ff71e35 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetChatRequest; +import com.glean.api_client.glean_api_client.operations.GetchatOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class GetchatRequestBuilder { private Optional timezoneOffset = Optional.empty(); private GetChatRequest getChatRequest; - private final SDKMethodInterfaces.MethodCallGetchat sdk; + private final SDKConfiguration sdkConfiguration; - public GetchatRequestBuilder(SDKMethodInterfaces.MethodCallGetchat sdk) { - this.sdk = sdk; + public GetchatRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetchatRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public GetchatRequestBuilder getChatRequest(GetChatRequest getChatRequest) { return this; } - public GetchatResponse call() throws Exception { - return sdk.retrieve( - timezoneOffset, + private GetchatRequest buildRequest() { + + GetchatRequest request = new GetchatRequest(timezoneOffset, getChatRequest); + + return request; + } + + public GetchatResponse call() throws Exception { + + RequestOperation operation + = new GetchatOperation( sdkConfiguration); + GetchatRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatResponse.java index 9b3d550c..eef6f5d7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetchatResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetchatResponse other = (GetchatResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getChatResponse, other.getChatResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getChatResponse, other.getChatResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequest.java index e01d35e8..527aef58 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequest.java @@ -11,7 +11,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetchatapplicationRequest { @@ -92,13 +91,13 @@ public boolean equals(java.lang.Object o) { } GetchatapplicationRequest other = (GetchatapplicationRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.getChatApplicationRequest, other.getChatApplicationRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.getChatApplicationRequest, other.getChatApplicationRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, getChatApplicationRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequestBuilder.java index 4f7b0397..822fbd17 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetChatApplicationRequest; +import com.glean.api_client.glean_api_client.operations.GetchatapplicationOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class GetchatapplicationRequestBuilder { private Optional timezoneOffset = Optional.empty(); private GetChatApplicationRequest getChatApplicationRequest; - private final SDKMethodInterfaces.MethodCallGetchatapplication sdk; + private final SDKConfiguration sdkConfiguration; - public GetchatapplicationRequestBuilder(SDKMethodInterfaces.MethodCallGetchatapplication sdk) { - this.sdk = sdk; + public GetchatapplicationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetchatapplicationRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public GetchatapplicationRequestBuilder getChatApplicationRequest(GetChatApplica return this; } - public GetchatapplicationResponse call() throws Exception { - return sdk.retrieveApplication( - timezoneOffset, + private GetchatapplicationRequest buildRequest() { + + GetchatapplicationRequest request = new GetchatapplicationRequest(timezoneOffset, getChatApplicationRequest); + + return request; + } + + public GetchatapplicationResponse call() throws Exception { + + RequestOperation operation + = new GetchatapplicationOperation( sdkConfiguration); + GetchatapplicationRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationResponse.java index 9fc45c67..95650bff 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatapplicationResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetchatapplicationResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetchatapplicationResponse other = (GetchatapplicationResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getChatApplicationResponse, other.getChatApplicationResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getChatApplicationResponse, other.getChatApplicationResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequest.java index 0ec43b98..f6ead714 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequest.java @@ -11,7 +11,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetchatfilesRequest { @@ -92,13 +91,13 @@ public boolean equals(java.lang.Object o) { } GetchatfilesRequest other = (GetchatfilesRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.getChatFilesRequest, other.getChatFilesRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.getChatFilesRequest, other.getChatFilesRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, getChatFilesRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequestBuilder.java index 953c8024..e251b645 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetChatFilesRequest; +import com.glean.api_client.glean_api_client.operations.GetchatfilesOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class GetchatfilesRequestBuilder { private Optional timezoneOffset = Optional.empty(); private GetChatFilesRequest getChatFilesRequest; - private final SDKMethodInterfaces.MethodCallGetchatfiles sdk; + private final SDKConfiguration sdkConfiguration; - public GetchatfilesRequestBuilder(SDKMethodInterfaces.MethodCallGetchatfiles sdk) { - this.sdk = sdk; + public GetchatfilesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetchatfilesRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public GetchatfilesRequestBuilder getChatFilesRequest(GetChatFilesRequest getCha return this; } - public GetchatfilesResponse call() throws Exception { - return sdk.retrieveFiles( - timezoneOffset, + private GetchatfilesRequest buildRequest() { + + GetchatfilesRequest request = new GetchatfilesRequest(timezoneOffset, getChatFilesRequest); + + return request; + } + + public GetchatfilesResponse call() throws Exception { + + RequestOperation operation + = new GetchatfilesOperation( sdkConfiguration); + GetchatfilesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesResponse.java index 1678f9a1..8966b459 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetchatfilesResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetchatfilesResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetchatfilesResponse other = (GetchatfilesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getChatFilesResponse, other.getChatFilesResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getChatFilesResponse, other.getChatFilesResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionRequestBuilder.java index 3f0386b5..c7f07ec5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetCollectionRequest; +import com.glean.api_client.glean_api_client.operations.GetcollectionOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class GetcollectionRequestBuilder { private GetCollectionRequest request; - private final SDKMethodInterfaces.MethodCallGetcollection sdk; + private final SDKConfiguration sdkConfiguration; - public GetcollectionRequestBuilder(SDKMethodInterfaces.MethodCallGetcollection sdk) { - this.sdk = sdk; + public GetcollectionRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetcollectionRequestBuilder request(GetCollectionRequest request) { @@ -23,8 +27,10 @@ public GetcollectionRequestBuilder request(GetCollectionRequest request) { } public GetcollectionResponse call() throws Exception { + + RequestOperation operation + = new GetcollectionOperation( sdkConfiguration); - return sdk.retrieve( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionResponse.java index 3c3a3c36..8f63a2be 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetcollectionResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetcollectionResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetcollectionResponse other = (GetcollectionResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getCollectionResponse, other.getCollectionResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getCollectionResponse, other.getCollectionResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsRequestBuilder.java index a4a2ebd5..1b402d6f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetDocPermissionsRequest; +import com.glean.api_client.glean_api_client.operations.GetdocpermissionsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class GetdocpermissionsRequestBuilder { private GetDocPermissionsRequest request; - private final SDKMethodInterfaces.MethodCallGetdocpermissions sdk; + private final SDKConfiguration sdkConfiguration; - public GetdocpermissionsRequestBuilder(SDKMethodInterfaces.MethodCallGetdocpermissions sdk) { - this.sdk = sdk; + public GetdocpermissionsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetdocpermissionsRequestBuilder request(GetDocPermissionsRequest request) { @@ -23,8 +27,10 @@ public GetdocpermissionsRequestBuilder request(GetDocPermissionsRequest request) } public GetdocpermissionsResponse call() throws Exception { + + RequestOperation operation + = new GetdocpermissionsOperation( sdkConfiguration); - return sdk.retrievePermissions( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsResponse.java index 20611ee4..a4c816c7 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocpermissionsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetdocpermissionsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetdocpermissionsResponse other = (GetdocpermissionsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getDocPermissionsResponse, other.getDocPermissionsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getDocPermissionsResponse, other.getDocPermissionsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsRequestBuilder.java index 287b993f..e4178d14 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetDocumentsRequest; +import com.glean.api_client.glean_api_client.operations.GetdocumentsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.util.Optional; @@ -11,10 +15,10 @@ public class GetdocumentsRequestBuilder { private Optional request = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetdocuments sdk; + private final SDKConfiguration sdkConfiguration; - public GetdocumentsRequestBuilder(SDKMethodInterfaces.MethodCallGetdocuments sdk) { - this.sdk = sdk; + public GetdocumentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetdocumentsRequestBuilder request(GetDocumentsRequest request) { @@ -30,8 +34,10 @@ public GetdocumentsRequestBuilder request(Optional, GetdocumentsResponse> operation + = new GetdocumentsOperation( sdkConfiguration); - return sdk.retrieve( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsResponse.java index d421b69b..b50c4a8c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetdocumentsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetdocumentsResponse other = (GetdocumentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getDocumentsResponse, other.getDocumentsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getDocumentsResponse, other.getDocumentsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsRequestBuilder.java index 905f573c..eb89ea87 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetDocumentsByFacetsRequest; +import com.glean.api_client.glean_api_client.operations.GetdocumentsbyfacetsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.util.Optional; @@ -11,10 +15,10 @@ public class GetdocumentsbyfacetsRequestBuilder { private Optional request = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetdocumentsbyfacets sdk; + private final SDKConfiguration sdkConfiguration; - public GetdocumentsbyfacetsRequestBuilder(SDKMethodInterfaces.MethodCallGetdocumentsbyfacets sdk) { - this.sdk = sdk; + public GetdocumentsbyfacetsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetdocumentsbyfacetsRequestBuilder request(GetDocumentsByFacetsRequest request) { @@ -30,8 +34,10 @@ public GetdocumentsbyfacetsRequestBuilder request(Optional, GetdocumentsbyfacetsResponse> operation + = new GetdocumentsbyfacetsOperation( sdkConfiguration); - return sdk.retrieveByFacets( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsResponse.java index df875180..34f2f2f5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocumentsbyfacetsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetdocumentsbyfacetsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetdocumentsbyfacetsResponse other = (GetdocumentsbyfacetsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getDocumentsByFacetsResponse, other.getDocumentsByFacetsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getDocumentsByFacetsResponse, other.getDocumentsByFacetsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequest.java index 18950b16..b92e878b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequest.java @@ -11,7 +11,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; public class GetdocvisibilityRequest { @@ -75,12 +74,12 @@ public boolean equals(java.lang.Object o) { } GetdocvisibilityRequest other = (GetdocvisibilityRequest) o; return - Objects.deepEquals(this.docIds, other.docIds); + Utils.enhancedDeepEquals(this.docIds, other.docIds); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( docIds); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequestBuilder.java index 1e4c94fa..e3bf0ce8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.GetdocvisibilityOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class GetdocvisibilityRequestBuilder { private Optional> docIds = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetdocvisibility sdk; + private final SDKConfiguration sdkConfiguration; - public GetdocvisibilityRequestBuilder(SDKMethodInterfaces.MethodCallGetdocvisibility sdk) { - this.sdk = sdk; + public GetdocvisibilityRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetdocvisibilityRequestBuilder docIds(List docIds) { @@ -30,9 +34,20 @@ public GetdocvisibilityRequestBuilder docIds(Optional> do return this; } + + private GetdocvisibilityRequest buildRequest() { + + GetdocvisibilityRequest request = new GetdocvisibilityRequest(docIds); + + return request; + } + public GetdocvisibilityResponse call() throws Exception { + + RequestOperation operation + = new GetdocvisibilityOperation( sdkConfiguration); + GetdocvisibilityRequest request = buildRequest(); - return sdk.list( - docIds); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityResponse.java index 6e310df6..35847af3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetdocvisibilityResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetdocvisibilityResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetdocvisibilityResponse other = (GetdocvisibilityResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getDocumentVisibilityOverridesResponse, other.getDocumentVisibilityOverridesResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getDocumentVisibilityOverridesResponse, other.getDocumentVisibilityOverridesResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinRequestBuilder.java index 017f3bb5..b9df2848 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetPinRequest; +import com.glean.api_client.glean_api_client.operations.GetpinOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class GetpinRequestBuilder { private GetPinRequest request; - private final SDKMethodInterfaces.MethodCallGetpin sdk; + private final SDKConfiguration sdkConfiguration; - public GetpinRequestBuilder(SDKMethodInterfaces.MethodCallGetpin sdk) { - this.sdk = sdk; + public GetpinRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetpinRequestBuilder request(GetPinRequest request) { @@ -23,8 +27,10 @@ public GetpinRequestBuilder request(GetPinRequest request) { } public GetpinResponse call() throws Exception { + + RequestOperation operation + = new GetpinOperation( sdkConfiguration); - return sdk.retrieve( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinResponse.java index 9cc34773..0fcbeedd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpinResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetpinResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetpinResponse other = (GetpinResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getPinResponse, other.getPinResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getPinResponse, other.getPinResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequest.java index ab0df421..76f48e75 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class GetpolicyRequest { @@ -100,13 +99,13 @@ public boolean equals(java.lang.Object o) { } GetpolicyRequest other = (GetpolicyRequest) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.version, other.version); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.version, other.version); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, version); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequestBuilder.java index c9cc5165..57c76bc9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.GetpolicyOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class GetpolicyRequestBuilder { private String id; private Optional version = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetpolicy sdk; + private final SDKConfiguration sdkConfiguration; - public GetpolicyRequestBuilder(SDKMethodInterfaces.MethodCallGetpolicy sdk) { - this.sdk = sdk; + public GetpolicyRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetpolicyRequestBuilder id(String id) { @@ -37,10 +41,21 @@ public GetpolicyRequestBuilder version(Optional version) { return this; } - public GetpolicyResponse call() throws Exception { - return sdk.retrieve( - id, + private GetpolicyRequest buildRequest() { + + GetpolicyRequest request = new GetpolicyRequest(id, version); + + return request; + } + + public GetpolicyResponse call() throws Exception { + + RequestOperation operation + = new GetpolicyOperation( sdkConfiguration); + GetpolicyRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyResponse.java index 0c9d27bf..0c033799 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetpolicyResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetpolicyResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetpolicyResponse other = (GetpolicyResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getDlpReportResponse, other.getDlpReportResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getDlpReportResponse, other.getDlpReportResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequest.java index c800bd92..659a133f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class GetreportstatusRequest { @@ -58,12 +57,12 @@ public boolean equals(java.lang.Object o) { } GetreportstatusRequest other = (GetreportstatusRequest) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequestBuilder.java index 395d6137..7cc5c034 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.GetreportstatusOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ public class GetreportstatusRequestBuilder { private String id; - private final SDKMethodInterfaces.MethodCallGetreportstatus sdk; + private final SDKConfiguration sdkConfiguration; - public GetreportstatusRequestBuilder(SDKMethodInterfaces.MethodCallGetreportstatus sdk) { - this.sdk = sdk; + public GetreportstatusRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetreportstatusRequestBuilder id(String id) { @@ -22,9 +26,20 @@ public GetreportstatusRequestBuilder id(String id) { return this; } + + private GetreportstatusRequest buildRequest() { + + GetreportstatusRequest request = new GetreportstatusRequest(id); + + return request; + } + public GetreportstatusResponse call() throws Exception { + + RequestOperation operation + = new GetreportstatusOperation( sdkConfiguration); + GetreportstatusRequest request = buildRequest(); - return sdk.status( - id); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusResponse.java index 28cbdf0d..f7063cb8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetreportstatusResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetreportstatusResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetreportstatusResponse other = (GetreportstatusResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.reportStatusResponse, other.reportStatusResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.reportStatusResponse, other.reportStatusResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutRequestBuilder.java index 322aa4ef..82392839 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetShortcutRequestUnion; +import com.glean.api_client.glean_api_client.operations.GetshortcutOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class GetshortcutRequestBuilder { private GetShortcutRequestUnion request; - private final SDKMethodInterfaces.MethodCallGetshortcut sdk; + private final SDKConfiguration sdkConfiguration; - public GetshortcutRequestBuilder(SDKMethodInterfaces.MethodCallGetshortcut sdk) { - this.sdk = sdk; + public GetshortcutRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetshortcutRequestBuilder request(GetShortcutRequestUnion request) { @@ -23,8 +27,10 @@ public GetshortcutRequestBuilder request(GetShortcutRequestUnion request) { } public GetshortcutResponse call() throws Exception { + + RequestOperation operation + = new GetshortcutOperation( sdkConfiguration); - return sdk.retrieve( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutResponse.java index 31e9f258..fc735a5d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/GetshortcutResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class GetshortcutResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } GetshortcutResponse other = (GetshortcutResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getShortcutResponse, other.getShortcutResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getShortcutResponse, other.getShortcutResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsRequestBuilder.java index 15e0b8fe..255832a1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.InsightsRequest; +import com.glean.api_client.glean_api_client.operations.InsightsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class InsightsRequestBuilder { private InsightsRequest request; - private final SDKMethodInterfaces.MethodCallInsights sdk; + private final SDKConfiguration sdkConfiguration; - public InsightsRequestBuilder(SDKMethodInterfaces.MethodCallInsights sdk) { - this.sdk = sdk; + public InsightsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public InsightsRequestBuilder request(InsightsRequest request) { @@ -23,8 +27,10 @@ public InsightsRequestBuilder request(InsightsRequest request) { } public InsightsResponse call() throws Exception { + + RequestOperation operation + = new InsightsOperation( sdkConfiguration); - return sdk.retrieve( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsResponse.java index 87567b2c..aea21155 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/InsightsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class InsightsResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } InsightsResponse other = (InsightsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.insightsResponse, other.insightsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.insightsResponse, other.insightsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersRequestBuilder.java index 87a94e41..b7313347 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ListAnswersRequest; +import com.glean.api_client.glean_api_client.operations.ListanswersOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class ListanswersRequestBuilder { private ListAnswersRequest request; - private final SDKMethodInterfaces.MethodCallListanswers sdk; + private final SDKConfiguration sdkConfiguration; - public ListanswersRequestBuilder(SDKMethodInterfaces.MethodCallListanswers sdk) { - this.sdk = sdk; + public ListanswersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListanswersRequestBuilder request(ListAnswersRequest request) { @@ -23,8 +27,10 @@ public ListanswersRequestBuilder request(ListAnswersRequest request) { } public ListanswersResponse call() throws Exception { + + RequestOperation operation + = new ListanswersOperation( sdkConfiguration); - return sdk.list( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersResponse.java index 5dd09231..bae1fd50 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListanswersResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListanswersResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListanswersResponse other = (ListanswersResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.listAnswersResponse, other.listAnswersResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.listAnswersResponse, other.listAnswersResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequest.java index 37909d6d..1d253736 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ListchatsRequest { @@ -73,12 +72,12 @@ public boolean equals(java.lang.Object o) { } ListchatsRequest other = (ListchatsRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequestBuilder.java index 62c065eb..28269918 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.ListchatsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -11,10 +15,10 @@ public class ListchatsRequestBuilder { private Optional timezoneOffset = Optional.empty(); - private final SDKMethodInterfaces.MethodCallListchats sdk; + private final SDKConfiguration sdkConfiguration; - public ListchatsRequestBuilder(SDKMethodInterfaces.MethodCallListchats sdk) { - this.sdk = sdk; + public ListchatsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListchatsRequestBuilder timezoneOffset(long timezoneOffset) { @@ -29,9 +33,20 @@ public ListchatsRequestBuilder timezoneOffset(Optional timezoneOffset) { return this; } + + private ListchatsRequest buildRequest() { + + ListchatsRequest request = new ListchatsRequest(timezoneOffset); + + return request; + } + public ListchatsResponse call() throws Exception { + + RequestOperation operation + = new ListchatsOperation( sdkConfiguration); + ListchatsRequest request = buildRequest(); - return sdk.list( - timezoneOffset); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsResponse.java index a9d91d52..1f3a6907 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListchatsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListchatsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListchatsResponse other = (ListchatsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.listChatsResponse, other.listChatsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.listChatsResponse, other.listChatsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsRequestBuilder.java index f17f5c4b..7a0ee6ca 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ListCollectionsRequest; +import com.glean.api_client.glean_api_client.operations.ListcollectionsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class ListcollectionsRequestBuilder { private ListCollectionsRequest request; - private final SDKMethodInterfaces.MethodCallListcollections sdk; + private final SDKConfiguration sdkConfiguration; - public ListcollectionsRequestBuilder(SDKMethodInterfaces.MethodCallListcollections sdk) { - this.sdk = sdk; + public ListcollectionsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListcollectionsRequestBuilder request(ListCollectionsRequest request) { @@ -23,8 +27,10 @@ public ListcollectionsRequestBuilder request(ListCollectionsRequest request) { } public ListcollectionsResponse call() throws Exception { + + RequestOperation operation + = new ListcollectionsOperation( sdkConfiguration); - return sdk.list( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsResponse.java index 2bc37654..b592eb01 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListcollectionsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListcollectionsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListcollectionsResponse other = (ListcollectionsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.listCollectionsResponse, other.listCollectionsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.listCollectionsResponse, other.listCollectionsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesRequestBuilder.java index a8bbc093..7b4b6e8f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ListEntitiesRequest; +import com.glean.api_client.glean_api_client.operations.ListentitiesOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class ListentitiesRequestBuilder { private ListEntitiesRequest request; - private final SDKMethodInterfaces.MethodCallListentities sdk; + private final SDKConfiguration sdkConfiguration; - public ListentitiesRequestBuilder(SDKMethodInterfaces.MethodCallListentities sdk) { - this.sdk = sdk; + public ListentitiesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListentitiesRequestBuilder request(ListEntitiesRequest request) { @@ -23,8 +27,10 @@ public ListentitiesRequestBuilder request(ListEntitiesRequest request) { } public ListentitiesResponse call() throws Exception { + + RequestOperation operation + = new ListentitiesOperation( sdkConfiguration); - return sdk.list( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesResponse.java index 1ec8c6b3..6f6f08a5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListentitiesResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListentitiesResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListentitiesResponse other = (ListentitiesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.listEntitiesResponse, other.listEntitiesResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.listEntitiesResponse, other.listEntitiesResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequest.java index 70e14c72..de0c1eb3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequest.java @@ -7,7 +7,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * ListpinsRequest @@ -40,7 +39,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequestBuilder.java index e612d402..6cb239f5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsRequestBuilder.java @@ -3,16 +3,20 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.ListpinsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class ListpinsRequestBuilder { private ListpinsRequest request; - private final SDKMethodInterfaces.MethodCallListpins sdk; + private final SDKConfiguration sdkConfiguration; - public ListpinsRequestBuilder(SDKMethodInterfaces.MethodCallListpins sdk) { - this.sdk = sdk; + public ListpinsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListpinsRequestBuilder request(ListpinsRequest request) { @@ -22,8 +26,10 @@ public ListpinsRequestBuilder request(ListpinsRequest request) { } public ListpinsResponse call() throws Exception { + + RequestOperation operation + = new ListpinsOperation( sdkConfiguration); - return sdk.list( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsResponse.java index c1559040..ccef2b92 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpinsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListpinsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListpinsResponse other = (ListpinsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.listPinsResponse, other.listPinsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.listPinsResponse, other.listPinsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequest.java index 4be74dbb..0000a323 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequest.java @@ -10,7 +10,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ListpoliciesRequest { @@ -108,13 +107,13 @@ public boolean equals(java.lang.Object o) { } ListpoliciesRequest other = (ListpoliciesRequest) o; return - Objects.deepEquals(this.autoHide, other.autoHide) && - Objects.deepEquals(this.frequency, other.frequency); + Utils.enhancedDeepEquals(this.autoHide, other.autoHide) && + Utils.enhancedDeepEquals(this.frequency, other.frequency); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( autoHide, frequency); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequestBuilder.java index 13b738be..cfe7fb48 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.ListpoliciesOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Boolean; import java.lang.Exception; @@ -13,10 +17,10 @@ public class ListpoliciesRequestBuilder { private Optional autoHide = Optional.empty(); private Optional frequency = Optional.empty(); - private final SDKMethodInterfaces.MethodCallListpolicies sdk; + private final SDKConfiguration sdkConfiguration; - public ListpoliciesRequestBuilder(SDKMethodInterfaces.MethodCallListpolicies sdk) { - this.sdk = sdk; + public ListpoliciesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListpoliciesRequestBuilder autoHide(boolean autoHide) { @@ -43,10 +47,21 @@ public ListpoliciesRequestBuilder frequency(Optional frequency) { return this; } - public ListpoliciesResponse call() throws Exception { - return sdk.list( - autoHide, + private ListpoliciesRequest buildRequest() { + + ListpoliciesRequest request = new ListpoliciesRequest(autoHide, frequency); + + return request; + } + + public ListpoliciesResponse call() throws Exception { + + RequestOperation operation + = new ListpoliciesOperation( sdkConfiguration); + ListpoliciesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesResponse.java index 1d1baacb..1e244708 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListpoliciesResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListpoliciesResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListpoliciesResponse other = (ListpoliciesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.listDlpReportsResponse, other.listDlpReportsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.listDlpReportsResponse, other.listDlpReportsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsRequestBuilder.java index 074946ba..a4b8cc5b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ListShortcutsPaginatedRequest; +import com.glean.api_client.glean_api_client.operations.ListshortcutsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class ListshortcutsRequestBuilder { private ListShortcutsPaginatedRequest request; - private final SDKMethodInterfaces.MethodCallListshortcuts sdk; + private final SDKConfiguration sdkConfiguration; - public ListshortcutsRequestBuilder(SDKMethodInterfaces.MethodCallListshortcuts sdk) { - this.sdk = sdk; + public ListshortcutsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListshortcutsRequestBuilder request(ListShortcutsPaginatedRequest request) { @@ -23,8 +27,10 @@ public ListshortcutsRequestBuilder request(ListShortcutsPaginatedRequest request } public ListshortcutsResponse call() throws Exception { + + RequestOperation operation + = new ListshortcutsOperation( sdkConfiguration); - return sdk.list( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsResponse.java index 185b51b8..462f9743 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListshortcutsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListshortcutsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListshortcutsResponse other = (ListshortcutsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.listShortcutsPaginatedResponse, other.listShortcutsPaginatedResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.listShortcutsPaginatedResponse, other.listShortcutsPaginatedResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequest.java index 1c26c72e..8462fb00 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequest.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class ListverificationsRequest { @@ -73,12 +72,12 @@ public boolean equals(java.lang.Object o) { } ListverificationsRequest other = (ListverificationsRequest) o; return - Objects.deepEquals(this.count, other.count); + Utils.enhancedDeepEquals(this.count, other.count); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( count); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequestBuilder.java index 429dbb2f..62a492e3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.ListverificationsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -11,10 +15,10 @@ public class ListverificationsRequestBuilder { private Optional count = Optional.empty(); - private final SDKMethodInterfaces.MethodCallListverifications sdk; + private final SDKConfiguration sdkConfiguration; - public ListverificationsRequestBuilder(SDKMethodInterfaces.MethodCallListverifications sdk) { - this.sdk = sdk; + public ListverificationsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ListverificationsRequestBuilder count(long count) { @@ -29,9 +33,20 @@ public ListverificationsRequestBuilder count(Optional count) { return this; } + + private ListverificationsRequest buildRequest() { + + ListverificationsRequest request = new ListverificationsRequest(count); + + return request; + } + public ListverificationsResponse call() throws Exception { + + RequestOperation operation + = new ListverificationsOperation( sdkConfiguration); + ListverificationsRequest request = buildRequest(); - return sdk.list( - count); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsResponse.java index 719339bd..41a8f288 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/ListverificationsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class ListverificationsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } ListverificationsResponse other = (ListverificationsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.verificationFeed, other.verificationFeed); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.verificationFeed, other.verificationFeed); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesRequestBuilder.java index b9fb086a..14960ecf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.MessagesRequest; +import com.glean.api_client.glean_api_client.operations.MessagesOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class MessagesRequestBuilder { private MessagesRequest request; - private final SDKMethodInterfaces.MethodCallMessages sdk; + private final SDKConfiguration sdkConfiguration; - public MessagesRequestBuilder(SDKMethodInterfaces.MethodCallMessages sdk) { - this.sdk = sdk; + public MessagesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public MessagesRequestBuilder request(MessagesRequest request) { @@ -23,8 +27,10 @@ public MessagesRequestBuilder request(MessagesRequest request) { } public MessagesResponse call() throws Exception { + + RequestOperation operation + = new MessagesOperation( sdkConfiguration); - return sdk.retrieve( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesResponse.java index 6f8930b7..c8ae3e5e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/MessagesResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class MessagesResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } MessagesResponse other = (MessagesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.messagesResponse, other.messagesResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.messagesResponse, other.messagesResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleRequestBuilder.java index ca93afba..809db0a3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.PeopleRequest; +import com.glean.api_client.glean_api_client.operations.PeopleOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PeopleRequestBuilder { private PeopleRequest request; - private final SDKMethodInterfaces.MethodCallPeople sdk; + private final SDKConfiguration sdkConfiguration; - public PeopleRequestBuilder(SDKMethodInterfaces.MethodCallPeople sdk) { - this.sdk = sdk; + public PeopleRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PeopleRequestBuilder request(PeopleRequest request) { @@ -23,8 +27,10 @@ public PeopleRequestBuilder request(PeopleRequest request) { } public PeopleResponse call() throws Exception { + + RequestOperation operation + = new PeopleOperation( sdkConfiguration); - return sdk.readPeople( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleResponse.java index 8cb67001..d3656fad 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PeopleResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PeopleResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } PeopleResponse other = (PeopleResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.peopleResponse, other.peopleResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.peopleResponse, other.peopleResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinRequestBuilder.java index 2a1268ff..e3473348 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.PinRequest; +import com.glean.api_client.glean_api_client.operations.PinOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PinRequestBuilder { private PinRequest request; - private final SDKMethodInterfaces.MethodCallPin sdk; + private final SDKConfiguration sdkConfiguration; - public PinRequestBuilder(SDKMethodInterfaces.MethodCallPin sdk) { - this.sdk = sdk; + public PinRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PinRequestBuilder request(PinRequest request) { @@ -23,8 +27,10 @@ public PinRequestBuilder request(PinRequest request) { } public PinResponse call() throws Exception { + + RequestOperation operation + = new PinOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinResponse.java index b0dbbea1..f339ff31 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PinResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PinResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PinResponse other = (PinResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.pinDocument, other.pinDocument); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.pinDocument, other.pinDocument); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceRequestBuilder.java index 8114b877..f55e42e3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.CustomDatasourceConfig; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1AdddatasourceOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1AdddatasourceRequestBuilder { private CustomDatasourceConfig request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Adddatasource sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1AdddatasourceRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Adddatasource sdk) { - this.sdk = sdk; + public PostApiIndexV1AdddatasourceRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1AdddatasourceRequestBuilder request(CustomDatasourceConfig request) { @@ -23,8 +27,10 @@ public PostApiIndexV1AdddatasourceRequestBuilder request(CustomDatasourceConfig } public PostApiIndexV1AdddatasourceResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1AdddatasourceOperation( sdkConfiguration); - return sdk.add( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceResponse.java index e0b1450d..71714abc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1AdddatasourceResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1AdddatasourceResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1AdddatasourceResponse other = (PostApiIndexV1AdddatasourceResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersRequestBuilder.java index 1de92b28..2a24c263 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GreenlistUsersRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BetausersOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BetausersRequestBuilder { private GreenlistUsersRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Betausers sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BetausersRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Betausers sdk) { - this.sdk = sdk; + public PostApiIndexV1BetausersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BetausersRequestBuilder request(GreenlistUsersRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BetausersRequestBuilder request(GreenlistUsersRequest reque } public PostApiIndexV1BetausersResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BetausersOperation( sdkConfiguration); - return sdk.authorizeBetaUsers( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersResponse.java index 833407cb..6f5d6fe9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BetausersResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BetausersResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BetausersResponse other = (PostApiIndexV1BetausersResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsRequestBuilder.java index 81b2a1c1..f532fef3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.BulkIndexDocumentsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexdocumentsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BulkindexdocumentsRequestBuilder { private BulkIndexDocumentsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexdocuments sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BulkindexdocumentsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexdocuments sdk) { - this.sdk = sdk; + public PostApiIndexV1BulkindexdocumentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BulkindexdocumentsRequestBuilder request(BulkIndexDocumentsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BulkindexdocumentsRequestBuilder request(BulkIndexDocuments } public PostApiIndexV1BulkindexdocumentsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BulkindexdocumentsOperation( sdkConfiguration); - return sdk.bulkIndex( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsResponse.java index fdb36538..fb49a36a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexdocumentsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BulkindexdocumentsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BulkindexdocumentsResponse other = (PostApiIndexV1BulkindexdocumentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesRequestBuilder.java index 2bf1cf77..d333d76b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.BulkIndexEmployeesRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexemployeesOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BulkindexemployeesRequestBuilder { private BulkIndexEmployeesRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexemployees sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BulkindexemployeesRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexemployees sdk) { - this.sdk = sdk; + public PostApiIndexV1BulkindexemployeesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BulkindexemployeesRequestBuilder request(BulkIndexEmployeesRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BulkindexemployeesRequestBuilder request(BulkIndexEmployees } public PostApiIndexV1BulkindexemployeesResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BulkindexemployeesOperation( sdkConfiguration); - return sdk.bulkIndex( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesResponse.java index 7d4463a6..82794c0c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexemployeesResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BulkindexemployeesResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BulkindexemployeesResponse other = (PostApiIndexV1BulkindexemployeesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsRequestBuilder.java index 1d3f708b..750ac87f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.BulkIndexGroupsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexgroupsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BulkindexgroupsRequestBuilder { private BulkIndexGroupsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexgroups sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BulkindexgroupsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexgroups sdk) { - this.sdk = sdk; + public PostApiIndexV1BulkindexgroupsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BulkindexgroupsRequestBuilder request(BulkIndexGroupsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BulkindexgroupsRequestBuilder request(BulkIndexGroupsReques } public PostApiIndexV1BulkindexgroupsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BulkindexgroupsOperation( sdkConfiguration); - return sdk.bulkIndexGroups( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsResponse.java index f27dfcf3..e1017373 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexgroupsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BulkindexgroupsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BulkindexgroupsResponse other = (PostApiIndexV1BulkindexgroupsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsRequestBuilder.java index bbeaa294..0728b4e6 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.BulkIndexMembershipsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexmembershipsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BulkindexmembershipsRequestBuilder { private BulkIndexMembershipsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexmemberships sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BulkindexmembershipsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexmemberships sdk) { - this.sdk = sdk; + public PostApiIndexV1BulkindexmembershipsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BulkindexmembershipsRequestBuilder request(BulkIndexMembershipsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BulkindexmembershipsRequestBuilder request(BulkIndexMembers } public PostApiIndexV1BulkindexmembershipsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BulkindexmembershipsOperation( sdkConfiguration); - return sdk.bulkIndexMemberships( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsResponse.java index 65651aa6..1323f069 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexmembershipsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BulkindexmembershipsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BulkindexmembershipsResponse other = (PostApiIndexV1BulkindexmembershipsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsRequestBuilder.java index 888ce3d4..f0133689 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.BulkIndexShortcutsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexshortcutsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BulkindexshortcutsRequestBuilder { private BulkIndexShortcutsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexshortcuts sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BulkindexshortcutsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexshortcuts sdk) { - this.sdk = sdk; + public PostApiIndexV1BulkindexshortcutsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BulkindexshortcutsRequestBuilder request(BulkIndexShortcutsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BulkindexshortcutsRequestBuilder request(BulkIndexShortcuts } public PostApiIndexV1BulkindexshortcutsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BulkindexshortcutsOperation( sdkConfiguration); - return sdk.bulkIndex( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsResponse.java index ef31dc3f..eb376e2c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexshortcutsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BulkindexshortcutsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BulkindexshortcutsResponse other = (PostApiIndexV1BulkindexshortcutsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsRequestBuilder.java index df16236d..d94b6f17 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.BulkIndexTeamsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexteamsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BulkindexteamsRequestBuilder { private BulkIndexTeamsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexteams sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BulkindexteamsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexteams sdk) { - this.sdk = sdk; + public PostApiIndexV1BulkindexteamsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BulkindexteamsRequestBuilder request(BulkIndexTeamsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BulkindexteamsRequestBuilder request(BulkIndexTeamsRequest } public PostApiIndexV1BulkindexteamsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BulkindexteamsOperation( sdkConfiguration); - return sdk.bulkIndexTeams( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsResponse.java index 604edf23..df448b09 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexteamsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BulkindexteamsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BulkindexteamsResponse other = (PostApiIndexV1BulkindexteamsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersRequestBuilder.java index 223dd095..de7d3311 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.BulkIndexUsersRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1BulkindexusersOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1BulkindexusersRequestBuilder { private BulkIndexUsersRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexusers sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1BulkindexusersRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Bulkindexusers sdk) { - this.sdk = sdk; + public PostApiIndexV1BulkindexusersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1BulkindexusersRequestBuilder request(BulkIndexUsersRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1BulkindexusersRequestBuilder request(BulkIndexUsersRequest } public PostApiIndexV1BulkindexusersResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1BulkindexusersOperation( sdkConfiguration); - return sdk.bulkIndexUsers( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersResponse.java index a764bb75..2c322d6c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1BulkindexusersResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1BulkindexusersResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1BulkindexusersResponse other = (PostApiIndexV1BulkindexusersResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessRequestBuilder.java index 9baafab0..23a90698 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.CheckDocumentAccessRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1CheckdocumentaccessOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1CheckdocumentaccessRequestBuilder { private CheckDocumentAccessRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Checkdocumentaccess sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1CheckdocumentaccessRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Checkdocumentaccess sdk) { - this.sdk = sdk; + public PostApiIndexV1CheckdocumentaccessRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1CheckdocumentaccessRequestBuilder request(CheckDocumentAccessRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1CheckdocumentaccessRequestBuilder request(CheckDocumentAcce } public PostApiIndexV1CheckdocumentaccessResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1CheckdocumentaccessOperation( sdkConfiguration); - return sdk.checkAccess( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessResponse.java index bcb0f072..abe3aa0f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1CheckdocumentaccessResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1CheckdocumentaccessResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1CheckdocumentaccessResponse other = (PostApiIndexV1CheckdocumentaccessResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.checkDocumentAccessResponse, other.checkDocumentAccessResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.checkDocumentAccessResponse, other.checkDocumentAccessResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequest.java index f1b79b64..83d5fa54 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequest.java @@ -10,7 +10,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class PostApiIndexV1DebugDatasourceDocumentRequest { @@ -76,13 +75,13 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceDocumentRequest other = (PostApiIndexV1DebugDatasourceDocumentRequest) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.debugDocumentRequest, other.debugDocumentRequest); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.debugDocumentRequest, other.debugDocumentRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, debugDocumentRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequestBuilder.java index a1f570f7..fcf7852b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DebugDocumentRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceDocumentOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class PostApiIndexV1DebugDatasourceDocumentRequestBuilder { private String datasource; private DebugDocumentRequest debugDocumentRequest; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceDocument sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DebugDatasourceDocumentRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceDocument sdk) { - this.sdk = sdk; + public PostApiIndexV1DebugDatasourceDocumentRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DebugDatasourceDocumentRequestBuilder datasource(String datasource) { @@ -30,10 +34,21 @@ public PostApiIndexV1DebugDatasourceDocumentRequestBuilder debugDocumentRequest( return this; } - public PostApiIndexV1DebugDatasourceDocumentResponse call() throws Exception { - return sdk.debug( - datasource, + private PostApiIndexV1DebugDatasourceDocumentRequest buildRequest() { + + PostApiIndexV1DebugDatasourceDocumentRequest request = new PostApiIndexV1DebugDatasourceDocumentRequest(datasource, debugDocumentRequest); + + return request; + } + + public PostApiIndexV1DebugDatasourceDocumentResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DebugDatasourceDocumentOperation( sdkConfiguration); + PostApiIndexV1DebugDatasourceDocumentRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentResponse.java index 22291f2c..3c0c6c74 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1DebugDatasourceDocumentResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceDocumentResponse other = (PostApiIndexV1DebugDatasourceDocumentResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.debugDocumentResponse, other.debugDocumentResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.debugDocumentResponse, other.debugDocumentResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequest.java index 56307b05..0fedd0f0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequest.java @@ -10,7 +10,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class PostApiIndexV1DebugDatasourceDocumentsRequest { @@ -76,13 +75,13 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceDocumentsRequest other = (PostApiIndexV1DebugDatasourceDocumentsRequest) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.debugDocumentsRequest, other.debugDocumentsRequest); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.debugDocumentsRequest, other.debugDocumentsRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, debugDocumentsRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequestBuilder.java index aba30153..f25a935c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DebugDocumentsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceDocumentsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class PostApiIndexV1DebugDatasourceDocumentsRequestBuilder { private String datasource; private DebugDocumentsRequest debugDocumentsRequest; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceDocuments sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DebugDatasourceDocumentsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceDocuments sdk) { - this.sdk = sdk; + public PostApiIndexV1DebugDatasourceDocumentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DebugDatasourceDocumentsRequestBuilder datasource(String datasource) { @@ -30,10 +34,21 @@ public PostApiIndexV1DebugDatasourceDocumentsRequestBuilder debugDocumentsReques return this; } - public PostApiIndexV1DebugDatasourceDocumentsResponse call() throws Exception { - return sdk.debugMany( - datasource, + private PostApiIndexV1DebugDatasourceDocumentsRequest buildRequest() { + + PostApiIndexV1DebugDatasourceDocumentsRequest request = new PostApiIndexV1DebugDatasourceDocumentsRequest(datasource, debugDocumentsRequest); + + return request; + } + + public PostApiIndexV1DebugDatasourceDocumentsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DebugDatasourceDocumentsOperation( sdkConfiguration); + PostApiIndexV1DebugDatasourceDocumentsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsResponse.java index b93c5695..d2566685 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceDocumentsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1DebugDatasourceDocumentsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceDocumentsResponse other = (PostApiIndexV1DebugDatasourceDocumentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.debugDocumentsResponse, other.debugDocumentsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.debugDocumentsResponse, other.debugDocumentsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequest.java index bcb61450..c599c95b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequest.java @@ -9,7 +9,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class PostApiIndexV1DebugDatasourceStatusRequest { @@ -58,12 +57,12 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceStatusRequest other = (PostApiIndexV1DebugDatasourceStatusRequest) o; return - Objects.deepEquals(this.datasource, other.datasource); + Utils.enhancedDeepEquals(this.datasource, other.datasource); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequestBuilder.java index f2692998..233a197e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusRequestBuilder.java @@ -3,6 +3,10 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceStatusOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ public class PostApiIndexV1DebugDatasourceStatusRequestBuilder { private String datasource; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceStatus sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DebugDatasourceStatusRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceStatus sdk) { - this.sdk = sdk; + public PostApiIndexV1DebugDatasourceStatusRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DebugDatasourceStatusRequestBuilder datasource(String datasource) { @@ -22,9 +26,20 @@ public PostApiIndexV1DebugDatasourceStatusRequestBuilder datasource(String datas return this; } + + private PostApiIndexV1DebugDatasourceStatusRequest buildRequest() { + + PostApiIndexV1DebugDatasourceStatusRequest request = new PostApiIndexV1DebugDatasourceStatusRequest(datasource); + + return request; + } + public PostApiIndexV1DebugDatasourceStatusResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DebugDatasourceStatusOperation( sdkConfiguration); + PostApiIndexV1DebugDatasourceStatusRequest request = buildRequest(); - return sdk.status( - datasource); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusResponse.java index c7006b85..fe68a01a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceStatusResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1DebugDatasourceStatusResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceStatusResponse other = (PostApiIndexV1DebugDatasourceStatusResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.debugDatasourceStatusResponse, other.debugDatasourceStatusResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.debugDatasourceStatusResponse, other.debugDatasourceStatusResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequest.java index 9239a1d6..b31410bd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequest.java @@ -10,7 +10,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class PostApiIndexV1DebugDatasourceUserRequest { @@ -76,13 +75,13 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceUserRequest other = (PostApiIndexV1DebugDatasourceUserRequest) o; return - Objects.deepEquals(this.datasource, other.datasource) && - Objects.deepEquals(this.debugUserRequest, other.debugUserRequest); + Utils.enhancedDeepEquals(this.datasource, other.datasource) && + Utils.enhancedDeepEquals(this.debugUserRequest, other.debugUserRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( datasource, debugUserRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequestBuilder.java index 520dc337..d7bd85c5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DebugUserRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DebugDatasourceUserOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class PostApiIndexV1DebugDatasourceUserRequestBuilder { private String datasource; private DebugUserRequest debugUserRequest; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceUser sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DebugDatasourceUserRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1DebugDatasourceUser sdk) { - this.sdk = sdk; + public PostApiIndexV1DebugDatasourceUserRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DebugDatasourceUserRequestBuilder datasource(String datasource) { @@ -30,10 +34,21 @@ public PostApiIndexV1DebugDatasourceUserRequestBuilder debugUserRequest(DebugUse return this; } - public PostApiIndexV1DebugDatasourceUserResponse call() throws Exception { - return sdk.debug( - datasource, + private PostApiIndexV1DebugDatasourceUserRequest buildRequest() { + + PostApiIndexV1DebugDatasourceUserRequest request = new PostApiIndexV1DebugDatasourceUserRequest(datasource, debugUserRequest); + + return request; + } + + public PostApiIndexV1DebugDatasourceUserResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DebugDatasourceUserOperation( sdkConfiguration); + PostApiIndexV1DebugDatasourceUserRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserResponse.java index 911157ed..d3a819ae 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DebugDatasourceUserResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1DebugDatasourceUserResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DebugDatasourceUserResponse other = (PostApiIndexV1DebugDatasourceUserResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.debugUserResponse, other.debugUserResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.debugUserResponse, other.debugUserResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentRequestBuilder.java index ec786e87..2a18caaa 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteDocumentRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeletedocumentOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1DeletedocumentRequestBuilder { private DeleteDocumentRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Deletedocument sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DeletedocumentRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Deletedocument sdk) { - this.sdk = sdk; + public PostApiIndexV1DeletedocumentRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DeletedocumentRequestBuilder request(DeleteDocumentRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1DeletedocumentRequestBuilder request(DeleteDocumentRequest } public PostApiIndexV1DeletedocumentResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DeletedocumentOperation( sdkConfiguration); - return sdk.delete( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentResponse.java index 0d0b417b..26627e73 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletedocumentResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1DeletedocumentResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DeletedocumentResponse other = (PostApiIndexV1DeletedocumentResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeRequestBuilder.java index 79e2a987..1f0cdf48 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteEmployeeRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeleteemployeeOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1DeleteemployeeRequestBuilder { private DeleteEmployeeRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Deleteemployee sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DeleteemployeeRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Deleteemployee sdk) { - this.sdk = sdk; + public PostApiIndexV1DeleteemployeeRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DeleteemployeeRequestBuilder request(DeleteEmployeeRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1DeleteemployeeRequestBuilder request(DeleteEmployeeRequest } public PostApiIndexV1DeleteemployeeResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DeleteemployeeOperation( sdkConfiguration); - return sdk.delete( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeResponse.java index db6b334f..5635fc73 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteemployeeResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1DeleteemployeeResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DeleteemployeeResponse other = (PostApiIndexV1DeleteemployeeResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupRequestBuilder.java index 596b86b6..3e8f92ee 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteGroupRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeletegroupOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1DeletegroupRequestBuilder { private DeleteGroupRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Deletegroup sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DeletegroupRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Deletegroup sdk) { - this.sdk = sdk; + public PostApiIndexV1DeletegroupRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DeletegroupRequestBuilder request(DeleteGroupRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1DeletegroupRequestBuilder request(DeleteGroupRequest reques } public PostApiIndexV1DeletegroupResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DeletegroupOperation( sdkConfiguration); - return sdk.deleteGroup( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupResponse.java index ea20d28e..df70640b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletegroupResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1DeletegroupResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DeletegroupResponse other = (PostApiIndexV1DeletegroupResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipRequestBuilder.java index f7190689..d580867b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteMembershipRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeletemembershipOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1DeletemembershipRequestBuilder { private DeleteMembershipRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Deletemembership sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DeletemembershipRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Deletemembership sdk) { - this.sdk = sdk; + public PostApiIndexV1DeletemembershipRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DeletemembershipRequestBuilder request(DeleteMembershipRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1DeletemembershipRequestBuilder request(DeleteMembershipRequ } public PostApiIndexV1DeletemembershipResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DeletemembershipOperation( sdkConfiguration); - return sdk.deleteMembership( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipResponse.java index 91fb9a89..d9a83c92 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeletemembershipResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1DeletemembershipResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DeletemembershipResponse other = (PostApiIndexV1DeletemembershipResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamRequestBuilder.java index 0115e4a7..f341638d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteTeamRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeleteteamOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1DeleteteamRequestBuilder { private DeleteTeamRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Deleteteam sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DeleteteamRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Deleteteam sdk) { - this.sdk = sdk; + public PostApiIndexV1DeleteteamRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DeleteteamRequestBuilder request(DeleteTeamRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1DeleteteamRequestBuilder request(DeleteTeamRequest request) } public PostApiIndexV1DeleteteamResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DeleteteamOperation( sdkConfiguration); - return sdk.deleteTeam( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamResponse.java index d4ac7cbc..338e21fd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteteamResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1DeleteteamResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DeleteteamResponse other = (PostApiIndexV1DeleteteamResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserRequestBuilder.java index 2ea316cd..bab2ef1d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.DeleteUserRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1DeleteuserOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1DeleteuserRequestBuilder { private DeleteUserRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Deleteuser sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1DeleteuserRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Deleteuser sdk) { - this.sdk = sdk; + public PostApiIndexV1DeleteuserRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1DeleteuserRequestBuilder request(DeleteUserRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1DeleteuserRequestBuilder request(DeleteUserRequest request) } public PostApiIndexV1DeleteuserResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1DeleteuserOperation( sdkConfiguration); - return sdk.deleteUser( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserResponse.java index 3c55b291..2b6cc1ab 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1DeleteuserResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1DeleteuserResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1DeleteuserResponse other = (PostApiIndexV1DeleteuserResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigRequestBuilder.java index 4ab10b44..358b4fa9 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetDatasourceConfigRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetdatasourceconfigOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1GetdatasourceconfigRequestBuilder { private GetDatasourceConfigRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Getdatasourceconfig sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1GetdatasourceconfigRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Getdatasourceconfig sdk) { - this.sdk = sdk; + public PostApiIndexV1GetdatasourceconfigRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1GetdatasourceconfigRequestBuilder request(GetDatasourceConfigRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1GetdatasourceconfigRequestBuilder request(GetDatasourceConf } public PostApiIndexV1GetdatasourceconfigResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1GetdatasourceconfigOperation( sdkConfiguration); - return sdk.retrieveConfig( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigResponse.java index cf9f0ee6..8fffc64c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdatasourceconfigResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1GetdatasourceconfigResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1GetdatasourceconfigResponse other = (PostApiIndexV1GetdatasourceconfigResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.customDatasourceConfig, other.customDatasourceConfig); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.customDatasourceConfig, other.customDatasourceConfig); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountRequestBuilder.java index 23eee7b0..a72af5ab 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetDocumentCountRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetdocumentcountOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1GetdocumentcountRequestBuilder { private GetDocumentCountRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Getdocumentcount sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1GetdocumentcountRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Getdocumentcount sdk) { - this.sdk = sdk; + public PostApiIndexV1GetdocumentcountRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1GetdocumentcountRequestBuilder request(GetDocumentCountRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1GetdocumentcountRequestBuilder request(GetDocumentCountRequ } public PostApiIndexV1GetdocumentcountResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1GetdocumentcountOperation( sdkConfiguration); - return sdk.count( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountResponse.java index 0ce41163..e3b77422 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentcountResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1GetdocumentcountResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1GetdocumentcountResponse other = (PostApiIndexV1GetdocumentcountResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getDocumentCountResponse, other.getDocumentCountResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getDocumentCountResponse, other.getDocumentCountResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusRequestBuilder.java index 337cd913..75476672 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetDocumentStatusRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetdocumentstatusOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1GetdocumentstatusRequestBuilder { private GetDocumentStatusRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Getdocumentstatus sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1GetdocumentstatusRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Getdocumentstatus sdk) { - this.sdk = sdk; + public PostApiIndexV1GetdocumentstatusRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1GetdocumentstatusRequestBuilder request(GetDocumentStatusRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1GetdocumentstatusRequestBuilder request(GetDocumentStatusRe } public PostApiIndexV1GetdocumentstatusResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1GetdocumentstatusOperation( sdkConfiguration); - return sdk.status( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusResponse.java index 103c858d..c7ac623f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetdocumentstatusResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1GetdocumentstatusResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1GetdocumentstatusResponse other = (PostApiIndexV1GetdocumentstatusResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getDocumentStatusResponse, other.getDocumentStatusResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getDocumentStatusResponse, other.getDocumentStatusResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountRequestBuilder.java index 2168a285..a05e8835 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.GetUserCountRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1GetusercountOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1GetusercountRequestBuilder { private GetUserCountRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Getusercount sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1GetusercountRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Getusercount sdk) { - this.sdk = sdk; + public PostApiIndexV1GetusercountRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1GetusercountRequestBuilder request(GetUserCountRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1GetusercountRequestBuilder request(GetUserCountRequest requ } public PostApiIndexV1GetusercountResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1GetusercountOperation( sdkConfiguration); - return sdk.count( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountResponse.java index fad3de4d..a3692e98 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1GetusercountResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1GetusercountResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1GetusercountResponse other = (PostApiIndexV1GetusercountResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.getUserCountResponse, other.getUserCountResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getUserCountResponse, other.getUserCountResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentRequestBuilder.java index b3ab5263..0de41bb5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.IndexDocumentRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexdocumentOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1IndexdocumentRequestBuilder { private IndexDocumentRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Indexdocument sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1IndexdocumentRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Indexdocument sdk) { - this.sdk = sdk; + public PostApiIndexV1IndexdocumentRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1IndexdocumentRequestBuilder request(IndexDocumentRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1IndexdocumentRequestBuilder request(IndexDocumentRequest re } public PostApiIndexV1IndexdocumentResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1IndexdocumentOperation( sdkConfiguration); - return sdk.addOrUpdate( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentResponse.java index b0903155..8d9a991f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1IndexdocumentResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1IndexdocumentResponse other = (PostApiIndexV1IndexdocumentResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsRequestBuilder.java index 4c9e98bc..c663c1cf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.IndexDocumentsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexdocumentsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1IndexdocumentsRequestBuilder { private IndexDocumentsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Indexdocuments sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1IndexdocumentsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Indexdocuments sdk) { - this.sdk = sdk; + public PostApiIndexV1IndexdocumentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1IndexdocumentsRequestBuilder request(IndexDocumentsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1IndexdocumentsRequestBuilder request(IndexDocumentsRequest } public PostApiIndexV1IndexdocumentsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1IndexdocumentsOperation( sdkConfiguration); - return sdk.index( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsResponse.java index 4b583b54..b87316b1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexdocumentsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1IndexdocumentsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1IndexdocumentsResponse other = (PostApiIndexV1IndexdocumentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeRequestBuilder.java index 15e2ae44..8d37fe19 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.IndexEmployeeRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexemployeeOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1IndexemployeeRequestBuilder { private IndexEmployeeRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Indexemployee sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1IndexemployeeRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Indexemployee sdk) { - this.sdk = sdk; + public PostApiIndexV1IndexemployeeRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1IndexemployeeRequestBuilder request(IndexEmployeeRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1IndexemployeeRequestBuilder request(IndexEmployeeRequest re } public PostApiIndexV1IndexemployeeResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1IndexemployeeOperation( sdkConfiguration); - return sdk.index( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeResponse.java index c9765bad..dde0bc01 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexemployeeResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1IndexemployeeResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1IndexemployeeResponse other = (PostApiIndexV1IndexemployeeResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupRequestBuilder.java index d283c60a..a900b5ec 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.IndexGroupRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexgroupOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1IndexgroupRequestBuilder { private IndexGroupRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Indexgroup sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1IndexgroupRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Indexgroup sdk) { - this.sdk = sdk; + public PostApiIndexV1IndexgroupRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1IndexgroupRequestBuilder request(IndexGroupRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1IndexgroupRequestBuilder request(IndexGroupRequest request) } public PostApiIndexV1IndexgroupResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1IndexgroupOperation( sdkConfiguration); - return sdk.indexGroup( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupResponse.java index 167bb386..5c309005 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexgroupResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1IndexgroupResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1IndexgroupResponse other = (PostApiIndexV1IndexgroupResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipRequestBuilder.java index 6f1c1aa5..a2c7eeb8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.IndexMembershipRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexmembershipOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1IndexmembershipRequestBuilder { private IndexMembershipRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Indexmembership sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1IndexmembershipRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Indexmembership sdk) { - this.sdk = sdk; + public PostApiIndexV1IndexmembershipRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1IndexmembershipRequestBuilder request(IndexMembershipRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1IndexmembershipRequestBuilder request(IndexMembershipReques } public PostApiIndexV1IndexmembershipResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1IndexmembershipOperation( sdkConfiguration); - return sdk.indexMembership( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipResponse.java index 3ca530bc..e5b08135 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexmembershipResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1IndexmembershipResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1IndexmembershipResponse other = (PostApiIndexV1IndexmembershipResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamRequestBuilder.java index 2e5a028b..bd6dd7ff 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.IndexTeamRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexteamOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1IndexteamRequestBuilder { private IndexTeamRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Indexteam sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1IndexteamRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Indexteam sdk) { - this.sdk = sdk; + public PostApiIndexV1IndexteamRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1IndexteamRequestBuilder request(IndexTeamRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1IndexteamRequestBuilder request(IndexTeamRequest request) { } public PostApiIndexV1IndexteamResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1IndexteamOperation( sdkConfiguration); - return sdk.indexTeam( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamResponse.java index beac3da4..326ee0bd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexteamResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1IndexteamResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1IndexteamResponse other = (PostApiIndexV1IndexteamResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserRequestBuilder.java index 77260525..5ed97479 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.IndexUserRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1IndexuserOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1IndexuserRequestBuilder { private IndexUserRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Indexuser sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1IndexuserRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Indexuser sdk) { - this.sdk = sdk; + public PostApiIndexV1IndexuserRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1IndexuserRequestBuilder request(IndexUserRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1IndexuserRequestBuilder request(IndexUserRequest request) { } public PostApiIndexV1IndexuserResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1IndexuserOperation( sdkConfiguration); - return sdk.indexUser( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserResponse.java index 6aadbc52..23d5dd41 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1IndexuserResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1IndexuserResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1IndexuserResponse other = (PostApiIndexV1IndexuserResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsRequestBuilder.java index 30ab40b8..ba33ef6a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ProcessAllDocumentsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1ProcessalldocumentsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.util.Optional; @@ -11,10 +15,10 @@ public class PostApiIndexV1ProcessalldocumentsRequestBuilder { private Optional request = Optional.empty(); - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Processalldocuments sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1ProcessalldocumentsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Processalldocuments sdk) { - this.sdk = sdk; + public PostApiIndexV1ProcessalldocumentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1ProcessalldocumentsRequestBuilder request(ProcessAllDocumentsRequest request) { @@ -30,8 +34,10 @@ public PostApiIndexV1ProcessalldocumentsRequestBuilder request(Optional, PostApiIndexV1ProcessalldocumentsResponse> operation + = new PostApiIndexV1ProcessalldocumentsOperation( sdkConfiguration); - return sdk.processAll( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsResponse.java index 4168a4f8..dd1154e2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessalldocumentsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1ProcessalldocumentsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1ProcessalldocumentsResponse other = (PostApiIndexV1ProcessalldocumentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsRequestBuilder.java index b995ef2d..020e7d0c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsRequestBuilder.java @@ -3,18 +3,25 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1ProcessallemployeesandteamsOperation; import java.lang.Exception; public class PostApiIndexV1ProcessallemployeesandteamsRequestBuilder { - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Processallemployeesandteams sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1ProcessallemployeesandteamsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Processallemployeesandteams sdk) { - this.sdk = sdk; + public PostApiIndexV1ProcessallemployeesandteamsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1ProcessallemployeesandteamsResponse call() throws Exception { + + RequestlessOperation operation + = new PostApiIndexV1ProcessallemployeesandteamsOperation( sdkConfiguration); - return sdk.processAllEmployeesAndTeamsDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsResponse.java index 9a890c4f..516bf838 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallemployeesandteamsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1ProcessallemployeesandteamsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1ProcessallemployeesandteamsResponse other = (PostApiIndexV1ProcessallemployeesandteamsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsRequestBuilder.java index 1b0d09e5..83f31773 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ProcessAllMembershipsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1ProcessallmembershipsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.util.Optional; @@ -11,10 +15,10 @@ public class PostApiIndexV1ProcessallmembershipsRequestBuilder { private Optional request = Optional.empty(); - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Processallmemberships sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1ProcessallmembershipsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Processallmemberships sdk) { - this.sdk = sdk; + public PostApiIndexV1ProcessallmembershipsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1ProcessallmembershipsRequestBuilder request(ProcessAllMembershipsRequest request) { @@ -30,8 +34,10 @@ public PostApiIndexV1ProcessallmembershipsRequestBuilder request(Optional, PostApiIndexV1ProcessallmembershipsResponse> operation + = new PostApiIndexV1ProcessallmembershipsOperation( sdkConfiguration); - return sdk.processMemberships( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsResponse.java index 9bc569c3..42283323 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1ProcessallmembershipsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1ProcessallmembershipsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1ProcessallmembershipsResponse other = (PostApiIndexV1ProcessallmembershipsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenRequestBuilder.java index 1bbe2fa9..f70d0a40 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenRequestBuilder.java @@ -3,18 +3,25 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1RotatetokenOperation; import java.lang.Exception; public class PostApiIndexV1RotatetokenRequestBuilder { - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Rotatetoken sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1RotatetokenRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Rotatetoken sdk) { - this.sdk = sdk; + public PostApiIndexV1RotatetokenRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1RotatetokenResponse call() throws Exception { + + RequestlessOperation operation + = new PostApiIndexV1RotatetokenOperation( sdkConfiguration); - return sdk.rotateTokenDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenResponse.java index f2ded9eb..e0543e19 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1RotatetokenResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostApiIndexV1RotatetokenResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1RotatetokenResponse other = (PostApiIndexV1RotatetokenResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.rotateTokenResponse, other.rotateTokenResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.rotateTokenResponse, other.rotateTokenResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsRequestBuilder.java index 6b4ccfde..8934a9ca 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UpdatePermissionsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1UpdatepermissionsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1UpdatepermissionsRequestBuilder { private UpdatePermissionsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Updatepermissions sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1UpdatepermissionsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Updatepermissions sdk) { - this.sdk = sdk; + public PostApiIndexV1UpdatepermissionsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1UpdatepermissionsRequestBuilder request(UpdatePermissionsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1UpdatepermissionsRequestBuilder request(UpdatePermissionsRe } public PostApiIndexV1UpdatepermissionsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1UpdatepermissionsOperation( sdkConfiguration); - return sdk.updatePermissions( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsResponse.java index 15d9955f..8595ff7e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UpdatepermissionsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1UpdatepermissionsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1UpdatepermissionsResponse other = (PostApiIndexV1UpdatepermissionsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsRequestBuilder.java index 17d42b81..32f275a1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UploadShortcutsRequest; +import com.glean.api_client.glean_api_client.operations.PostApiIndexV1UploadshortcutsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostApiIndexV1UploadshortcutsRequestBuilder { private UploadShortcutsRequest request; - private final SDKMethodInterfaces.MethodCallPostApiIndexV1Uploadshortcuts sdk; + private final SDKConfiguration sdkConfiguration; - public PostApiIndexV1UploadshortcutsRequestBuilder(SDKMethodInterfaces.MethodCallPostApiIndexV1Uploadshortcuts sdk) { - this.sdk = sdk; + public PostApiIndexV1UploadshortcutsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostApiIndexV1UploadshortcutsRequestBuilder request(UploadShortcutsRequest request) { @@ -23,8 +27,10 @@ public PostApiIndexV1UploadshortcutsRequestBuilder request(UploadShortcutsReques } public PostApiIndexV1UploadshortcutsResponse call() throws Exception { + + RequestOperation operation + = new PostApiIndexV1UploadshortcutsOperation( sdkConfiguration); - return sdk.upload( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsResponse.java index 5c3a5176..89fd0175 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostApiIndexV1UploadshortcutsResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class PostApiIndexV1UploadshortcutsResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } PostApiIndexV1UploadshortcutsResponse other = (PostApiIndexV1UploadshortcutsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallRequestBuilder.java index e55b218c..e35b39e0 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.ToolsCallRequest; +import com.glean.api_client.glean_api_client.operations.PostRestApiV1ToolsCallOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class PostRestApiV1ToolsCallRequestBuilder { private ToolsCallRequest request; - private final SDKMethodInterfaces.MethodCallPostRestApiV1ToolsCall sdk; + private final SDKConfiguration sdkConfiguration; - public PostRestApiV1ToolsCallRequestBuilder(SDKMethodInterfaces.MethodCallPostRestApiV1ToolsCall sdk) { - this.sdk = sdk; + public PostRestApiV1ToolsCallRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostRestApiV1ToolsCallRequestBuilder request(ToolsCallRequest request) { @@ -23,8 +27,10 @@ public PostRestApiV1ToolsCallRequestBuilder request(ToolsCallRequest request) { } public PostRestApiV1ToolsCallResponse call() throws Exception { + + RequestOperation operation + = new PostRestApiV1ToolsCallOperation( sdkConfiguration); - return sdk.run( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallResponse.java index d1c82d50..0f58bf9a 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PostRestApiV1ToolsCallResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class PostRestApiV1ToolsCallResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } PostRestApiV1ToolsCallResponse other = (PostRestApiV1ToolsCallResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.toolsCallResponse, other.toolsCallResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.toolsCallResponse, other.toolsCallResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsRequestBuilder.java index 20ab2fe1..2531a2cf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.RecommendationsRequest; +import com.glean.api_client.glean_api_client.operations.RecommendationsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class RecommendationsRequestBuilder { private RecommendationsRequest request; - private final SDKMethodInterfaces.MethodCallRecommendations sdk; + private final SDKConfiguration sdkConfiguration; - public RecommendationsRequestBuilder(SDKMethodInterfaces.MethodCallRecommendations sdk) { - this.sdk = sdk; + public RecommendationsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public RecommendationsRequestBuilder request(RecommendationsRequest request) { @@ -23,8 +27,10 @@ public RecommendationsRequestBuilder request(RecommendationsRequest request) { } public RecommendationsResponse call() throws Exception { + + RequestOperation operation + = new RecommendationsOperation( sdkConfiguration); - return sdk.recommendations( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsResponse.java index a59e3e5c..7b3b0363 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/RecommendationsResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class RecommendationsResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } RecommendationsResponse other = (RecommendationsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.resultsResponse, other.resultsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.resultsResponse, other.resultsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SDKMethodInterfaces.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SDKMethodInterfaces.java deleted file mode 100644 index f4b811f2..00000000 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SDKMethodInterfaces.java +++ /dev/null @@ -1,662 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ -package com.glean.api_client.glean_api_client.models.operations; - -import com.glean.api_client.glean_api_client.models.components.Activity; -import com.glean.api_client.glean_api_client.models.components.AddCollectionItemsRequest; -import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; -import com.glean.api_client.glean_api_client.models.components.AutocompleteRequest; -import com.glean.api_client.glean_api_client.models.components.BulkIndexDocumentsRequest; -import com.glean.api_client.glean_api_client.models.components.BulkIndexEmployeesRequest; -import com.glean.api_client.glean_api_client.models.components.BulkIndexGroupsRequest; -import com.glean.api_client.glean_api_client.models.components.BulkIndexMembershipsRequest; -import com.glean.api_client.glean_api_client.models.components.BulkIndexShortcutsRequest; -import com.glean.api_client.glean_api_client.models.components.BulkIndexTeamsRequest; -import com.glean.api_client.glean_api_client.models.components.BulkIndexUsersRequest; -import com.glean.api_client.glean_api_client.models.components.ChatRequest; -import com.glean.api_client.glean_api_client.models.components.CheckDocumentAccessRequest; -import com.glean.api_client.glean_api_client.models.components.CreateAnnouncementRequest; -import com.glean.api_client.glean_api_client.models.components.CreateAnswerRequest; -import com.glean.api_client.glean_api_client.models.components.CreateCollectionRequest; -import com.glean.api_client.glean_api_client.models.components.CreateDlpReportRequest; -import com.glean.api_client.glean_api_client.models.components.CreateShortcutRequest; -import com.glean.api_client.glean_api_client.models.components.CustomDatasourceConfig; -import com.glean.api_client.glean_api_client.models.components.DebugDocumentRequest; -import com.glean.api_client.glean_api_client.models.components.DebugDocumentsRequest; -import com.glean.api_client.glean_api_client.models.components.DebugUserRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteAnnouncementRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteAnswerRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteChatFilesRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteChatsRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteCollectionItemRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteCollectionRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteDocumentRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteEmployeeRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteGroupRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteMembershipRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteShortcutRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteTeamRequest; -import com.glean.api_client.glean_api_client.models.components.DeleteUserRequest; -import com.glean.api_client.glean_api_client.models.components.EditAnswerRequest; -import com.glean.api_client.glean_api_client.models.components.EditCollectionItemRequest; -import com.glean.api_client.glean_api_client.models.components.EditCollectionRequest; -import com.glean.api_client.glean_api_client.models.components.EditPinRequest; -import com.glean.api_client.glean_api_client.models.components.FeedRequest; -import com.glean.api_client.glean_api_client.models.components.Feedback; -import com.glean.api_client.glean_api_client.models.components.GetAnswerRequest; -import com.glean.api_client.glean_api_client.models.components.GetChatApplicationRequest; -import com.glean.api_client.glean_api_client.models.components.GetChatFilesRequest; -import com.glean.api_client.glean_api_client.models.components.GetChatRequest; -import com.glean.api_client.glean_api_client.models.components.GetCollectionRequest; -import com.glean.api_client.glean_api_client.models.components.GetDatasourceConfigRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocPermissionsRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentCountRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentStatusRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentsByFacetsRequest; -import com.glean.api_client.glean_api_client.models.components.GetDocumentsRequest; -import com.glean.api_client.glean_api_client.models.components.GetPinRequest; -import com.glean.api_client.glean_api_client.models.components.GetShortcutRequestUnion; -import com.glean.api_client.glean_api_client.models.components.GetUserCountRequest; -import com.glean.api_client.glean_api_client.models.components.GreenlistUsersRequest; -import com.glean.api_client.glean_api_client.models.components.IndexDocumentRequest; -import com.glean.api_client.glean_api_client.models.components.IndexDocumentsRequest; -import com.glean.api_client.glean_api_client.models.components.IndexEmployeeRequest; -import com.glean.api_client.glean_api_client.models.components.IndexGroupRequest; -import com.glean.api_client.glean_api_client.models.components.IndexMembershipRequest; -import com.glean.api_client.glean_api_client.models.components.IndexTeamRequest; -import com.glean.api_client.glean_api_client.models.components.IndexUserRequest; -import com.glean.api_client.glean_api_client.models.components.InsightsRequest; -import com.glean.api_client.glean_api_client.models.components.ListAnswersRequest; -import com.glean.api_client.glean_api_client.models.components.ListCollectionsRequest; -import com.glean.api_client.glean_api_client.models.components.ListEntitiesRequest; -import com.glean.api_client.glean_api_client.models.components.ListShortcutsPaginatedRequest; -import com.glean.api_client.glean_api_client.models.components.MessagesRequest; -import com.glean.api_client.glean_api_client.models.components.PeopleRequest; -import com.glean.api_client.glean_api_client.models.components.PinRequest; -import com.glean.api_client.glean_api_client.models.components.ProcessAllDocumentsRequest; -import com.glean.api_client.glean_api_client.models.components.ProcessAllMembershipsRequest; -import com.glean.api_client.glean_api_client.models.components.RecommendationsRequest; -import com.glean.api_client.glean_api_client.models.components.ReminderRequest; -import com.glean.api_client.glean_api_client.models.components.SearchAgentsRequest; -import com.glean.api_client.glean_api_client.models.components.SearchRequest; -import com.glean.api_client.glean_api_client.models.components.SummarizeRequest; -import com.glean.api_client.glean_api_client.models.components.ToolsCallRequest; -import com.glean.api_client.glean_api_client.models.components.Unpin; -import com.glean.api_client.glean_api_client.models.components.UpdateAnnouncementRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateDlpConfigRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateDlpReportRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateDocumentVisibilityOverridesRequest; -import com.glean.api_client.glean_api_client.models.components.UpdatePermissionsRequest; -import com.glean.api_client.glean_api_client.models.components.UpdateShortcutRequest; -import com.glean.api_client.glean_api_client.models.components.UploadChatFilesRequest; -import com.glean.api_client.glean_api_client.models.components.UploadShortcutsRequest; -import com.glean.api_client.glean_api_client.models.components.VerifyRequest; -import java.lang.Boolean; -import java.lang.Exception; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.Optional; - -public class SDKMethodInterfaces { - - public interface MethodCallActivity { - ActivityResponse report( - Activity request) throws Exception; - } - - public interface MethodCallFeedback { - FeedbackResponse feedback( - Optional feedbackQueryParameter, - Optional feedback1) throws Exception; - } - - public interface MethodCallCreateannouncement { - CreateannouncementResponse create( - CreateAnnouncementRequest request) throws Exception; - } - - public interface MethodCallDeleteannouncement { - DeleteannouncementResponse delete( - DeleteAnnouncementRequest request) throws Exception; - } - - public interface MethodCallUpdateannouncement { - UpdateannouncementResponse update( - UpdateAnnouncementRequest request) throws Exception; - } - - public interface MethodCallCreateanswer { - CreateanswerResponse create( - CreateAnswerRequest request) throws Exception; - } - - public interface MethodCallDeleteanswer { - DeleteanswerResponse delete( - DeleteAnswerRequest request) throws Exception; - } - - public interface MethodCallEditanswer { - EditanswerResponse update( - EditAnswerRequest request) throws Exception; - } - - public interface MethodCallGetanswer { - GetanswerResponse retrieve( - GetAnswerRequest request) throws Exception; - } - - public interface MethodCallListanswers { - ListanswersResponse list( - ListAnswersRequest request) throws Exception; - } - - public interface MethodCallCreateauthtoken { - CreateauthtokenResponse createTokenDirect() throws Exception; - } - - public interface MethodCallChat { - ChatResponse create( - Optional timezoneOffset, - ChatRequest chatRequest) throws Exception; - } - - public interface MethodCallDeleteallchats { - DeleteallchatsResponse deleteAll( - Optional timezoneOffset) throws Exception; - } - - public interface MethodCallDeletechats { - DeletechatsResponse delete( - Optional timezoneOffset, - DeleteChatsRequest deleteChatsRequest) throws Exception; - } - - public interface MethodCallGetchat { - GetchatResponse retrieve( - Optional timezoneOffset, - GetChatRequest getChatRequest) throws Exception; - } - - public interface MethodCallListchats { - ListchatsResponse list( - Optional timezoneOffset) throws Exception; - } - - public interface MethodCallGetchatapplication { - GetchatapplicationResponse retrieveApplication( - Optional timezoneOffset, - GetChatApplicationRequest getChatApplicationRequest) throws Exception; - } - - public interface MethodCallUploadchatfiles { - UploadchatfilesResponse uploadFiles( - Optional timezoneOffset, - UploadChatFilesRequest uploadChatFilesRequest) throws Exception; - } - - public interface MethodCallGetchatfiles { - GetchatfilesResponse retrieveFiles( - Optional timezoneOffset, - GetChatFilesRequest getChatFilesRequest) throws Exception; - } - - public interface MethodCallDeletechatfiles { - DeletechatfilesResponse deleteFiles( - Optional timezoneOffset, - DeleteChatFilesRequest deleteChatFilesRequest) throws Exception; - } - - public interface MethodCallChatStream { - ChatStreamResponse createStream( - Optional timezoneOffset, - ChatRequest chatRequest) throws Exception; - } - - public interface MethodCallGetAgent { - GetAgentResponse retrieve( - Optional timezoneOffset, - String agentId) throws Exception; - } - - public interface MethodCallGetAgentSchemas { - GetAgentSchemasResponse retrieveSchemas( - Optional timezoneOffset, - String agentId) throws Exception; - } - - public interface MethodCallSearchAgents { - SearchAgentsResponse list( - SearchAgentsRequest request) throws Exception; - } - - public interface MethodCallCreateAndStreamRun { - CreateAndStreamRunResponse runStream( - AgentRunCreate request) throws Exception; - } - - public interface MethodCallCreateAndWaitRun { - CreateAndWaitRunResponse run( - AgentRunCreate request) throws Exception; - } - - public interface MethodCallAddcollectionitems { - AddcollectionitemsResponse addItems( - AddCollectionItemsRequest request) throws Exception; - } - - public interface MethodCallCreatecollection { - CreatecollectionResponse create( - CreateCollectionRequest request) throws Exception; - } - - public interface MethodCallDeletecollection { - DeletecollectionResponse delete( - DeleteCollectionRequest request) throws Exception; - } - - public interface MethodCallDeletecollectionitem { - DeletecollectionitemResponse deleteItem( - DeleteCollectionItemRequest request) throws Exception; - } - - public interface MethodCallEditcollection { - EditcollectionResponse update( - EditCollectionRequest request) throws Exception; - } - - public interface MethodCallEditcollectionitem { - EditcollectionitemResponse updateItem( - EditCollectionItemRequest request) throws Exception; - } - - public interface MethodCallGetcollection { - GetcollectionResponse retrieve( - GetCollectionRequest request) throws Exception; - } - - public interface MethodCallListcollections { - ListcollectionsResponse list( - ListCollectionsRequest request) throws Exception; - } - - public interface MethodCallGetdocpermissions { - GetdocpermissionsResponse retrievePermissions( - GetDocPermissionsRequest request) throws Exception; - } - - public interface MethodCallGetdocuments { - GetdocumentsResponse retrieve( - Optional request) throws Exception; - } - - public interface MethodCallGetdocumentsbyfacets { - GetdocumentsbyfacetsResponse retrieveByFacets( - Optional request) throws Exception; - } - - public interface MethodCallSummarize { - SummarizeResponse summarize( - SummarizeRequest request) throws Exception; - } - - public interface MethodCallInsights { - InsightsResponse retrieve( - InsightsRequest request) throws Exception; - } - - public interface MethodCallMessages { - MessagesResponse retrieve( - MessagesRequest request) throws Exception; - } - - public interface MethodCallEditpin { - EditpinResponse update( - EditPinRequest request) throws Exception; - } - - public interface MethodCallGetpin { - GetpinResponse retrieve( - GetPinRequest request) throws Exception; - } - - public interface MethodCallListpins { - ListpinsResponse list( - ListpinsRequest request) throws Exception; - } - - public interface MethodCallPin { - PinResponse create( - PinRequest request) throws Exception; - } - - public interface MethodCallUnpin { - UnpinResponse remove( - Unpin request) throws Exception; - } - - public interface MethodCallAdminsearch { - AdminsearchResponse queryAsAdmin( - SearchRequest request) throws Exception; - } - - public interface MethodCallAutocomplete { - AutocompleteResponse autocomplete( - AutocompleteRequest request) throws Exception; - } - - public interface MethodCallFeed { - FeedResponse retrieveFeed( - FeedRequest request) throws Exception; - } - - public interface MethodCallRecommendations { - RecommendationsResponse recommendations( - RecommendationsRequest request) throws Exception; - } - - public interface MethodCallSearch { - SearchResponse query( - SearchRequest request) throws Exception; - } - - public interface MethodCallListentities { - ListentitiesResponse list( - ListEntitiesRequest request) throws Exception; - } - - public interface MethodCallPeople { - PeopleResponse readPeople( - PeopleRequest request) throws Exception; - } - - public interface MethodCallCreateshortcut { - CreateshortcutResponse create( - CreateShortcutRequest request) throws Exception; - } - - public interface MethodCallDeleteshortcut { - DeleteshortcutResponse delete( - DeleteShortcutRequest request) throws Exception; - } - - public interface MethodCallGetshortcut { - GetshortcutResponse retrieve( - GetShortcutRequestUnion request) throws Exception; - } - - public interface MethodCallListshortcuts { - ListshortcutsResponse list( - ListShortcutsPaginatedRequest request) throws Exception; - } - - public interface MethodCallUpdateshortcut { - UpdateshortcutResponse update( - UpdateShortcutRequest request) throws Exception; - } - - public interface MethodCallAddverificationreminder { - AddverificationreminderResponse addReminder( - ReminderRequest request) throws Exception; - } - - public interface MethodCallListverifications { - ListverificationsResponse list( - Optional count) throws Exception; - } - - public interface MethodCallVerify { - VerifyResponse verify( - VerifyRequest request) throws Exception; - } - - public interface MethodCallGetRestApiV1ToolsList { - GetRestApiV1ToolsListResponse list( - Optional> toolNames) throws Exception; - } - - public interface MethodCallPostRestApiV1ToolsCall { - PostRestApiV1ToolsCallResponse run( - ToolsCallRequest request) throws Exception; - } - - public interface MethodCallGetpolicy { - GetpolicyResponse retrieve( - String id, - Optional version) throws Exception; - } - - public interface MethodCallUpdatepolicy { - UpdatepolicyResponse update( - String id, - UpdateDlpReportRequest updateDlpReportRequest) throws Exception; - } - - public interface MethodCallListpolicies { - ListpoliciesResponse list( - Optional autoHide, - Optional frequency) throws Exception; - } - - public interface MethodCallCreatepolicy { - CreatepolicyResponse create( - CreateDlpReportRequest request) throws Exception; - } - - public interface MethodCallDownloadpolicycsv { - DownloadpolicycsvResponse download( - String id) throws Exception; - } - - public interface MethodCallCreatereport { - CreatereportResponse create( - UpdateDlpConfigRequest request) throws Exception; - } - - public interface MethodCallDownloadreportcsv { - DownloadreportcsvResponse download( - String id) throws Exception; - } - - public interface MethodCallGetreportstatus { - GetreportstatusResponse status( - String id) throws Exception; - } - - public interface MethodCallGetdocvisibility { - GetdocvisibilityResponse list( - Optional> docIds) throws Exception; - } - - public interface MethodCallSetdocvisibility { - SetdocvisibilityResponse create( - UpdateDocumentVisibilityOverridesRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Indexdocument { - PostApiIndexV1IndexdocumentResponse addOrUpdate( - IndexDocumentRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Indexdocuments { - PostApiIndexV1IndexdocumentsResponse index( - IndexDocumentsRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Bulkindexdocuments { - PostApiIndexV1BulkindexdocumentsResponse bulkIndex( - BulkIndexDocumentsRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Processalldocuments { - PostApiIndexV1ProcessalldocumentsResponse processAll( - Optional request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Deletedocument { - PostApiIndexV1DeletedocumentResponse delete( - DeleteDocumentRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1DebugDatasourceDocument { - PostApiIndexV1DebugDatasourceDocumentResponse debug( - String datasource, - DebugDocumentRequest debugDocumentRequest) throws Exception; - } - - public interface MethodCallPostApiIndexV1DebugDatasourceDocuments { - PostApiIndexV1DebugDatasourceDocumentsResponse debugMany( - String datasource, - DebugDocumentsRequest debugDocumentsRequest) throws Exception; - } - - public interface MethodCallPostApiIndexV1Checkdocumentaccess { - PostApiIndexV1CheckdocumentaccessResponse checkAccess( - CheckDocumentAccessRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Getdocumentstatus { - PostApiIndexV1GetdocumentstatusResponse status( - GetDocumentStatusRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Getdocumentcount { - PostApiIndexV1GetdocumentcountResponse count( - GetDocumentCountRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Updatepermissions { - PostApiIndexV1UpdatepermissionsResponse updatePermissions( - UpdatePermissionsRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Indexuser { - PostApiIndexV1IndexuserResponse indexUser( - IndexUserRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Bulkindexusers { - PostApiIndexV1BulkindexusersResponse bulkIndexUsers( - BulkIndexUsersRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Indexgroup { - PostApiIndexV1IndexgroupResponse indexGroup( - IndexGroupRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Bulkindexgroups { - PostApiIndexV1BulkindexgroupsResponse bulkIndexGroups( - BulkIndexGroupsRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Indexmembership { - PostApiIndexV1IndexmembershipResponse indexMembership( - IndexMembershipRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Bulkindexmemberships { - PostApiIndexV1BulkindexmembershipsResponse bulkIndexMemberships( - BulkIndexMembershipsRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Processallmemberships { - PostApiIndexV1ProcessallmembershipsResponse processMemberships( - Optional request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Deleteuser { - PostApiIndexV1DeleteuserResponse deleteUser( - DeleteUserRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Deletegroup { - PostApiIndexV1DeletegroupResponse deleteGroup( - DeleteGroupRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Deletemembership { - PostApiIndexV1DeletemembershipResponse deleteMembership( - DeleteMembershipRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Betausers { - PostApiIndexV1BetausersResponse authorizeBetaUsers( - GreenlistUsersRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1DebugDatasourceStatus { - PostApiIndexV1DebugDatasourceStatusResponse status( - String datasource) throws Exception; - } - - public interface MethodCallPostApiIndexV1DebugDatasourceUser { - PostApiIndexV1DebugDatasourceUserResponse debug( - String datasource, - DebugUserRequest debugUserRequest) throws Exception; - } - - public interface MethodCallPostApiIndexV1Getusercount { - PostApiIndexV1GetusercountResponse count( - GetUserCountRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Indexemployee { - PostApiIndexV1IndexemployeeResponse index( - IndexEmployeeRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Bulkindexemployees { - PostApiIndexV1BulkindexemployeesResponse bulkIndex( - BulkIndexEmployeesRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Processallemployeesandteams { - PostApiIndexV1ProcessallemployeesandteamsResponse processAllEmployeesAndTeamsDirect() throws Exception; - } - - public interface MethodCallPostApiIndexV1Deleteemployee { - PostApiIndexV1DeleteemployeeResponse delete( - DeleteEmployeeRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Indexteam { - PostApiIndexV1IndexteamResponse indexTeam( - IndexTeamRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Deleteteam { - PostApiIndexV1DeleteteamResponse deleteTeam( - DeleteTeamRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Bulkindexteams { - PostApiIndexV1BulkindexteamsResponse bulkIndexTeams( - BulkIndexTeamsRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Adddatasource { - PostApiIndexV1AdddatasourceResponse add( - CustomDatasourceConfig request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Getdatasourceconfig { - PostApiIndexV1GetdatasourceconfigResponse retrieveConfig( - GetDatasourceConfigRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Rotatetoken { - PostApiIndexV1RotatetokenResponse rotateTokenDirect() throws Exception; - } - - public interface MethodCallPostApiIndexV1Bulkindexshortcuts { - PostApiIndexV1BulkindexshortcutsResponse bulkIndex( - BulkIndexShortcutsRequest request) throws Exception; - } - - public interface MethodCallPostApiIndexV1Uploadshortcuts { - PostApiIndexV1UploadshortcutsResponse upload( - UploadShortcutsRequest request) throws Exception; - } -} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsRequestBuilder.java index 9b6dfc14..8e3f0b33 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.SearchAgentsRequest; +import com.glean.api_client.glean_api_client.operations.SearchAgentsOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class SearchAgentsRequestBuilder { private SearchAgentsRequest request; - private final SDKMethodInterfaces.MethodCallSearchAgents sdk; + private final SDKConfiguration sdkConfiguration; - public SearchAgentsRequestBuilder(SDKMethodInterfaces.MethodCallSearchAgents sdk) { - this.sdk = sdk; + public SearchAgentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public SearchAgentsRequestBuilder request(SearchAgentsRequest request) { @@ -23,8 +27,10 @@ public SearchAgentsRequestBuilder request(SearchAgentsRequest request) { } public SearchAgentsResponse call() throws Exception { + + RequestOperation operation + = new SearchAgentsOperation( sdkConfiguration); - return sdk.list( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsResponse.java index f39496db..0cca3f64 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchAgentsResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class SearchAgentsResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } SearchAgentsResponse other = (SearchAgentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.searchAgentsResponse, other.searchAgentsResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.searchAgentsResponse, other.searchAgentsResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchRequestBuilder.java index 65d82730..777ae854 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.SearchRequest; +import com.glean.api_client.glean_api_client.operations.SearchOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class SearchRequestBuilder { private SearchRequest request; - private final SDKMethodInterfaces.MethodCallSearch sdk; + private final SDKConfiguration sdkConfiguration; - public SearchRequestBuilder(SDKMethodInterfaces.MethodCallSearch sdk) { - this.sdk = sdk; + public SearchRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public SearchRequestBuilder request(SearchRequest request) { @@ -23,8 +27,10 @@ public SearchRequestBuilder request(SearchRequest request) { } public SearchResponse call() throws Exception { + + RequestOperation operation + = new SearchOperation( sdkConfiguration); - return sdk.query( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchResponse.java index 85f92f21..2f243724 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SearchResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class SearchResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } SearchResponse other = (SearchResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.searchResponse, other.searchResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.searchResponse, other.searchResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityRequestBuilder.java index 39d17e7b..97a00a3f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UpdateDocumentVisibilityOverridesRequest; +import com.glean.api_client.glean_api_client.operations.SetdocvisibilityOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class SetdocvisibilityRequestBuilder { private UpdateDocumentVisibilityOverridesRequest request; - private final SDKMethodInterfaces.MethodCallSetdocvisibility sdk; + private final SDKConfiguration sdkConfiguration; - public SetdocvisibilityRequestBuilder(SDKMethodInterfaces.MethodCallSetdocvisibility sdk) { - this.sdk = sdk; + public SetdocvisibilityRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public SetdocvisibilityRequestBuilder request(UpdateDocumentVisibilityOverridesRequest request) { @@ -23,8 +27,10 @@ public SetdocvisibilityRequestBuilder request(UpdateDocumentVisibilityOverridesR } public SetdocvisibilityResponse call() throws Exception { + + RequestOperation operation + = new SetdocvisibilityOperation( sdkConfiguration); - return sdk.create( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityResponse.java index 86a4f6b3..7599a7cc 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SetdocvisibilityResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class SetdocvisibilityResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } SetdocvisibilityResponse other = (SetdocvisibilityResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.updateDocumentVisibilityOverridesResponse, other.updateDocumentVisibilityOverridesResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateDocumentVisibilityOverridesResponse, other.updateDocumentVisibilityOverridesResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeRequestBuilder.java index 4654e63e..4b67f9af 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.SummarizeRequest; +import com.glean.api_client.glean_api_client.operations.SummarizeOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class SummarizeRequestBuilder { private SummarizeRequest request; - private final SDKMethodInterfaces.MethodCallSummarize sdk; + private final SDKConfiguration sdkConfiguration; - public SummarizeRequestBuilder(SDKMethodInterfaces.MethodCallSummarize sdk) { - this.sdk = sdk; + public SummarizeRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public SummarizeRequestBuilder request(SummarizeRequest request) { @@ -23,8 +27,10 @@ public SummarizeRequestBuilder request(SummarizeRequest request) { } public SummarizeResponse call() throws Exception { + + RequestOperation operation + = new SummarizeOperation( sdkConfiguration); - return sdk.summarize( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeResponse.java index 18212609..9263a4a2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/SummarizeResponse.java @@ -13,7 +13,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class SummarizeResponse implements Response { @@ -154,15 +153,15 @@ public boolean equals(java.lang.Object o) { } SummarizeResponse other = (SummarizeResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.summarizeResponse, other.summarizeResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.summarizeResponse, other.summarizeResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinRequestBuilder.java index f79b5ec1..3d67a10f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.Unpin; +import com.glean.api_client.glean_api_client.operations.UnpinOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class UnpinRequestBuilder { private Unpin request; - private final SDKMethodInterfaces.MethodCallUnpin sdk; + private final SDKConfiguration sdkConfiguration; - public UnpinRequestBuilder(SDKMethodInterfaces.MethodCallUnpin sdk) { - this.sdk = sdk; + public UnpinRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UnpinRequestBuilder request(Unpin request) { @@ -23,8 +27,10 @@ public UnpinRequestBuilder request(Unpin request) { } public UnpinResponse call() throws Exception { + + RequestOperation operation + = new UnpinOperation( sdkConfiguration); - return sdk.remove( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinResponse.java index a91711f3..622efdbe 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UnpinResponse.java @@ -12,7 +12,6 @@ import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; public class UnpinResponse implements Response { @@ -110,14 +109,14 @@ public boolean equals(java.lang.Object o) { } UnpinResponse other = (UnpinResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse); diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementRequestBuilder.java index 07ba759e..140ba880 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UpdateAnnouncementRequest; +import com.glean.api_client.glean_api_client.operations.UpdateannouncementOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class UpdateannouncementRequestBuilder { private UpdateAnnouncementRequest request; - private final SDKMethodInterfaces.MethodCallUpdateannouncement sdk; + private final SDKConfiguration sdkConfiguration; - public UpdateannouncementRequestBuilder(SDKMethodInterfaces.MethodCallUpdateannouncement sdk) { - this.sdk = sdk; + public UpdateannouncementRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UpdateannouncementRequestBuilder request(UpdateAnnouncementRequest request) { @@ -23,8 +27,10 @@ public UpdateannouncementRequestBuilder request(UpdateAnnouncementRequest reques } public UpdateannouncementResponse call() throws Exception { + + RequestOperation operation + = new UpdateannouncementOperation( sdkConfiguration); - return sdk.update( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementResponse.java index 90d2357d..fe581dd8 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateannouncementResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class UpdateannouncementResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } UpdateannouncementResponse other = (UpdateannouncementResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.announcement, other.announcement); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.announcement, other.announcement); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequest.java index 41654004..3aa6ecec 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequest.java @@ -10,7 +10,6 @@ import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; public class UpdatepolicyRequest { @@ -76,13 +75,13 @@ public boolean equals(java.lang.Object o) { } UpdatepolicyRequest other = (UpdatepolicyRequest) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.updateDlpReportRequest, other.updateDlpReportRequest); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.updateDlpReportRequest, other.updateDlpReportRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id, updateDlpReportRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequestBuilder.java index f0134347..10eb5baf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UpdateDlpReportRequest; +import com.glean.api_client.glean_api_client.operations.UpdatepolicyOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class UpdatepolicyRequestBuilder { private String id; private UpdateDlpReportRequest updateDlpReportRequest; - private final SDKMethodInterfaces.MethodCallUpdatepolicy sdk; + private final SDKConfiguration sdkConfiguration; - public UpdatepolicyRequestBuilder(SDKMethodInterfaces.MethodCallUpdatepolicy sdk) { - this.sdk = sdk; + public UpdatepolicyRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UpdatepolicyRequestBuilder id(String id) { @@ -30,10 +34,21 @@ public UpdatepolicyRequestBuilder updateDlpReportRequest(UpdateDlpReportRequest return this; } - public UpdatepolicyResponse call() throws Exception { - return sdk.update( - id, + private UpdatepolicyRequest buildRequest() { + + UpdatepolicyRequest request = new UpdatepolicyRequest(id, updateDlpReportRequest); + + return request; + } + + public UpdatepolicyResponse call() throws Exception { + + RequestOperation operation + = new UpdatepolicyOperation( sdkConfiguration); + UpdatepolicyRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyResponse.java index 0f40fd4d..d62f6939 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdatepolicyResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class UpdatepolicyResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } UpdatepolicyResponse other = (UpdatepolicyResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.updateDlpReportResponse, other.updateDlpReportResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateDlpReportResponse, other.updateDlpReportResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutRequestBuilder.java index bc9665ca..d9b216be 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UpdateShortcutRequest; +import com.glean.api_client.glean_api_client.operations.UpdateshortcutOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class UpdateshortcutRequestBuilder { private UpdateShortcutRequest request; - private final SDKMethodInterfaces.MethodCallUpdateshortcut sdk; + private final SDKConfiguration sdkConfiguration; - public UpdateshortcutRequestBuilder(SDKMethodInterfaces.MethodCallUpdateshortcut sdk) { - this.sdk = sdk; + public UpdateshortcutRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UpdateshortcutRequestBuilder request(UpdateShortcutRequest request) { @@ -23,8 +27,10 @@ public UpdateshortcutRequestBuilder request(UpdateShortcutRequest request) { } public UpdateshortcutResponse call() throws Exception { + + RequestOperation operation + = new UpdateshortcutOperation( sdkConfiguration); - return sdk.update( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutResponse.java index a3aa325d..b15b6628 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UpdateshortcutResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class UpdateshortcutResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } UpdateshortcutResponse other = (UpdateshortcutResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.updateShortcutResponse, other.updateShortcutResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateShortcutResponse, other.updateShortcutResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequest.java index 5f12b7ef..66326551 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequest.java @@ -11,7 +11,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; public class UploadchatfilesRequest { @@ -92,13 +91,13 @@ public boolean equals(java.lang.Object o) { } UploadchatfilesRequest other = (UploadchatfilesRequest) o; return - Objects.deepEquals(this.timezoneOffset, other.timezoneOffset) && - Objects.deepEquals(this.uploadChatFilesRequest, other.uploadChatFilesRequest); + Utils.enhancedDeepEquals(this.timezoneOffset, other.timezoneOffset) && + Utils.enhancedDeepEquals(this.uploadChatFilesRequest, other.uploadChatFilesRequest); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timezoneOffset, uploadChatFilesRequest); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequestBuilder.java index 86d98e64..95c3518e 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesRequestBuilder.java @@ -3,7 +3,11 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.UploadChatFilesRequest; +import com.glean.api_client.glean_api_client.operations.UploadchatfilesOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -13,10 +17,10 @@ public class UploadchatfilesRequestBuilder { private Optional timezoneOffset = Optional.empty(); private UploadChatFilesRequest uploadChatFilesRequest; - private final SDKMethodInterfaces.MethodCallUploadchatfiles sdk; + private final SDKConfiguration sdkConfiguration; - public UploadchatfilesRequestBuilder(SDKMethodInterfaces.MethodCallUploadchatfiles sdk) { - this.sdk = sdk; + public UploadchatfilesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UploadchatfilesRequestBuilder timezoneOffset(long timezoneOffset) { @@ -37,10 +41,21 @@ public UploadchatfilesRequestBuilder uploadChatFilesRequest(UploadChatFilesReque return this; } - public UploadchatfilesResponse call() throws Exception { - return sdk.uploadFiles( - timezoneOffset, + private UploadchatfilesRequest buildRequest() { + + UploadchatfilesRequest request = new UploadchatfilesRequest(timezoneOffset, uploadChatFilesRequest); + + return request; + } + + public UploadchatfilesResponse call() throws Exception { + + RequestOperation operation + = new UploadchatfilesOperation( sdkConfiguration); + UploadchatfilesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesResponse.java index a0607ff8..457d7c58 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/UploadchatfilesResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class UploadchatfilesResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } UploadchatfilesResponse other = (UploadchatfilesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.uploadChatFilesResponse, other.uploadChatFilesResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.uploadChatFilesResponse, other.uploadChatFilesResponse); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyRequestBuilder.java index 85b4701b..367a937f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyRequestBuilder.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyRequestBuilder.java @@ -3,17 +3,21 @@ */ package com.glean.api_client.glean_api_client.models.operations; +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.models.components.VerifyRequest; +import com.glean.api_client.glean_api_client.operations.VerifyOperation; import com.glean.api_client.glean_api_client.utils.Utils; import java.lang.Exception; public class VerifyRequestBuilder { private VerifyRequest request; - private final SDKMethodInterfaces.MethodCallVerify sdk; + private final SDKConfiguration sdkConfiguration; - public VerifyRequestBuilder(SDKMethodInterfaces.MethodCallVerify sdk) { - this.sdk = sdk; + public VerifyRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public VerifyRequestBuilder request(VerifyRequest request) { @@ -23,8 +27,10 @@ public VerifyRequestBuilder request(VerifyRequest request) { } public VerifyResponse call() throws Exception { + + RequestOperation operation + = new VerifyOperation( sdkConfiguration); - return sdk.verify( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyResponse.java index 0d5e5bfa..9a9ecb62 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/VerifyResponse.java @@ -14,7 +14,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; public class VerifyResponse implements Response { @@ -155,15 +154,15 @@ public boolean equals(java.lang.Object o) { } VerifyResponse other = (VerifyResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.verification, other.verification); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.verification, other.verification); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( contentType, statusCode, rawResponse, diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ActivityOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ActivityOperation.java new file mode 100644 index 00000000..b65ed712 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ActivityOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Activity; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ActivityResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ActivityOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ActivityOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(Activity request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/activity"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "activity", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "activity", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "activity", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "activity", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ActivityResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ActivityResponse.Builder resBuilder = + ActivityResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ActivityResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/AddcollectionitemsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/AddcollectionitemsOperation.java new file mode 100644 index 00000000..1aff13bb --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/AddcollectionitemsOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.AddCollectionItemsRequest; +import com.glean.api_client.glean_api_client.models.components.AddCollectionItemsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.AddcollectionitemsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class AddcollectionitemsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public AddcollectionitemsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(AddCollectionItemsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/addcollectionitems"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "addcollectionitems", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "addcollectionitems", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "addcollectionitems", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "addcollectionitems", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public AddcollectionitemsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AddcollectionitemsResponse.Builder resBuilder = + AddcollectionitemsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AddcollectionitemsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + AddCollectionItemsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAddCollectionItemsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/AddverificationreminderOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/AddverificationreminderOperation.java new file mode 100644 index 00000000..e21a4e44 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/AddverificationreminderOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ReminderRequest; +import com.glean.api_client.glean_api_client.models.components.Verification; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.AddverificationreminderResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class AddverificationreminderOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public AddverificationreminderOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ReminderRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/addverificationreminder"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "addverificationreminder", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "addverificationreminder", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "addverificationreminder", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "addverificationreminder", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public AddverificationreminderResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AddverificationreminderResponse.Builder resBuilder = + AddverificationreminderResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AddverificationreminderResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + Verification out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withVerification(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/AdminsearchOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/AdminsearchOperation.java new file mode 100644 index 00000000..c5dfb5c5 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/AdminsearchOperation.java @@ -0,0 +1,190 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.SearchRequest; +import com.glean.api_client.glean_api_client.models.components.SearchResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.GleanDataError; +import com.glean.api_client.glean_api_client.models.operations.AdminsearchResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class AdminsearchOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public AdminsearchOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(SearchRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/adminsearch"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "adminsearch", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "422", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "adminsearch", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "adminsearch", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "adminsearch", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public AdminsearchResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AdminsearchResponse.Builder resBuilder = + AdminsearchResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AdminsearchResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + SearchResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withSearchResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GleanDataError out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + throw out; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/AutocompleteOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/AutocompleteOperation.java new file mode 100644 index 00000000..230ba8db --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/AutocompleteOperation.java @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.AutocompleteRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.AutocompleteResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class AutocompleteOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public AutocompleteOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(AutocompleteRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/autocomplete"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "autocomplete", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "autocomplete", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "autocomplete", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "autocomplete", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public AutocompleteResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AutocompleteResponse.Builder resBuilder = + AutocompleteResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AutocompleteResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.AutocompleteResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAutocompleteResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ChatOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ChatOperation.java new file mode 100644 index 00000000..34841168 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ChatOperation.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ChatRequest; +import com.glean.api_client.glean_api_client.models.operations.ChatResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ChatOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ChatOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ChatRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/chat"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "chatRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + ChatRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "chat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "408", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "chat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "chat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "chat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ChatResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ChatResponse.Builder resBuilder = + ChatResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ChatResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.ChatResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withChatResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "408", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ChatStreamOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ChatStreamOperation.java new file mode 100644 index 00000000..f21ff1af --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ChatStreamOperation.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ChatStreamRequest; +import com.glean.api_client.glean_api_client.models.operations.ChatStreamResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ChatStreamOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ChatStreamOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ChatStreamRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/chat#stream"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "chatRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "text/plain") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + ChatStreamRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "chatStream", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "408", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "chatStream", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "chatStream", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "chatStream", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ChatStreamResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ChatStreamResponse.Builder resBuilder = + ChatStreamResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ChatStreamResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "text/plain")) { + String out = Utils.toUtf8AndClose(response.body()); + res.withChatRequestStream(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "408", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndStreamRunOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndStreamRunOperation.java new file mode 100644 index 00000000..3e0d81d9 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndStreamRunOperation.java @@ -0,0 +1,170 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreateAndStreamRunResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateAndStreamRunOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreateAndStreamRunOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(AgentRunCreate request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/agents/runs/stream"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "text/event-stream") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndStreamRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "403", "404", "409", "422", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndStreamRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndStreamRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndStreamRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreateAndStreamRunResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateAndStreamRunResponse.Builder resBuilder = + CreateAndStreamRunResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateAndStreamRunResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "text/event-stream")) { + String out = Utils.toUtf8AndClose(response.body()); + res.withRes(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "403", "404", "409", "422", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndWaitRunOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndWaitRunOperation.java new file mode 100644 index 00000000..5ed4fd25 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateAndWaitRunOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.AgentRunCreate; +import com.glean.api_client.glean_api_client.models.components.AgentRunWaitResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreateAndWaitRunResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateAndWaitRunOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreateAndWaitRunOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(AgentRunCreate request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/agents/runs/wait"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndWaitRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "403", "404", "409", "422", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndWaitRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndWaitRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createAndWaitRun", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreateAndWaitRunResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateAndWaitRunResponse.Builder resBuilder = + CreateAndWaitRunResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateAndWaitRunResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + AgentRunWaitResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAgentRunWaitResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "403", "404", "409", "422", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreateannouncementOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateannouncementOperation.java new file mode 100644 index 00000000..75425659 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateannouncementOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Announcement; +import com.glean.api_client.glean_api_client.models.components.CreateAnnouncementRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreateannouncementResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateannouncementOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreateannouncementOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(CreateAnnouncementRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/createannouncement"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreateannouncementResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateannouncementResponse.Builder resBuilder = + CreateannouncementResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateannouncementResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + Announcement out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAnnouncement(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreateanswerOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateanswerOperation.java new file mode 100644 index 00000000..d5c42a9a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateanswerOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Answer; +import com.glean.api_client.glean_api_client.models.components.CreateAnswerRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreateanswerResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateanswerOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreateanswerOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(CreateAnswerRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/createanswer"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreateanswerResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateanswerResponse.Builder resBuilder = + CreateanswerResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateanswerResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + Answer out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAnswer(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreateauthtokenOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateauthtokenOperation.java new file mode 100644 index 00000000..c80a1a36 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateauthtokenOperation.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.CreateAuthTokenResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreateauthtokenResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateauthtokenOperation implements RequestlessOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreateauthtokenOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest() throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/createauthtoken"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createauthtoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createauthtoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createauthtoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createauthtoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreateauthtokenResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateauthtokenResponse.Builder resBuilder = + CreateauthtokenResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateauthtokenResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CreateAuthTokenResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withCreateAuthTokenResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreatecollectionOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreatecollectionOperation.java new file mode 100644 index 00000000..a9668477 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreatecollectionOperation.java @@ -0,0 +1,190 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.CreateCollectionRequest; +import com.glean.api_client.glean_api_client.models.components.CreateCollectionResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.CollectionError; +import com.glean.api_client.glean_api_client.models.operations.CreatecollectionResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreatecollectionOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreatecollectionOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(CreateCollectionRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/createcollection"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreatecollectionResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreatecollectionResponse.Builder resBuilder = + CreatecollectionResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreatecollectionResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CreateCollectionResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withCreateCollectionResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CollectionError out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + throw out; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreatepolicyOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreatepolicyOperation.java new file mode 100644 index 00000000..dddb43c4 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreatepolicyOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.CreateDlpReportRequest; +import com.glean.api_client.glean_api_client.models.components.CreateDlpReportResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreatepolicyResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreatepolicyOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreatepolicyOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(CreateDlpReportRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/governance/data/policies"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreatepolicyResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreatepolicyResponse.Builder resBuilder = + CreatepolicyResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreatepolicyResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + CreateDlpReportResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withCreateDlpReportResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreatereportOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreatereportOperation.java new file mode 100644 index 00000000..2cebc138 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreatereportOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.UpdateDlpConfigRequest; +import com.glean.api_client.glean_api_client.models.components.UpdateDlpConfigResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreatereportResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreatereportOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreatereportOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UpdateDlpConfigRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/governance/data/reports"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createreport", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createreport", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createreport", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createreport", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreatereportResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreatereportResponse.Builder resBuilder = + CreatereportResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreatereportResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + UpdateDlpConfigResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withUpdateDlpConfigResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/CreateshortcutOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateshortcutOperation.java new file mode 100644 index 00000000..b9e367db --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/CreateshortcutOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.CreateShortcutRequest; +import com.glean.api_client.glean_api_client.models.components.CreateShortcutResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.CreateshortcutResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateshortcutOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public CreateshortcutOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(CreateShortcutRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/createshortcut"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "createshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "createshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "createshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public CreateshortcutResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreateshortcutResponse.Builder resBuilder = + CreateshortcutResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreateshortcutResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CreateShortcutResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withCreateShortcutResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteallchatsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteallchatsOperation.java new file mode 100644 index 00000000..3e79932a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteallchatsOperation.java @@ -0,0 +1,149 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DeleteallchatsRequest; +import com.glean.api_client.glean_api_client.models.operations.DeleteallchatsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeleteallchatsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeleteallchatsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteallchatsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deleteallchats"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + DeleteallchatsRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteallchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteallchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteallchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteallchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeleteallchatsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeleteallchatsResponse.Builder resBuilder = + DeleteallchatsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeleteallchatsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteannouncementOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteannouncementOperation.java new file mode 100644 index 00000000..77837054 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteannouncementOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteAnnouncementRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DeleteannouncementResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeleteannouncementOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeleteannouncementOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteAnnouncementRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deleteannouncement"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeleteannouncementResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeleteannouncementResponse.Builder resBuilder = + DeleteannouncementResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeleteannouncementResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteanswerOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteanswerOperation.java new file mode 100644 index 00000000..70764610 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteanswerOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteAnswerRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DeleteanswerResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeleteanswerOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeleteanswerOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteAnswerRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deleteanswer"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeleteanswerResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeleteanswerResponse.Builder resBuilder = + DeleteanswerResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeleteanswerResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatfilesOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatfilesOperation.java new file mode 100644 index 00000000..e8d3ea28 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatfilesOperation.java @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DeletechatfilesRequest; +import com.glean.api_client.glean_api_client.models.operations.DeletechatfilesResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeletechatfilesOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeletechatfilesOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeletechatfilesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deletechatfiles"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "deleteChatFilesRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + DeletechatfilesRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeletechatfilesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeletechatfilesResponse.Builder resBuilder = + DeletechatfilesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeletechatfilesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatsOperation.java new file mode 100644 index 00000000..397f3518 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletechatsOperation.java @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DeletechatsRequest; +import com.glean.api_client.glean_api_client.models.operations.DeletechatsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeletechatsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeletechatsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeletechatsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deletechats"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "deleteChatsRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + DeletechatsRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletechats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeletechatsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeletechatsResponse.Builder resBuilder = + DeletechatsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeletechatsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionOperation.java new file mode 100644 index 00000000..871cac9c --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionOperation.java @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteCollectionRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.CollectionError; +import com.glean.api_client.glean_api_client.models.operations.DeletecollectionResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeletecollectionOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeletecollectionOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteCollectionRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deletecollection"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeletecollectionResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeletecollectionResponse.Builder resBuilder = + DeletecollectionResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeletecollectionResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CollectionError out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + throw out; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionitemOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionitemOperation.java new file mode 100644 index 00000000..63e417ff --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeletecollectionitemOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteCollectionItemRequest; +import com.glean.api_client.glean_api_client.models.components.DeleteCollectionItemResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DeletecollectionitemResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeletecollectionitemOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeletecollectionitemOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteCollectionItemRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deletecollectionitem"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deletecollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeletecollectionitemResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeletecollectionitemResponse.Builder resBuilder = + DeletecollectionitemResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeletecollectionitemResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + DeleteCollectionItemResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withDeleteCollectionItemResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "422", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteshortcutOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteshortcutOperation.java new file mode 100644 index 00000000..475b993f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DeleteshortcutOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteShortcutRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DeleteshortcutResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeleteshortcutOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DeleteshortcutOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteShortcutRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/deleteshortcut"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "deleteshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DeleteshortcutResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeleteshortcutResponse.Builder resBuilder = + DeleteshortcutResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeleteshortcutResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DownloadpolicycsvOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DownloadpolicycsvOperation.java new file mode 100644 index 00000000..fab40cf8 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DownloadpolicycsvOperation.java @@ -0,0 +1,155 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DownloadpolicycsvRequest; +import com.glean.api_client.glean_api_client.models.operations.DownloadpolicycsvResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadpolicycsvOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DownloadpolicycsvOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DownloadpolicycsvRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + DownloadpolicycsvRequest.class, + baseUrl, + "/rest/api/v1/governance/data/policies/{id}/download", + request, null); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "text/csv; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadpolicycsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadpolicycsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadpolicycsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadpolicycsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DownloadpolicycsvResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DownloadpolicycsvResponse.Builder resBuilder = + DownloadpolicycsvResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DownloadpolicycsvResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "text/csv; charset=UTF-8")) { + String out = Utils.toUtf8AndClose(response.body()); + res.withRes(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/DownloadreportcsvOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/DownloadreportcsvOperation.java new file mode 100644 index 00000000..724d7eb7 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/DownloadreportcsvOperation.java @@ -0,0 +1,155 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.DownloadreportcsvRequest; +import com.glean.api_client.glean_api_client.models.operations.DownloadreportcsvResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadreportcsvOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public DownloadreportcsvOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DownloadreportcsvRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + DownloadreportcsvRequest.class, + baseUrl, + "/rest/api/v1/governance/data/reports/{id}/download", + request, null); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "text/csv; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadreportcsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadreportcsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadreportcsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "downloadreportcsv", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public DownloadreportcsvResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DownloadreportcsvResponse.Builder resBuilder = + DownloadreportcsvResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DownloadreportcsvResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "text/csv; charset=UTF-8")) { + String out = Utils.toUtf8AndClose(response.body()); + res.withRes(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/EditanswerOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/EditanswerOperation.java new file mode 100644 index 00000000..01540234 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/EditanswerOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Answer; +import com.glean.api_client.glean_api_client.models.components.EditAnswerRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.EditanswerResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class EditanswerOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public EditanswerOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(EditAnswerRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/editanswer"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "editanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "editanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public EditanswerResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + EditanswerResponse.Builder resBuilder = + EditanswerResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + EditanswerResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + Answer out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAnswer(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionOperation.java new file mode 100644 index 00000000..a5f99fc4 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionOperation.java @@ -0,0 +1,190 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.EditCollectionRequest; +import com.glean.api_client.glean_api_client.models.components.EditCollectionResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.CollectionError; +import com.glean.api_client.glean_api_client.models.operations.EditcollectionResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class EditcollectionOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public EditcollectionOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(EditCollectionRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/editcollection"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "422", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public EditcollectionResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + EditcollectionResponse.Builder resBuilder = + EditcollectionResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + EditcollectionResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + EditCollectionResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withEditCollectionResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CollectionError out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + throw out; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionitemOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionitemOperation.java new file mode 100644 index 00000000..d2c9f3c6 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/EditcollectionitemOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.EditCollectionItemRequest; +import com.glean.api_client.glean_api_client.models.components.EditCollectionItemResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.EditcollectionitemResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class EditcollectionitemOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public EditcollectionitemOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(EditCollectionItemRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/editcollectionitem"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editcollectionitem", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public EditcollectionitemResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + EditcollectionitemResponse.Builder resBuilder = + EditcollectionitemResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + EditcollectionitemResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + EditCollectionItemResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withEditCollectionItemResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/EditpinOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/EditpinOperation.java new file mode 100644 index 00000000..ffd9c086 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/EditpinOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.EditPinRequest; +import com.glean.api_client.glean_api_client.models.components.PinDocument; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.EditpinResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class EditpinOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public EditpinOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(EditPinRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/editpin"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "editpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "editpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "editpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public EditpinResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + EditpinResponse.Builder resBuilder = + EditpinResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + EditpinResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PinDocument out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withPinDocument(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/FeedOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/FeedOperation.java new file mode 100644 index 00000000..48dc7881 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/FeedOperation.java @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.FeedRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.FeedResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class FeedOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public FeedOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(FeedRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/feed"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "feed", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "408", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "feed", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "feed", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "feed", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public FeedResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + FeedResponse.Builder resBuilder = + FeedResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + FeedResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.FeedResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withFeedResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "408", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/FeedbackOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/FeedbackOperation.java new file mode 100644 index 00000000..a1f20df1 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/FeedbackOperation.java @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.FeedbackRequest; +import com.glean.api_client.glean_api_client.models.operations.FeedbackResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class FeedbackOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public FeedbackOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(FeedbackRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/feedback"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "feedback1", + "json", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + FeedbackRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "feedback", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "feedback", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "feedback", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "feedback", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public FeedbackResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + FeedbackResponse.Builder resBuilder = + FeedbackResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + FeedbackResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentOperation.java new file mode 100644 index 00000000..5908eb3d --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentOperation.java @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Agent; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetAgentRequest; +import com.glean.api_client.glean_api_client.models.operations.GetAgentResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAgentOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetAgentOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetAgentRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + GetAgentRequest.class, + baseUrl, + "/rest/api/v1/agents/{agent_id}", + request, null); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetAgentRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgent", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "403", "404", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgent", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgent", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgent", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetAgentResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetAgentResponse.Builder resBuilder = + GetAgentResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetAgentResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + Agent out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAgent(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "403", "404", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentSchemasOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentSchemasOperation.java new file mode 100644 index 00000000..2beab7d3 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetAgentSchemasOperation.java @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.AgentSchemas; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetAgentSchemasRequest; +import com.glean.api_client.glean_api_client.models.operations.GetAgentSchemasResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAgentSchemasOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetAgentSchemasOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetAgentSchemasRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + GetAgentSchemasRequest.class, + baseUrl, + "/rest/api/v1/agents/{agent_id}/schemas", + request, null); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetAgentSchemasRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgentSchemas", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "403", "404", "422", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgentSchemas", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgentSchemas", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getAgentSchemas", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetAgentSchemasResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetAgentSchemasResponse.Builder resBuilder = + GetAgentSchemasResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetAgentSchemasResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + AgentSchemas out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAgentSchemas(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "403", "404", "422", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetRestApiV1ToolsListOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetRestApiV1ToolsListOperation.java new file mode 100644 index 00000000..f75bf1b5 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetRestApiV1ToolsListOperation.java @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ToolsListResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetRestApiV1ToolsListRequest; +import com.glean.api_client.glean_api_client.models.operations.GetRestApiV1ToolsListResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetRestApiV1ToolsListOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetRestApiV1ToolsListOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetRestApiV1ToolsListRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/tools/list"); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetRestApiV1ToolsListRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "get_/rest/api/v1/tools/list", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "get_/rest/api/v1/tools/list", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "get_/rest/api/v1/tools/list", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "get_/rest/api/v1/tools/list", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetRestApiV1ToolsListResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetRestApiV1ToolsListResponse.Builder resBuilder = + GetRestApiV1ToolsListResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetRestApiV1ToolsListResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ToolsListResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withToolsListResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "404", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetanswerOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetanswerOperation.java new file mode 100644 index 00000000..03aadf31 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetanswerOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetAnswerRequest; +import com.glean.api_client.glean_api_client.models.components.GetAnswerResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetanswerResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetanswerOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetanswerOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetAnswerRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getanswer"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getanswer", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetanswerResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetanswerResponse.Builder resBuilder = + GetanswerResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetanswerResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetAnswerResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetAnswerResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatOperation.java new file mode 100644 index 00000000..9e01431f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatOperation.java @@ -0,0 +1,179 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetChatResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetchatRequest; +import com.glean.api_client.glean_api_client.models.operations.GetchatResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetchatOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetchatOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetchatRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getchat"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "getChatRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetchatRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getchat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getchat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getchat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getchat", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetchatResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetchatResponse.Builder resBuilder = + GetchatResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetchatResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetChatResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetChatResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatapplicationOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatapplicationOperation.java new file mode 100644 index 00000000..289b5104 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatapplicationOperation.java @@ -0,0 +1,179 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetChatApplicationResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetchatapplicationRequest; +import com.glean.api_client.glean_api_client.models.operations.GetchatapplicationResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetchatapplicationOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetchatapplicationOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetchatapplicationRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getchatapplication"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "getChatApplicationRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetchatapplicationRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatapplication", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatapplication", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatapplication", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatapplication", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetchatapplicationResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetchatapplicationResponse.Builder resBuilder = + GetchatapplicationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetchatapplicationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetChatApplicationResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetChatApplicationResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatfilesOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatfilesOperation.java new file mode 100644 index 00000000..98698fd0 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetchatfilesOperation.java @@ -0,0 +1,179 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetChatFilesResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetchatfilesRequest; +import com.glean.api_client.glean_api_client.models.operations.GetchatfilesResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetchatfilesOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetchatfilesOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetchatfilesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getchatfiles"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "getChatFilesRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetchatfilesRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetchatfilesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetchatfilesResponse.Builder resBuilder = + GetchatfilesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetchatfilesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetChatFilesResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetChatFilesResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetcollectionOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetcollectionOperation.java new file mode 100644 index 00000000..1279146e --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetcollectionOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetCollectionRequest; +import com.glean.api_client.glean_api_client.models.components.GetCollectionResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetcollectionResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetcollectionOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetcollectionOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetCollectionRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getcollection"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getcollection", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetcollectionResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetcollectionResponse.Builder resBuilder = + GetcollectionResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetcollectionResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetCollectionResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetCollectionResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocpermissionsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocpermissionsOperation.java new file mode 100644 index 00000000..73143d6a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocpermissionsOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetDocPermissionsRequest; +import com.glean.api_client.glean_api_client.models.components.GetDocPermissionsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetdocpermissionsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetdocpermissionsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetdocpermissionsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetDocPermissionsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getdocpermissions"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocpermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocpermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocpermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocpermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetdocpermissionsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetdocpermissionsResponse.Builder resBuilder = + GetdocpermissionsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetdocpermissionsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDocPermissionsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetDocPermissionsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsOperation.java new file mode 100644 index 00000000..3178245b --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsOperation.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetDocumentsRequest; +import com.glean.api_client.glean_api_client.models.components.GetDocumentsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetdocumentsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetdocumentsOperation implements RequestOperation, GetdocumentsResponse> { + + private final SDKConfiguration sdkConfiguration; + + public GetdocumentsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(Optional request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getdocuments"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetdocumentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetdocumentsResponse.Builder resBuilder = + GetdocumentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetdocumentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDocumentsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetDocumentsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsbyfacetsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsbyfacetsOperation.java new file mode 100644 index 00000000..55cfbcd9 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocumentsbyfacetsOperation.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetDocumentsByFacetsRequest; +import com.glean.api_client.glean_api_client.models.components.GetDocumentsByFacetsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetdocumentsbyfacetsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetdocumentsbyfacetsOperation implements RequestOperation, GetdocumentsbyfacetsResponse> { + + private final SDKConfiguration sdkConfiguration; + + public GetdocumentsbyfacetsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(Optional request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getdocumentsbyfacets"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocumentsbyfacets", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocumentsbyfacets", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocumentsbyfacets", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocumentsbyfacets", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetdocumentsbyfacetsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetdocumentsbyfacetsResponse.Builder resBuilder = + GetdocumentsbyfacetsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetdocumentsbyfacetsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDocumentsByFacetsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetDocumentsByFacetsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "404", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocvisibilityOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocvisibilityOperation.java new file mode 100644 index 00000000..a29c9c05 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetdocvisibilityOperation.java @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetDocumentVisibilityOverridesResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetdocvisibilityRequest; +import com.glean.api_client.glean_api_client.models.operations.GetdocvisibilityResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetdocvisibilityOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetdocvisibilityOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetdocvisibilityRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/governance/documents/visibilityoverrides"); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetdocvisibilityRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetdocvisibilityResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetdocvisibilityResponse.Builder resBuilder = + GetdocvisibilityResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetdocvisibilityResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + GetDocumentVisibilityOverridesResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetDocumentVisibilityOverridesResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetpinOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetpinOperation.java new file mode 100644 index 00000000..436598bf --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetpinOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetPinRequest; +import com.glean.api_client.glean_api_client.models.components.GetPinResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetpinResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetpinOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetpinOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetPinRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getpin"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetpinResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetpinResponse.Builder resBuilder = + GetpinResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetpinResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPinResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetPinResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetpolicyOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetpolicyOperation.java new file mode 100644 index 00000000..f08c20ed --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetpolicyOperation.java @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetDlpReportResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetpolicyRequest; +import com.glean.api_client.glean_api_client.models.operations.GetpolicyResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetpolicyOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetpolicyOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetpolicyRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + GetpolicyRequest.class, + baseUrl, + "/rest/api/v1/governance/data/policies/{id}", + request, null); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + GetpolicyRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getpolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetpolicyResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetpolicyResponse.Builder resBuilder = + GetpolicyResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetpolicyResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDlpReportResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetDlpReportResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetreportstatusOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetreportstatusOperation.java new file mode 100644 index 00000000..a6e1ca3e --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetreportstatusOperation.java @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ReportStatusResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetreportstatusRequest; +import com.glean.api_client.glean_api_client.models.operations.GetreportstatusResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetreportstatusOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetreportstatusOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetreportstatusRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + GetreportstatusRequest.class, + baseUrl, + "/rest/api/v1/governance/data/reports/{id}/status", + request, null); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getreportstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getreportstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getreportstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getreportstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetreportstatusResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetreportstatusResponse.Builder resBuilder = + GetreportstatusResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetreportstatusResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + ReportStatusResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withReportStatusResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/GetshortcutOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/GetshortcutOperation.java new file mode 100644 index 00000000..d923f78f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/GetshortcutOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetShortcutRequestUnion; +import com.glean.api_client.glean_api_client.models.components.GetShortcutResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.GetshortcutResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetshortcutOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public GetshortcutOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetShortcutRequestUnion request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/getshortcut"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "getshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "getshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "getshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public GetshortcutResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetshortcutResponse.Builder resBuilder = + GetshortcutResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetshortcutResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetShortcutResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetShortcutResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/InsightsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/InsightsOperation.java new file mode 100644 index 00000000..cdbc37d5 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/InsightsOperation.java @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.InsightsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.InsightsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class InsightsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public InsightsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(InsightsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/insights"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "insights", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "insights", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "insights", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "insights", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public InsightsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + InsightsResponse.Builder resBuilder = + InsightsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + InsightsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.InsightsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withInsightsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListanswersOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListanswersOperation.java new file mode 100644 index 00000000..df78c840 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListanswersOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ListAnswersRequest; +import com.glean.api_client.glean_api_client.models.components.ListAnswersResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListanswersResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListanswersOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListanswersOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListAnswersRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/listanswers"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listanswers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listanswers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listanswers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listanswers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListanswersResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListanswersResponse.Builder resBuilder = + ListanswersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListanswersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ListAnswersResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withListAnswersResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListchatsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListchatsOperation.java new file mode 100644 index 00000000..c5b5e536 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListchatsOperation.java @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ListChatsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListchatsRequest; +import com.glean.api_client.glean_api_client.models.operations.ListchatsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListchatsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListchatsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListchatsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/listchats"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + ListchatsRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listchats", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListchatsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListchatsResponse.Builder resBuilder = + ListchatsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListchatsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ListChatsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withListChatsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListcollectionsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListcollectionsOperation.java new file mode 100644 index 00000000..e565aa0a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListcollectionsOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ListCollectionsRequest; +import com.glean.api_client.glean_api_client.models.components.ListCollectionsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListcollectionsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListcollectionsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListcollectionsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListCollectionsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/listcollections"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listcollections", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listcollections", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listcollections", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listcollections", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListcollectionsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListcollectionsResponse.Builder resBuilder = + ListcollectionsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListcollectionsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ListCollectionsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withListCollectionsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListentitiesOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListentitiesOperation.java new file mode 100644 index 00000000..04af6b17 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListentitiesOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ListEntitiesRequest; +import com.glean.api_client.glean_api_client.models.components.ListEntitiesResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListentitiesResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListentitiesOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListentitiesOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListEntitiesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/listentities"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listentities", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listentities", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listentities", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listentities", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListentitiesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListentitiesResponse.Builder resBuilder = + ListentitiesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListentitiesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ListEntitiesResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withListEntitiesResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListpinsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListpinsOperation.java new file mode 100644 index 00000000..ffb3f47f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListpinsOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ListPinsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListpinsRequest; +import com.glean.api_client.glean_api_client.models.operations.ListpinsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListpinsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListpinsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListpinsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/listpins"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listpins", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listpins", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listpins", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listpins", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListpinsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListpinsResponse.Builder resBuilder = + ListpinsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListpinsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ListPinsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withListPinsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListpoliciesOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListpoliciesOperation.java new file mode 100644 index 00000000..93296f13 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListpoliciesOperation.java @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ListDlpReportsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListpoliciesRequest; +import com.glean.api_client.glean_api_client.models.operations.ListpoliciesResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListpoliciesOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListpoliciesOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListpoliciesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/governance/data/policies"); + + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + ListpoliciesRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listpolicies", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listpolicies", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listpolicies", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listpolicies", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListpoliciesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListpoliciesResponse.Builder resBuilder = + ListpoliciesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListpoliciesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ListDlpReportsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withListDlpReportsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListshortcutsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListshortcutsOperation.java new file mode 100644 index 00000000..6b276b7b --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListshortcutsOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ListShortcutsPaginatedRequest; +import com.glean.api_client.glean_api_client.models.components.ListShortcutsPaginatedResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListshortcutsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListshortcutsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListshortcutsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListShortcutsPaginatedRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/listshortcuts"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListshortcutsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListshortcutsResponse.Builder resBuilder = + ListshortcutsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListshortcutsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ListShortcutsPaginatedResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withListShortcutsPaginatedResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/ListverificationsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/ListverificationsOperation.java new file mode 100644 index 00000000..29807c19 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/ListverificationsOperation.java @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.VerificationFeed; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.ListverificationsRequest; +import com.glean.api_client.glean_api_client.models.operations.ListverificationsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListverificationsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public ListverificationsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ListverificationsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/listverifications"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + ListverificationsRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "listverifications", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listverifications", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "listverifications", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "listverifications", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public ListverificationsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ListverificationsResponse.Builder resBuilder = + ListverificationsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ListverificationsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + VerificationFeed out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withVerificationFeed(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/MessagesOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/MessagesOperation.java new file mode 100644 index 00000000..cd3d1f07 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/MessagesOperation.java @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.MessagesRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.MessagesResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class MessagesOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public MessagesOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(MessagesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/messages"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "messages", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "messages", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "messages", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "messages", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public MessagesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + MessagesResponse.Builder resBuilder = + MessagesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + MessagesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.MessagesResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withMessagesResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/Operations.java b/src/main/java/com/glean/api_client/glean_api_client/operations/Operations.java new file mode 100644 index 00000000..ba8bf502 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/Operations.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import java.io.InputStream; +import java.net.http.HttpResponse; + +// Internal API only + +public class Operations { + /** + * Base interface for all operations + */ + public interface Operation { + ResT handleResponse(HttpResponse response) throws Exception; + } + + /** + * Interface for operations that require a request parameter + */ + public interface RequestOperation extends Operation { + HttpResponse doRequest(ReqT request) throws Exception; + } + + /** + * Interface for operations that don't require a request parameter + */ + public interface RequestlessOperation extends Operation { + HttpResponse doRequest() throws Exception; + } +} \ No newline at end of file diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PeopleOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PeopleOperation.java new file mode 100644 index 00000000..d9b04daf --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PeopleOperation.java @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.PeopleRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PeopleResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PeopleOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PeopleOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(PeopleRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/people"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "people", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "people", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "people", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "people", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PeopleResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PeopleResponse.Builder resBuilder = + PeopleResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PeopleResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.PeopleResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withPeopleResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PinOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PinOperation.java new file mode 100644 index 00000000..e034bd36 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PinOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.PinDocument; +import com.glean.api_client.glean_api_client.models.components.PinRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PinResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PinOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PinOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(PinRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/pin"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "pin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "pin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "pin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "pin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PinResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PinResponse.Builder resBuilder = + PinResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PinResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PinDocument out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withPinDocument(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1AdddatasourceOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1AdddatasourceOperation.java new file mode 100644 index 00000000..95455f9b --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1AdddatasourceOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.CustomDatasourceConfig; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1AdddatasourceResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1AdddatasourceOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1AdddatasourceOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(CustomDatasourceConfig request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/adddatasource"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/adddatasource", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/adddatasource", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/adddatasource", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/adddatasource", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1AdddatasourceResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1AdddatasourceResponse.Builder resBuilder = + PostApiIndexV1AdddatasourceResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1AdddatasourceResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BetausersOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BetausersOperation.java new file mode 100644 index 00000000..53a2e0e0 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BetausersOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GreenlistUsersRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BetausersResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BetausersOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BetausersOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GreenlistUsersRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/betausers"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/betausers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/betausers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/betausers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/betausers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BetausersResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BetausersResponse.Builder resBuilder = + PostApiIndexV1BetausersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BetausersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexdocumentsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexdocumentsOperation.java new file mode 100644 index 00000000..c68a37cc --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexdocumentsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.BulkIndexDocumentsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexdocumentsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BulkindexdocumentsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BulkindexdocumentsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(BulkIndexDocumentsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/bulkindexdocuments"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BulkindexdocumentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BulkindexdocumentsResponse.Builder resBuilder = + PostApiIndexV1BulkindexdocumentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BulkindexdocumentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexemployeesOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexemployeesOperation.java new file mode 100644 index 00000000..4c01f494 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexemployeesOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.BulkIndexEmployeesRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexemployeesResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BulkindexemployeesOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BulkindexemployeesOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(BulkIndexEmployeesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/bulkindexemployees"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexemployees", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexemployees", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexemployees", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexemployees", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BulkindexemployeesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BulkindexemployeesResponse.Builder resBuilder = + PostApiIndexV1BulkindexemployeesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BulkindexemployeesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexgroupsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexgroupsOperation.java new file mode 100644 index 00000000..7436d893 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexgroupsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.BulkIndexGroupsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexgroupsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BulkindexgroupsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BulkindexgroupsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(BulkIndexGroupsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/bulkindexgroups"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexgroups", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexgroups", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexgroups", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexgroups", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BulkindexgroupsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BulkindexgroupsResponse.Builder resBuilder = + PostApiIndexV1BulkindexgroupsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BulkindexgroupsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexmembershipsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexmembershipsOperation.java new file mode 100644 index 00000000..4ee86168 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexmembershipsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.BulkIndexMembershipsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexmembershipsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BulkindexmembershipsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BulkindexmembershipsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(BulkIndexMembershipsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/bulkindexmemberships"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BulkindexmembershipsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BulkindexmembershipsResponse.Builder resBuilder = + PostApiIndexV1BulkindexmembershipsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BulkindexmembershipsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexshortcutsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexshortcutsOperation.java new file mode 100644 index 00000000..59fb6327 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexshortcutsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.BulkIndexShortcutsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexshortcutsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BulkindexshortcutsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BulkindexshortcutsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(BulkIndexShortcutsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/bulkindexshortcuts"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BulkindexshortcutsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BulkindexshortcutsResponse.Builder resBuilder = + PostApiIndexV1BulkindexshortcutsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BulkindexshortcutsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexteamsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexteamsOperation.java new file mode 100644 index 00000000..0e2fbbb8 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexteamsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.BulkIndexTeamsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexteamsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BulkindexteamsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BulkindexteamsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(BulkIndexTeamsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/bulkindexteams"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BulkindexteamsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BulkindexteamsResponse.Builder resBuilder = + PostApiIndexV1BulkindexteamsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BulkindexteamsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexusersOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexusersOperation.java new file mode 100644 index 00000000..691aeb44 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1BulkindexusersOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.BulkIndexUsersRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexusersResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1BulkindexusersOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1BulkindexusersOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(BulkIndexUsersRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/bulkindexusers"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexusers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexusers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexusers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/bulkindexusers", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1BulkindexusersResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1BulkindexusersResponse.Builder resBuilder = + PostApiIndexV1BulkindexusersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1BulkindexusersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1CheckdocumentaccessOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1CheckdocumentaccessOperation.java new file mode 100644 index 00000000..c6386605 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1CheckdocumentaccessOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.CheckDocumentAccessRequest; +import com.glean.api_client.glean_api_client.models.components.CheckDocumentAccessResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1CheckdocumentaccessResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1CheckdocumentaccessOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1CheckdocumentaccessOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(CheckDocumentAccessRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/checkdocumentaccess"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/checkdocumentaccess", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/checkdocumentaccess", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/checkdocumentaccess", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/checkdocumentaccess", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1CheckdocumentaccessResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1CheckdocumentaccessResponse.Builder resBuilder = + PostApiIndexV1CheckdocumentaccessResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1CheckdocumentaccessResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CheckDocumentAccessResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withCheckDocumentAccessResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentOperation.java new file mode 100644 index 00000000..3ac504aa --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentOperation.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DebugDocumentResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceDocumentRequest; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceDocumentResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DebugDatasourceDocumentOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DebugDatasourceDocumentOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(PostApiIndexV1DebugDatasourceDocumentRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + PostApiIndexV1DebugDatasourceDocumentRequest.class, + baseUrl, + "/api/index/v1/debug/{datasource}/document", + request, null); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "debugDocumentRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/document", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/document", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/document", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/document", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DebugDatasourceDocumentResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DebugDatasourceDocumentResponse.Builder resBuilder = + PostApiIndexV1DebugDatasourceDocumentResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DebugDatasourceDocumentResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + DebugDocumentResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withDebugDocumentResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentsOperation.java new file mode 100644 index 00000000..a1c32c9b --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceDocumentsOperation.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DebugDocumentsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceDocumentsRequest; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceDocumentsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DebugDatasourceDocumentsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DebugDatasourceDocumentsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(PostApiIndexV1DebugDatasourceDocumentsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + PostApiIndexV1DebugDatasourceDocumentsRequest.class, + baseUrl, + "/api/index/v1/debug/{datasource}/documents", + request, null); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "debugDocumentsRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/documents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/documents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/documents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/documents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DebugDatasourceDocumentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DebugDatasourceDocumentsResponse.Builder resBuilder = + PostApiIndexV1DebugDatasourceDocumentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DebugDatasourceDocumentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + DebugDocumentsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withDebugDocumentsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceStatusOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceStatusOperation.java new file mode 100644 index 00000000..46c27467 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceStatusOperation.java @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DebugDatasourceStatusResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceStatusRequest; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceStatusResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DebugDatasourceStatusOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DebugDatasourceStatusOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(PostApiIndexV1DebugDatasourceStatusRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + PostApiIndexV1DebugDatasourceStatusRequest.class, + baseUrl, + "/api/index/v1/debug/{datasource}/status", + request, null); + + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/status", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/status", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/status", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/status", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DebugDatasourceStatusResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DebugDatasourceStatusResponse.Builder resBuilder = + PostApiIndexV1DebugDatasourceStatusResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DebugDatasourceStatusResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + DebugDatasourceStatusResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withDebugDatasourceStatusResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceUserOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceUserOperation.java new file mode 100644 index 00000000..080c0247 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DebugDatasourceUserOperation.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DebugUserResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceUserRequest; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceUserResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DebugDatasourceUserOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DebugDatasourceUserOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(PostApiIndexV1DebugDatasourceUserRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + PostApiIndexV1DebugDatasourceUserRequest.class, + baseUrl, + "/api/index/v1/debug/{datasource}/user", + request, null); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "debugUserRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/user", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/user", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/user", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/debug/{datasource}/user", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DebugDatasourceUserResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DebugDatasourceUserResponse.Builder resBuilder = + PostApiIndexV1DebugDatasourceUserResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DebugDatasourceUserResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + DebugUserResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withDebugUserResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletedocumentOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletedocumentOperation.java new file mode 100644 index 00000000..f01bfa39 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletedocumentOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteDocumentRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeletedocumentResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DeletedocumentOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DeletedocumentOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteDocumentRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/deletedocument"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletedocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletedocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletedocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletedocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DeletedocumentResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DeletedocumentResponse.Builder resBuilder = + PostApiIndexV1DeletedocumentResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DeletedocumentResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteemployeeOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteemployeeOperation.java new file mode 100644 index 00000000..5b714bf0 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteemployeeOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteEmployeeRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeleteemployeeResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DeleteemployeeOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DeleteemployeeOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteEmployeeRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/deleteemployee"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DeleteemployeeResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DeleteemployeeResponse.Builder resBuilder = + PostApiIndexV1DeleteemployeeResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DeleteemployeeResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletegroupOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletegroupOperation.java new file mode 100644 index 00000000..0f739251 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletegroupOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteGroupRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeletegroupResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DeletegroupOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DeletegroupOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteGroupRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/deletegroup"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletegroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletegroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletegroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletegroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DeletegroupResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DeletegroupResponse.Builder resBuilder = + PostApiIndexV1DeletegroupResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DeletegroupResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletemembershipOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletemembershipOperation.java new file mode 100644 index 00000000..ff1bf411 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeletemembershipOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteMembershipRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeletemembershipResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DeletemembershipOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DeletemembershipOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteMembershipRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/deletemembership"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletemembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletemembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletemembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deletemembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DeletemembershipResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DeletemembershipResponse.Builder resBuilder = + PostApiIndexV1DeletemembershipResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DeletemembershipResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteteamOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteteamOperation.java new file mode 100644 index 00000000..e9d45dea --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteteamOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteTeamRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeleteteamResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DeleteteamOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DeleteteamOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteTeamRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/deleteteam"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DeleteteamResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DeleteteamResponse.Builder resBuilder = + PostApiIndexV1DeleteteamResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DeleteteamResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteuserOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteuserOperation.java new file mode 100644 index 00000000..4410e6ed --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1DeleteuserOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.DeleteUserRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeleteuserResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1DeleteuserOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1DeleteuserOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(DeleteUserRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/deleteuser"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/deleteuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1DeleteuserResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1DeleteuserResponse.Builder resBuilder = + PostApiIndexV1DeleteuserResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1DeleteuserResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdatasourceconfigOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdatasourceconfigOperation.java new file mode 100644 index 00000000..41d79ee7 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdatasourceconfigOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.CustomDatasourceConfig; +import com.glean.api_client.glean_api_client.models.components.GetDatasourceConfigRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetdatasourceconfigResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1GetdatasourceconfigOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1GetdatasourceconfigOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetDatasourceConfigRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/getdatasourceconfig"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdatasourceconfig", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdatasourceconfig", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdatasourceconfig", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdatasourceconfig", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1GetdatasourceconfigResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1GetdatasourceconfigResponse.Builder resBuilder = + PostApiIndexV1GetdatasourceconfigResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1GetdatasourceconfigResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CustomDatasourceConfig out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withCustomDatasourceConfig(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentcountOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentcountOperation.java new file mode 100644 index 00000000..2aad4245 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentcountOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetDocumentCountRequest; +import com.glean.api_client.glean_api_client.models.components.GetDocumentCountResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetdocumentcountResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1GetdocumentcountOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1GetdocumentcountOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetDocumentCountRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/getdocumentcount"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentcount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentcount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentcount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentcount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1GetdocumentcountResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1GetdocumentcountResponse.Builder resBuilder = + PostApiIndexV1GetdocumentcountResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1GetdocumentcountResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDocumentCountResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetDocumentCountResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentstatusOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentstatusOperation.java new file mode 100644 index 00000000..ed1b81c7 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetdocumentstatusOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetDocumentStatusRequest; +import com.glean.api_client.glean_api_client.models.components.GetDocumentStatusResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetdocumentstatusResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1GetdocumentstatusOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1GetdocumentstatusOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetDocumentStatusRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/getdocumentstatus"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getdocumentstatus", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1GetdocumentstatusResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1GetdocumentstatusResponse.Builder resBuilder = + PostApiIndexV1GetdocumentstatusResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1GetdocumentstatusResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDocumentStatusResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetDocumentStatusResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetusercountOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetusercountOperation.java new file mode 100644 index 00000000..be7b1d59 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1GetusercountOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.GetUserCountRequest; +import com.glean.api_client.glean_api_client.models.components.GetUserCountResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetusercountResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1GetusercountOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1GetusercountOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(GetUserCountRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/getusercount"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getusercount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getusercount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getusercount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/getusercount", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1GetusercountResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1GetusercountResponse.Builder resBuilder = + PostApiIndexV1GetusercountResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1GetusercountResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUserCountResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGetUserCountResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentOperation.java new file mode 100644 index 00000000..74413f99 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.IndexDocumentRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexdocumentResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1IndexdocumentOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1IndexdocumentOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(IndexDocumentRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/indexdocument"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocument", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1IndexdocumentResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1IndexdocumentResponse.Builder resBuilder = + PostApiIndexV1IndexdocumentResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1IndexdocumentResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentsOperation.java new file mode 100644 index 00000000..51864d0b --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexdocumentsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.IndexDocumentsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexdocumentsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1IndexdocumentsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1IndexdocumentsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(IndexDocumentsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/indexdocuments"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexdocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1IndexdocumentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1IndexdocumentsResponse.Builder resBuilder = + PostApiIndexV1IndexdocumentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1IndexdocumentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexemployeeOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexemployeeOperation.java new file mode 100644 index 00000000..7076450a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexemployeeOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.IndexEmployeeRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexemployeeResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1IndexemployeeOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1IndexemployeeOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(IndexEmployeeRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/indexemployee"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexemployee", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1IndexemployeeResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1IndexemployeeResponse.Builder resBuilder = + PostApiIndexV1IndexemployeeResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1IndexemployeeResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexgroupOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexgroupOperation.java new file mode 100644 index 00000000..2a64caf1 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexgroupOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.IndexGroupRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexgroupResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1IndexgroupOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1IndexgroupOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(IndexGroupRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/indexgroup"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexgroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexgroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexgroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexgroup", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1IndexgroupResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1IndexgroupResponse.Builder resBuilder = + PostApiIndexV1IndexgroupResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1IndexgroupResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexmembershipOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexmembershipOperation.java new file mode 100644 index 00000000..4238b10f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexmembershipOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.IndexMembershipRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexmembershipResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1IndexmembershipOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1IndexmembershipOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(IndexMembershipRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/indexmembership"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexmembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexmembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexmembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexmembership", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1IndexmembershipResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1IndexmembershipResponse.Builder resBuilder = + PostApiIndexV1IndexmembershipResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1IndexmembershipResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexteamOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexteamOperation.java new file mode 100644 index 00000000..bdbbbd70 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexteamOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.IndexTeamRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexteamResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1IndexteamOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1IndexteamOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(IndexTeamRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/indexteam"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexteam", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1IndexteamResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1IndexteamResponse.Builder resBuilder = + PostApiIndexV1IndexteamResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1IndexteamResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexuserOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexuserOperation.java new file mode 100644 index 00000000..a953e62c --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1IndexuserOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.IndexUserRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexuserResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1IndexuserOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1IndexuserOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(IndexUserRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/indexuser"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/indexuser", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1IndexuserResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1IndexuserResponse.Builder resBuilder = + PostApiIndexV1IndexuserResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1IndexuserResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessalldocumentsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessalldocumentsOperation.java new file mode 100644 index 00000000..0f46371c --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessalldocumentsOperation.java @@ -0,0 +1,158 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ProcessAllDocumentsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessalldocumentsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1ProcessalldocumentsOperation implements RequestOperation, PostApiIndexV1ProcessalldocumentsResponse> { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1ProcessalldocumentsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(Optional request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/processalldocuments"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processalldocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processalldocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processalldocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processalldocuments", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1ProcessalldocumentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1ProcessalldocumentsResponse.Builder resBuilder = + PostApiIndexV1ProcessalldocumentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1ProcessalldocumentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallemployeesandteamsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallemployeesandteamsOperation.java new file mode 100644 index 00000000..b486ef91 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallemployeesandteamsOperation.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessallemployeesandteamsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1ProcessallemployeesandteamsOperation implements RequestlessOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1ProcessallemployeesandteamsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest() throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/processallemployeesandteams"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallemployeesandteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallemployeesandteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallemployeesandteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallemployeesandteams", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1ProcessallemployeesandteamsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1ProcessallemployeesandteamsResponse.Builder resBuilder = + PostApiIndexV1ProcessallemployeesandteamsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1ProcessallemployeesandteamsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallmembershipsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallmembershipsOperation.java new file mode 100644 index 00000000..0490fc17 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1ProcessallmembershipsOperation.java @@ -0,0 +1,158 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ProcessAllMembershipsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessallmembershipsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1ProcessallmembershipsOperation implements RequestOperation, PostApiIndexV1ProcessallmembershipsResponse> { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1ProcessallmembershipsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(Optional request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/processallmemberships"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference>() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/processallmemberships", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1ProcessallmembershipsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1ProcessallmembershipsResponse.Builder resBuilder = + PostApiIndexV1ProcessallmembershipsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1ProcessallmembershipsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1RotatetokenOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1RotatetokenOperation.java new file mode 100644 index 00000000..21250ed3 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1RotatetokenOperation.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.RotateTokenResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1RotatetokenResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1RotatetokenOperation implements RequestlessOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1RotatetokenOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest() throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/rotatetoken"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/rotatetoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/rotatetoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/rotatetoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/rotatetoken", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1RotatetokenResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1RotatetokenResponse.Builder resBuilder = + PostApiIndexV1RotatetokenResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1RotatetokenResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + RotateTokenResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withRotateTokenResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UpdatepermissionsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UpdatepermissionsOperation.java new file mode 100644 index 00000000..3e7fe1c7 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UpdatepermissionsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.UpdatePermissionsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1UpdatepermissionsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1UpdatepermissionsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1UpdatepermissionsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UpdatePermissionsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/updatepermissions"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/updatepermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/updatepermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/updatepermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/updatepermissions", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1UpdatepermissionsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1UpdatepermissionsResponse.Builder resBuilder = + PostApiIndexV1UpdatepermissionsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1UpdatepermissionsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UploadshortcutsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UploadshortcutsOperation.java new file mode 100644 index 00000000..5fa2a4aa --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostApiIndexV1UploadshortcutsOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.UploadShortcutsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1UploadshortcutsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostApiIndexV1UploadshortcutsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostApiIndexV1UploadshortcutsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UploadShortcutsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/api/index/v1/uploadshortcuts"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/uploadshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "409", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/uploadshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/uploadshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/api/index/v1/uploadshortcuts", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostApiIndexV1UploadshortcutsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostApiIndexV1UploadshortcutsResponse.Builder resBuilder = + PostApiIndexV1UploadshortcutsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostApiIndexV1UploadshortcutsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "409", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PostRestApiV1ToolsCallOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PostRestApiV1ToolsCallOperation.java new file mode 100644 index 00000000..85b9478e --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PostRestApiV1ToolsCallOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.ToolsCallRequest; +import com.glean.api_client.glean_api_client.models.components.ToolsCallResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.PostRestApiV1ToolsCallResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostRestApiV1ToolsCallOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public PostRestApiV1ToolsCallOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(ToolsCallRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/tools/call"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/rest/api/v1/tools/call", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/rest/api/v1/tools/call", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/rest/api/v1/tools/call", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "post_/rest/api/v1/tools/call", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public PostRestApiV1ToolsCallResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostRestApiV1ToolsCallResponse.Builder resBuilder = + PostRestApiV1ToolsCallResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostRestApiV1ToolsCallResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ToolsCallResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withToolsCallResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "404", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/RecommendationsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/RecommendationsOperation.java new file mode 100644 index 00000000..181fa08c --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/RecommendationsOperation.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.RecommendationsRequest; +import com.glean.api_client.glean_api_client.models.components.ResultsResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.RecommendationsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class RecommendationsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public RecommendationsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(RecommendationsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/recommendations"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "recommendations", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "recommendations", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "recommendations", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "recommendations", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public RecommendationsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + RecommendationsResponse.Builder resBuilder = + RecommendationsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + RecommendationsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ResultsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withResultsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "202", "204")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/SearchAgentsOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/SearchAgentsOperation.java new file mode 100644 index 00000000..cf6d88ee --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/SearchAgentsOperation.java @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.SearchAgentsRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.SearchAgentsResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class SearchAgentsOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public SearchAgentsOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(SearchAgentsRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/agents/search"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "searchAgents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "403", "404", "422", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "searchAgents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "searchAgents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "searchAgents", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public SearchAgentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + SearchAgentsResponse.Builder resBuilder = + SearchAgentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + SearchAgentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.SearchAgentsResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withSearchAgentsResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "403", "404", "422", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/SearchOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/SearchOperation.java new file mode 100644 index 00000000..8e5156d2 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/SearchOperation.java @@ -0,0 +1,189 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.SearchRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.GleanDataError; +import com.glean.api_client.glean_api_client.models.operations.SearchResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class SearchOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public SearchOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(SearchRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/search"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "search", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "408", "422", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "search", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "search", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "search", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public SearchResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + SearchResponse.Builder resBuilder = + SearchResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + SearchResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.SearchResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withSearchResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "422")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GleanDataError out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + throw out; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "408", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/SetdocvisibilityOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/SetdocvisibilityOperation.java new file mode 100644 index 00000000..693e821a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/SetdocvisibilityOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.UpdateDocumentVisibilityOverridesRequest; +import com.glean.api_client.glean_api_client.models.components.UpdateDocumentVisibilityOverridesResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.SetdocvisibilityResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class SetdocvisibilityOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public SetdocvisibilityOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UpdateDocumentVisibilityOverridesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/governance/documents/visibilityoverrides"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "setdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "setdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "setdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "setdocvisibility", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public SetdocvisibilityResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + SetdocvisibilityResponse.Builder resBuilder = + SetdocvisibilityResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + SetdocvisibilityResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + UpdateDocumentVisibilityOverridesResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withUpdateDocumentVisibilityOverridesResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/SummarizeOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/SummarizeOperation.java new file mode 100644 index 00000000..df9e8c06 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/SummarizeOperation.java @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.SummarizeRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.SummarizeResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class SummarizeOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public SummarizeOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(SummarizeRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/summarize"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "summarize", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "summarize", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "summarize", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "summarize", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public SummarizeResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + SummarizeResponse.Builder resBuilder = + SummarizeResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + SummarizeResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + com.glean.api_client.glean_api_client.models.components.SummarizeResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withSummarizeResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/UnpinOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/UnpinOperation.java new file mode 100644 index 00000000..f7dcf898 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/UnpinOperation.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Unpin; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.UnpinResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UnpinOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public UnpinOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(Unpin request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/unpin"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "unpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "unpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "unpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "unpin", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public UnpinResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UnpinResponse.Builder resBuilder = + UnpinResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UnpinResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/UpdateannouncementOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/UpdateannouncementOperation.java new file mode 100644 index 00000000..b7c6cf53 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/UpdateannouncementOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Announcement; +import com.glean.api_client.glean_api_client.models.components.UpdateAnnouncementRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.UpdateannouncementResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UpdateannouncementOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public UpdateannouncementOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UpdateAnnouncementRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/updateannouncement"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "updateannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "updateannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "updateannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "updateannouncement", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public UpdateannouncementResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UpdateannouncementResponse.Builder resBuilder = + UpdateannouncementResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UpdateannouncementResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + Announcement out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAnnouncement(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/UpdatepolicyOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/UpdatepolicyOperation.java new file mode 100644 index 00000000..44f881c8 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/UpdatepolicyOperation.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.UpdateDlpReportResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.UpdatepolicyRequest; +import com.glean.api_client.glean_api_client.models.operations.UpdatepolicyResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UpdatepolicyOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public UpdatepolicyOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UpdatepolicyRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + UpdatepolicyRequest.class, + baseUrl, + "/rest/api/v1/governance/data/policies/{id}", + request, null); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "updateDlpReportRequest", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json; charset=UTF-8") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "updatepolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "403", "4XX", "500", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "updatepolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "updatepolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "updatepolicy", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public UpdatepolicyResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UpdatepolicyResponse.Builder resBuilder = + UpdatepolicyResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UpdatepolicyResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json; charset=UTF-8")) { + UpdateDlpReportResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withUpdateDlpReportResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/UpdateshortcutOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/UpdateshortcutOperation.java new file mode 100644 index 00000000..4b512236 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/UpdateshortcutOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.UpdateShortcutRequest; +import com.glean.api_client.glean_api_client.models.components.UpdateShortcutResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.UpdateshortcutResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UpdateshortcutOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public UpdateshortcutOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UpdateShortcutRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/updateshortcut"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "updateshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "updateshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "updateshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "updateshortcut", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public UpdateshortcutResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UpdateshortcutResponse.Builder resBuilder = + UpdateshortcutResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UpdateshortcutResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UpdateShortcutResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withUpdateShortcutResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/UploadchatfilesOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/UploadchatfilesOperation.java new file mode 100644 index 00000000..13f9ecc6 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/UploadchatfilesOperation.java @@ -0,0 +1,179 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.UploadChatFilesResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.UploadchatfilesRequest; +import com.glean.api_client.glean_api_client.models.operations.UploadchatfilesResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UploadchatfilesOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public UploadchatfilesOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(UploadchatfilesRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/uploadchatfiles"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "uploadChatFilesRequest", + "multipart", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + UploadchatfilesRequest.class, + request, + null)); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "uploadchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "uploadchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "uploadchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "uploadchatfiles", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public UploadchatfilesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UploadchatfilesResponse.Builder resBuilder = + UploadchatfilesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UploadchatfilesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UploadChatFilesResponse out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withUploadChatFilesResponse(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/VerifyOperation.java b/src/main/java/com/glean/api_client/glean_api_client/operations/VerifyOperation.java new file mode 100644 index 00000000..fe0ad284 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/VerifyOperation.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.Verification; +import com.glean.api_client.glean_api_client.models.components.VerifyRequest; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.operations.VerifyResponse; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.SerializedBody; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class VerifyOperation implements RequestOperation { + + private final SDKConfiguration sdkConfiguration; + + public VerifyOperation(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + @Override + public HttpResponse doRequest(VerifyRequest request) throws Exception { + String baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + String url = Utils.generateURL( + baseUrl, + "/rest/api/v1/verify"); + + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + new TypeReference() {}); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "json", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", + SDKConfiguration.USER_AGENT); + + Optional hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); + Utils.configureSecurity(req, + this.sdkConfiguration.securitySource().getSecurity()); + HTTPClient client = this.sdkConfiguration.client(); + HttpRequest r = + sdkConfiguration.hooks() + .beforeRequest( + new BeforeRequestContextImpl( + this.sdkConfiguration, + baseUrl, + "verify", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + req.build()); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "429", "4XX", "5XX")) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "verify", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.of(httpRes), + Optional.empty()); + } else { + httpRes = sdkConfiguration.hooks() + .afterSuccess( + new AfterSuccessContextImpl( + this.sdkConfiguration, + baseUrl, + "verify", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + httpRes); + } + } catch (Exception e) { + httpRes = sdkConfiguration.hooks() + .afterError( + new AfterErrorContextImpl( + this.sdkConfiguration, + baseUrl, + "verify", + java.util.Optional.of(java.util.List.of()), + hookSecuritySource), + Optional.empty(), + Optional.of(e)); + } + + return httpRes; + } + + @Override + public VerifyResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + VerifyResponse.Builder resBuilder = + VerifyResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + VerifyResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + Verification out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withVerification(out); + return res; + } else { + throw new APIException( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "429", "4XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new APIException( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + throw new APIException( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/CopiableInputStream.java b/src/main/java/com/glean/api_client/glean_api_client/utils/CopiableInputStream.java new file mode 100644 index 00000000..a5c93522 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/CopiableInputStream.java @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.utils; + +import org.apache.commons.io.IOUtils; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +public class CopiableInputStream { + private final byte[] bytes; + + public CopiableInputStream(InputStream original) { + try (InputStream stream = original) { + this.bytes = IOUtils.toByteArray(stream); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public InputStream copy() { + return new ByteArrayInputStream(bytes); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/Exceptions.java b/src/main/java/com/glean/api_client/glean_api_client/utils/Exceptions.java new file mode 100644 index 00000000..781ffd38 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/Exceptions.java @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.utils; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; +import java.io.IOException; +import java.io.UncheckedIOException; + +public class Exceptions { + public static RuntimeException unchecked(Throwable t) { + if (t instanceof RuntimeException) { + return (RuntimeException) t; + } else if (t instanceof Error) { + throw (Error) t; // propagate JVM-level errors properly + } else if (t instanceof IOException) { + throw new UncheckedIOException((IOException) t); + } else { + throw new RuntimeException(t); + } + } + + public static T rethrow(Throwable e) { + throw unchecked(e); + } + + @FunctionalInterface + public interface CheckedFunction { + R apply(T t) throws Exception; + } + + @FunctionalInterface + public interface CheckedSupplier { + T get() throws Exception; + } + + @FunctionalInterface + public interface CheckedConsumer { + void accept(T t) throws Exception; + } + + @FunctionalInterface + public interface CheckedRunnable { + void run() throws Exception; + } + + public static Function unchecked(CheckedFunction fn) { + return t -> { + try { + return fn.apply(t); + } catch (Exception e) { + throw unchecked(e); + } + }; + } + + public static Supplier unchecked(CheckedSupplier supplier) { + return () -> { + try { + return supplier.get(); + } catch (Exception e) { + throw unchecked(e); + } + }; + } + + public static Consumer unchecked(CheckedConsumer consumer) { + return t -> { + try { + consumer.accept(t); + } catch (Exception e) { + throw unchecked(e); + } + }; + } + + public static Runnable unchecked(CheckedRunnable runnable) { + return () -> { + try { + runnable.run(); + } catch (Exception e) { + throw unchecked(e); + } + }; + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/Globals.java b/src/main/java/com/glean/api_client/glean_api_client/utils/Globals.java new file mode 100644 index 00000000..e9d93173 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/Globals.java @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.glean.api_client.glean_api_client.utils; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.stream.Stream; + +public final class Globals { + + private final Map queryParams = new HashMap<>(); + private final Map pathParams = new HashMap<>(); + private final Map headerParams = new HashMap<>(); + + + public Globals() { + } + + // internal use only + public void putParam(String type, String name, Object value) { + if ("pathParam".equals(type)) { + putPathParam(name, value); + } else if ("queryParam".equals(type)) { + putQueryParam(name, value); + } else if ("header".equals(type)) { + putHeader(name, value); + } else { + throw new IllegalArgumentException("Unknown parameter type: " + type); + } + } + + // internal use only + public Optional getParam(String type, String name) { + if ("pathParam".equals(type)){ + return getPathParam(name); + } else if ("queryParam".equals(type)) { + return getQueryParam(name); + } else if ("header".equals(type)) { + return getHeader(name); + } else { + throw new IllegalArgumentException("Unknown parameter type: " + type); + } + } + + public void putQueryParam(String name, Object value) { + if (value != null) { + queryParams.put(name, Utils.valToString(value)); + } + } + + public void putPathParam(String name, Object value) { + if (value != null) { + pathParams.put(name, Utils.valToString(value)); + } + } + + public void putHeader(String name, Object value) { + if (value != null) { + headerParams.put(name, Utils.valToString(value)); + } + } + + public Optional getQueryParam(String name) { + return Optional.ofNullable(queryParams.get(name)); + } + + public Optional getPathParam(String name) { + return Optional.ofNullable(pathParams.get(name)); + } + + public Optional getHeader(String name) { + return Optional.ofNullable(headerParams.get(name)); + } + + public Stream> queryParamsAsStream() { + return queryParams.entrySet().stream(); + } + + public Stream> pathParamsAsStream() { + return pathParams.entrySet().stream(); + } + + public Stream> headerParamsAsStream() { + return headerParams.entrySet().stream(); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/HTTPClient.java b/src/main/java/com/glean/api_client/glean_api_client/utils/HTTPClient.java index 90f6d09f..8f1f91b1 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/HTTPClient.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/HTTPClient.java @@ -28,4 +28,25 @@ public interface HTTPClient { */ HttpResponse send(HttpRequest request) throws IOException, InterruptedException, URISyntaxException; + + /** + * Controls the debug flag that can be used by clients to perform conditional + * debugging actions like logging HTTP requests and responses. + * This is currently implemented in SpeakeasyHTTPClient but custom client + * implementations are free to use this method similarly if they wish. + * + * @param enabled Whether to enable debug flag + */ + default void enableDebugLogging(boolean enabled) { + // do nothing + } + + /** + * Returns whether debug logging is enabled. + * + * @return Whether debug logging is enabled + */ + default boolean isDebugLoggingEnabled() { + return false; + } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/Helpers.java b/src/main/java/com/glean/api_client/glean_api_client/utils/Helpers.java index 47985f92..4f0684a5 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/Helpers.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/Helpers.java @@ -104,7 +104,7 @@ public void onNext(ByteBuffer bb) { @Override public void onError(Throwable throwable) { latch.countDown(); - Utils.rethrow(throwable); + Exceptions.rethrow(throwable); } @Override diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/QueryParameters.java b/src/main/java/com/glean/api_client/glean_api_client/utils/QueryParameters.java index 31609026..cb985cc2 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/QueryParameters.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/QueryParameters.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import com.fasterxml.jackson.core.JsonProcessingException; @@ -15,7 +16,7 @@ public class QueryParameters { public static List parseQueryParams(Class type, T queryParams, - Map>> globals) throws Exception { + Globals globals) throws Exception { List allParams = new ArrayList<>(); Field[] fields = type.getDeclaredFields(); @@ -63,6 +64,18 @@ public static List parseQueryParams(Class } } + // include all global params in pathParams if not already present + if (globals != null) { + Set allParamNames = allParams.stream() + .map(QueryParameter::name) + .collect(Collectors.toSet()); + globals.queryParamsAsStream() + .filter(entry -> !allParamNames.contains(entry.getKey())) + .forEach(entry -> + allParams.add(QueryParameter.of(entry.getKey(), + entry.getValue(), false))); + } + return allParams; } diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/Response.java b/src/main/java/com/glean/api_client/glean_api_client/utils/Response.java index a4d6c84a..5f81f29c 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/Response.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/Response.java @@ -2,7 +2,6 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package com.glean.api_client.glean_api_client.utils; - import java.io.InputStream; import java.net.http.HttpResponse; diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java b/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java index 73d862a6..16387152 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/SpeakeasyHTTPClient.java @@ -14,14 +14,20 @@ import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Locale; +import java.util.Optional; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; public class SpeakeasyHTTPClient implements HTTPClient { + // global debug flag. Retained for backwards compatibility. private static boolean debugEnabled = false; + // Instance-level debug flag. Can be set by clients to enable debug logging for a + // single SDK instance. + private Boolean localDebugEnabled; + // uppercase private static Set redactedHeaders = Set.of("AUTHORIZATION", "X-API-KEY"); @@ -44,6 +50,20 @@ public static void setDebugLogging(boolean enabled) { debugEnabled = enabled; } + public static boolean getDebugLoggingEnabled() { + return debugEnabled; + } + + @Override + public boolean isDebugLoggingEnabled() { + return Optional.ofNullable(localDebugEnabled).orElse(debugEnabled); + } + + @Override + public void enableDebugLogging(boolean enabled) { + localDebugEnabled = enabled; + } + /** * Experimental, may be changed anytime. When debug logging is enabled this * method controls the suppression of header values in the logs. By default, @@ -67,11 +87,11 @@ public static void setLogger(Consumer logger) { @Override public HttpResponse send(HttpRequest request) throws IOException, InterruptedException, URISyntaxException { - if (debugEnabled) { + if (isDebugLoggingEnabled()) { request = logRequest(request); } var response = client.send(request, HttpResponse.BodyHandlers.ofInputStream()); - if (debugEnabled) { + if (isDebugLoggingEnabled()) { response = logResponse(response); } return response; diff --git a/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java b/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java index d4d2e3a8..2bb4c46f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java +++ b/src/main/java/com/glean/api_client/glean_api_client/utils/Utils.java @@ -35,12 +35,14 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; +import java.lang.Iterable; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.NoSuchElementException; +import java.util.Objects; import java.util.Optional; import java.util.Random; import java.util.concurrent.Callable; @@ -80,7 +82,7 @@ public static boolean referenceEquals(Object a, Object b) { } public static String generateURL(String baseURL, String path) - throws IllegalArgumentException, IllegalAccessException { + throws IllegalArgumentException { if (baseURL != null && baseURL.endsWith("/")) { baseURL = baseURL.substring(0, baseURL.length() - 1); } @@ -89,7 +91,7 @@ public static String generateURL(String baseURL, String path) } public static String generateURL(Class type, String baseURL, String path, JsonNullable params, - Map>> globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { + Globals globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { if (params.isPresent() && params.get() != null) { return generateURL(type, baseURL, path, params.get(), globals); } else { @@ -98,7 +100,7 @@ public static String generateURL(Class type, String baseURL, String path, } public static String generateURL(Class type, String baseURL, String path, Optional params, - Map>> globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { + Globals globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { if (params.isPresent()) { return generateURL(type, baseURL, path, params.get(), globals); } else { @@ -107,7 +109,7 @@ public static String generateURL(Class type, String baseURL, String path, } public static String generateURL(Class type, String baseURL, String path, T params, - Map>> globals) + Globals globals) throws IllegalArgumentException, IllegalAccessException, JsonProcessingException { if (baseURL != null && baseURL.endsWith("/")) { baseURL = baseURL.substring(0, baseURL.length() - 1); @@ -207,7 +209,14 @@ public static String generateURL(Class type, String baseURL, String path, } } } - + // include all global params in pathParams if not already present + if (globals != null) { + globals.pathParamsAsStream() + .filter(entry -> !pathParams.containsKey(entry.getKey())) + .forEach(entry -> pathParams.put(entry.getKey(), // + pathEncode(entry.getValue(), false))); + } + return baseURL + templateUrl(path, pathParams); } @@ -265,7 +274,7 @@ public static SerializedBody serializeRequestBody(Object request, String request } public static List getQueryParams(Class type, Optional params, - Map>> globals) throws Exception { + Globals globals) throws Exception { if (params.isEmpty()) { return Collections.emptyList(); } else { @@ -274,7 +283,7 @@ public static List getQueryParams(Class ty } public static List getQueryParams(Class type, JsonNullable params, - Map>> globals) throws Exception { + Globals globals) throws Exception { if (!params.isPresent() || params.get() == null) { return Collections.emptyList(); } else { @@ -283,7 +292,7 @@ public static List getQueryParams(Class ty } public static List getQueryParams(Class type, T params, - Map>> globals) throws Exception { + Globals globals) throws Exception { return QueryParameters.parseQueryParams(type, params, globals); } @@ -316,7 +325,7 @@ public static String templateUrl(String url, Map params) { return sb.toString().replace(DOLLAR_MARKER, "$"); } - public static Map> getHeadersFromMetadata(Object headers, Map>> globals) throws Exception { + public static Map> getHeadersFromMetadata(Object headers, Globals globals) throws Exception { if (headers == null) { return Collections.emptyMap(); } @@ -441,6 +450,14 @@ public static Map> getHeadersFromMetadata(Object headers, M } } } + + // include all global headers in result if not already present + if (globals != null) { + globals.headerParamsAsStream() + .filter(entry -> !result.containsKey(entry.getKey())) + .forEach(entry -> result.put(entry.getKey(), // + Arrays.asList(entry.getValue()))); + } return result; } @@ -467,17 +484,10 @@ public static String prefixBearer(String authHeaderValue) { } public static Object populateGlobal(Object value, String fieldName, String paramType, - Map>> globals) { - if (value == null && - globals != null && - globals.containsKey("parameters") && - globals.get("parameters").containsKey(paramType)) { - Object globalVal = globals.get("parameters").get(paramType).get(fieldName); - if (globalVal != null) { - value = globalVal; - } - } - + Globals globals) { + if (value == null && globals != null) { + return globals.getParam(paramType, fieldName).orElse(null); + } return value; } @@ -770,7 +780,12 @@ static Object resolveStringShape(Class type, String fieldName, Object val public static Stream stream(Callable> first, Function> next) { return StreamSupport.stream(iterable(first, next).spliterator(), false); } - + + public static Stream toStream(Iterable iterable) { + return StreamSupport.stream(iterable.spliterator(), false); + } + + // need a Function method that throws public interface Function { T apply(S value) throws Exception; @@ -815,26 +830,14 @@ private void load() { pending = false; } } catch (Exception e) { - rethrow(e); + Exceptions.rethrow(e); } } }; } }; } - - static T rethrow(Throwable e) { - if (e instanceof RuntimeException) { - throw (RuntimeException) e; - } else if (e instanceof Error) { - throw (Error) e; - } else if (e instanceof IOException) { - throw new UncheckedIOException((IOException) e); - } else { - throw new RuntimeException(e); - } - } - + public static boolean statusCodeMatches(int statusCode, String... expectedStatusCodes) { return Arrays.stream(expectedStatusCodes) .anyMatch(expected -> statusCodeMatchesOne(statusCode, expected)); @@ -1405,4 +1408,169 @@ public static T valueOrNull(Optional value) { public static T valueOrNull(JsonNullable value) { return valueOrElse(value, null); } + + public static N castLong(long value, Class targetType) { + // Handle supported types safely + if (targetType == Integer.class) { + return targetType.cast((int) value); + } else if (targetType == Long.class) { + return targetType.cast(value); + } else if (targetType == Short.class) { + return targetType.cast((short) value); + } else if (targetType == BigInteger.class) { + return targetType.cast(BigInteger.valueOf(value)); + } else { + throw new IllegalArgumentException("Unsupported number type: " + targetType); + } + } + + public static Iterator transform(Iterator iterator, Function mapper) { + return new Iterator<>() { + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public O next() { + return Exceptions.unchecked(() -> mapper.apply(iterator.next())).get(); + } + }; + } + + /** + * Returns true if and only if the two objects are deeply equal, uses + * mathematical equivalence for Number subclasses ({@code 2 == 2.0}) instead of + * {@code Number.equals}. + * + *

+ * Should be paired with {@link #enhancedHashCode(Object)} to ensure the + * equals/hashCode contract. + * + * @param a the first object to compare + * @param b the second object to compare + * @return true if the objects are deeply equal bearing in mind mathematical + * equivalence, false otherwise + */ + public static boolean enhancedDeepEquals(Object a, Object b) { + if (a == null && b == null) { + return true; + } else if (a == null || b == null) { + return false; + } else if (a instanceof Optional && b instanceof Optional) { + return enhancedDeepEquals(((Optional) a).orElse(null), ((Optional) b).orElse(null)); + } else if (a instanceof JsonNullable && b instanceof JsonNullable) { + JsonNullable x = (JsonNullable) a; + JsonNullable y = (JsonNullable) b; + if (x.isPresent() && y.isPresent()) { + return enhancedDeepEquals(x.get(), y.get()); + } else { + return Objects.deepEquals(x, y); + } + } else if (a instanceof List && b instanceof List) { + List listA = (List) a; + List listB = (List) b; + if (listA.size() != listB.size()) { + return false; + } + for (int i = 0; i < listA.size(); i++) { + if (!enhancedDeepEquals(listA.get(i), listB.get(i))) { + return false; + } + } + return true; + } else if (a instanceof Map && b instanceof Map) { + // don't expect number keys, just Strings and enums + Map x = (Map) a; + Map y = (Map) b; + if (x.size() != y.size()) { + return false; + } + for (Entry entry : x.entrySet()) { + Object key = entry.getKey(); + Object value1 = entry.getValue(); + Object value2 = y.get(key); + if (!enhancedDeepEquals(value1, value2)) { + return false; + } + } + return true; + } else if (a instanceof Number && b instanceof Number) { + // compare values mathematically + BigDecimal x = toBigDecimal((Number) a); + BigDecimal y = toBigDecimal((Number) b); + return x.compareTo(y) == 0; + } else { + // we use deepEquals so that byte[] fields are compared appropriately + return Objects.deepEquals(a, b); + } + } + + /** + * Returns a combined hash code (applying {@link #enhancedHashCode}) for the + * given objects (usually the fields of an object whose hashCode we want to + * be calculated). + * + * @param objects + * @return combined hash code for the objects, 0 if the objects are null + */ + public static int enhancedHash(Object... objects) { + if (objects == null) { + return 0; + } + int result = 1; + for (Object o : objects) { + result = 31 * result + (o == null ? 0 :enhancedHashCode(o)); + } + return result; + } + + /** + * Returns a hash code that complies with the equals/hashCode contract when + * equals is implemented by {@link #enhancedDeepEquals(Object, Object)}. + * + * @param o object to calculate the hash code for (can be null) + * @return hash code for the object, 0 if the object is null + */ + public static int enhancedHashCode(Object o) { + if (o == null) { + return 0; + } else if (o instanceof Optional) { + Optional opt = (Optional) o; + return opt.map(Utils::enhancedHashCode).orElse(Optional.empty().hashCode()); + } else if (o instanceof JsonNullable) { + JsonNullable n = (JsonNullable) o; + return n.isPresent() ? Utils.enhancedHashCode(n.get()) : JsonNullable.undefined().hashCode(); + } else if (o instanceof List) { + return ((List) o).stream().mapToInt(Utils::enhancedHashCode).sum(); + } else if (o instanceof Map) { + // don't expect number keys, just Strings and enums + Map m = (Map) o; + return m.entrySet() // + .stream() // + .mapToInt(entry -> Objects.hashCode(entry.getKey()) + Utils.enhancedHashCode(entry.getValue())) // + .sum(); + } else if (o instanceof Number) { + return toBigDecimal((Number) o).stripTrailingZeros().hashCode(); + } else { + return o.hashCode(); + } + } + + private static BigDecimal toBigDecimal(Number number) { + if (number instanceof BigDecimal) { + return (BigDecimal) number; + } else if (number instanceof BigInteger) { + return new BigDecimal((BigInteger) number); + } else if (number instanceof Byte || number instanceof Short || + number instanceof Integer || number instanceof Long) { + return BigDecimal.valueOf(number.longValue()); + } else if (number instanceof Float || number instanceof Double) { + // Prevent precision issues for float/double + return BigDecimal.valueOf(number.doubleValue()); + } else { + // Fallback: treat as double + return BigDecimal.valueOf(number.doubleValue()); + } + } } diff --git a/src/test/java/com/glean/api_client/glean_api_client/ActivitiesTests.java b/src/test/java/com/glean/api_client/glean_api_client/ActivitiesTests.java index 3093b40f..0ed6ad48 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ActivitiesTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ActivitiesTests.java @@ -22,7 +22,7 @@ public void testActivities_Feedback() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); FeedbackResponse res = sdk.client().activity().feedback() diff --git a/src/test/java/com/glean/api_client/glean_api_client/AgentsTests.java b/src/test/java/com/glean/api_client/glean_api_client/AgentsTests.java index 3dd93a1f..5a9f794b 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/AgentsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/AgentsTests.java @@ -41,7 +41,7 @@ public void testAgents_GetAgent() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetAgentResponse res = sdk.client().agents().retrieve() @@ -65,7 +65,7 @@ public void testAgents_GetAgentSchemas() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetAgentSchemasResponse res = sdk.client().agents().retrieveSchemas() diff --git a/src/test/java/com/glean/api_client/glean_api_client/AnnouncementsTests.java b/src/test/java/com/glean/api_client/glean_api_client/AnnouncementsTests.java index 017210a7..de43a887 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/AnnouncementsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/AnnouncementsTests.java @@ -74,7 +74,7 @@ public void testAnnouncements_Createannouncement() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); CreateAnnouncementRequest req = CreateAnnouncementRequest.builder() @@ -3665,7 +3665,7 @@ public void testAnnouncements_Deleteannouncement() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteAnnouncementRequest req = DeleteAnnouncementRequest.builder() @@ -3725,7 +3725,7 @@ public void testAnnouncements_Updateannouncement() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); UpdateAnnouncementRequest req = UpdateAnnouncementRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/AnswersTests.java b/src/test/java/com/glean/api_client/glean_api_client/AnswersTests.java index 610e41d9..1755ff58 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/AnswersTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/AnswersTests.java @@ -87,7 +87,7 @@ public void testAnswers_Createanswer() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); CreateAnswerRequest req = CreateAnswerRequest.builder() @@ -2762,7 +2762,7 @@ public void testAnswers_Deleteanswer() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteAnswerRequest req = DeleteAnswerRequest.builder() @@ -2783,7 +2783,7 @@ public void testAnswers_Editanswer() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); EditAnswerRequest req = EditAnswerRequest.builder() @@ -5468,7 +5468,7 @@ public void testAnswers_Getanswer() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetAnswerRequest req = GetAnswerRequest.builder() @@ -8047,7 +8047,7 @@ public void testAnswers_Listanswers() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListAnswersRequest req = ListAnswersRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/ClientActivityTests.java b/src/test/java/com/glean/api_client/glean_api_client/ClientActivityTests.java index d1dc61e8..cf9471bb 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ClientActivityTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ClientActivityTests.java @@ -25,7 +25,7 @@ public void testClientActivity_Activity() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); Activity req = Activity.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/ClientAuthenticationTests.java b/src/test/java/com/glean/api_client/glean_api_client/ClientAuthenticationTests.java index 679de8be..7afceed8 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ClientAuthenticationTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ClientAuthenticationTests.java @@ -26,7 +26,7 @@ public void testClientAuthentication_Createauthtoken() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); CreateauthtokenResponse res = sdk.client().authentication().createToken() diff --git a/src/test/java/com/glean/api_client/glean_api_client/ClientChatTests.java b/src/test/java/com/glean/api_client/glean_api_client/ClientChatTests.java index 7c218e47..6a777d66 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ClientChatTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ClientChatTests.java @@ -178,7 +178,7 @@ public void testClientChat_Deleteallchats() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteallchatsResponse res = sdk.client().chat().deleteAll() @@ -193,7 +193,7 @@ public void testClientChat_Deletechats() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeletechatsResponse res = sdk.client().chat().delete() @@ -213,7 +213,7 @@ public void testClientChat_Getchat() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetchatResponse res = sdk.client().chat().retrieve() @@ -1263,7 +1263,7 @@ public void testClientChat_Listchats() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListchatsResponse res = sdk.client().chat().list() @@ -1812,7 +1812,7 @@ public void testClientChat_Getchatapplication() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetchatapplicationResponse res = sdk.client().chat().retrieveApplication() @@ -1834,7 +1834,7 @@ public void testClientChat_Getchatfiles() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetchatfilesResponse res = sdk.client().chat().retrieveFiles() @@ -1874,7 +1874,7 @@ public void testClientChat_Deletechatfiles() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeletechatfilesResponse res = sdk.client().chat().deleteFiles() @@ -1893,7 +1893,7 @@ public void testClientChat_ChatStreamDefaultExample() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ChatStreamResponse res = sdk.client().chat().createStream() @@ -1920,7 +1920,7 @@ public void testClientChat_ChatStreamGptAgentExample() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ChatStreamResponse res = sdk.client().chat().createStream() @@ -1950,7 +1950,7 @@ public void testClientChat_ChatStreamStreamingExample() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ChatStreamResponse res = sdk.client().chat().createStream() @@ -1972,7 +1972,7 @@ public void testClientChat_ChatStreamUpdateResponse() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ChatStreamResponse res = sdk.client().chat().createStream() @@ -6162,7 +6162,7 @@ public void testClientChat_ChatStreamCitationResponse() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ChatStreamResponse res = sdk.client().chat().createStream() diff --git a/src/test/java/com/glean/api_client/glean_api_client/ClientDocumentsTests.java b/src/test/java/com/glean/api_client/glean_api_client/ClientDocumentsTests.java index 118ba0a8..4939a3ef 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ClientDocumentsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ClientDocumentsTests.java @@ -74,7 +74,7 @@ public void testClientDocuments_Getdocpermissions() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetDocPermissionsRequest req = GetDocPermissionsRequest.builder() @@ -97,7 +97,7 @@ public void testClientDocuments_Getdocuments() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetdocumentsResponse res = sdk.client().documents().retrieve() @@ -123,7 +123,7 @@ public void testClientDocuments_Getdocumentsbyfacets() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetDocumentsByFacetsRequest req = GetDocumentsByFacetsRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/ClientShortcutsTests.java b/src/test/java/com/glean/api_client/glean_api_client/ClientShortcutsTests.java index 601a3558..5bffa7a3 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ClientShortcutsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ClientShortcutsTests.java @@ -86,7 +86,7 @@ public void testClientShortcuts_Createshortcut() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); CreateShortcutRequest req = CreateShortcutRequest.builder() @@ -636,7 +636,7 @@ public void testClientShortcuts_Deleteshortcut() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteShortcutRequest req = DeleteShortcutRequest.builder() @@ -656,7 +656,7 @@ public void testClientShortcuts_Getshortcut() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetShortcutRequestUnion req = GetShortcutRequestUnion.of(GetShortcutRequest.builder() @@ -685,7 +685,7 @@ public void testClientShortcuts_Listshortcuts() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListShortcutsPaginatedRequest req = ListShortcutsPaginatedRequest.builder() @@ -817,7 +817,7 @@ public void testClientShortcuts_Updateshortcut() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); UpdateShortcutRequest req = UpdateShortcutRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/ClientVerificationTests.java b/src/test/java/com/glean/api_client/glean_api_client/ClientVerificationTests.java index dcdf3d83..083087be 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ClientVerificationTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ClientVerificationTests.java @@ -70,7 +70,7 @@ public void testClientVerification_Addverificationreminder() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ReminderRequest req = ReminderRequest.builder() @@ -753,7 +753,7 @@ public void testClientVerification_Listverifications() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListverificationsResponse res = sdk.client().verification().list() @@ -2377,7 +2377,7 @@ public void testClientVerification_Verify() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); VerifyRequest req = VerifyRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/CollectionsTests.java b/src/test/java/com/glean/api_client/glean_api_client/CollectionsTests.java index 804746de..979ef5a1 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/CollectionsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/CollectionsTests.java @@ -90,7 +90,7 @@ public void testCollections_Addcollectionitems() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); AddCollectionItemsRequest req = AddCollectionItemsRequest.builder() @@ -1542,7 +1542,7 @@ public void testCollections_Createcollection() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); CreateCollectionRequest req = CreateCollectionRequest.builder() @@ -3962,7 +3962,7 @@ public void testCollections_Deletecollection() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteCollectionRequest req = DeleteCollectionRequest.builder() @@ -3984,7 +3984,7 @@ public void testCollections_Deletecollectionitem() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteCollectionItemRequest req = DeleteCollectionItemRequest.builder() @@ -5759,7 +5759,7 @@ public void testCollections_Editcollection() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); EditCollectionRequest req = EditCollectionRequest.builder() @@ -7665,7 +7665,7 @@ public void testCollections_Editcollectionitem() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); EditCollectionItemRequest req = EditCollectionItemRequest.builder() @@ -8737,7 +8737,7 @@ public void testCollections_Getcollection() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetCollectionRequest req = GetCollectionRequest.builder() @@ -9999,7 +9999,7 @@ public void testCollections_Listcollections() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListCollectionsRequest req = ListCollectionsRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/DatasourcesTests.java b/src/test/java/com/glean/api_client/glean_api_client/DatasourcesTests.java index 1d8c21da..32244082 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/DatasourcesTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/DatasourcesTests.java @@ -27,7 +27,7 @@ public void testDatasources_PostApiIndexV1Adddatasource() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); CustomDatasourceConfig req = CustomDatasourceConfig.builder() @@ -65,7 +65,7 @@ public void testDatasources_PostApiIndexV1Getdatasourceconfig() throws Exception Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetDatasourceConfigRequest req = GetDatasourceConfigRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/EntitiesTests.java b/src/test/java/com/glean/api_client/glean_api_client/EntitiesTests.java index 994ac22e..ef330e95 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/EntitiesTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/EntitiesTests.java @@ -78,7 +78,7 @@ public void testEntities_Listentities() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListEntitiesRequest req = ListEntitiesRequest.builder() @@ -711,7 +711,7 @@ public void testEntities_People() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); PeopleRequest req = PeopleRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/IndexingAuthenticationTests.java b/src/test/java/com/glean/api_client/glean_api_client/IndexingAuthenticationTests.java index 4e3d3d89..8347b4ee 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/IndexingAuthenticationTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/IndexingAuthenticationTests.java @@ -20,7 +20,7 @@ public void testIndexingAuthentication_PostApiIndexV1Rotatetoken() throws Except Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); PostApiIndexV1RotatetokenResponse res = sdk.indexing().authentication().rotateToken() diff --git a/src/test/java/com/glean/api_client/glean_api_client/IndexingDocumentsTests.java b/src/test/java/com/glean/api_client/glean_api_client/IndexingDocumentsTests.java index e95cead5..09542989 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/IndexingDocumentsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/IndexingDocumentsTests.java @@ -29,7 +29,7 @@ public void testIndexingDocuments_PostApiIndexV1Indexdocument() throws Exception Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); IndexDocumentRequest req = IndexDocumentRequest.builder() @@ -51,7 +51,7 @@ public void testIndexingDocuments_PostApiIndexV1Indexdocuments() throws Exceptio Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); IndexDocumentsRequest req = IndexDocumentsRequest.builder() @@ -75,7 +75,7 @@ public void testIndexingDocuments_PostApiIndexV1Bulkindexdocuments() throws Exce Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); BulkIndexDocumentsRequest req = BulkIndexDocumentsRequest.builder() @@ -100,7 +100,7 @@ public void testIndexingDocuments_PostApiIndexV1Processalldocuments() throws Exc Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); PostApiIndexV1ProcessalldocumentsResponse res = sdk.indexing().documents().processAll() @@ -115,7 +115,7 @@ public void testIndexingDocuments_PostApiIndexV1Deletedocument() throws Exceptio Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteDocumentRequest req = DeleteDocumentRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/IndexingPermissionsTests.java b/src/test/java/com/glean/api_client/glean_api_client/IndexingPermissionsTests.java index 2150e102..803361ca 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/IndexingPermissionsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/IndexingPermissionsTests.java @@ -47,7 +47,7 @@ public void testIndexingPermissions_PostApiIndexV1Updatepermissions() throws Exc Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); UpdatePermissionsRequest req = UpdatePermissionsRequest.builder() @@ -69,7 +69,7 @@ public void testIndexingPermissions_PostApiIndexV1Indexuser() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); IndexUserRequest req = IndexUserRequest.builder() @@ -93,7 +93,7 @@ public void testIndexingPermissions_PostApiIndexV1Bulkindexusers() throws Except Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); BulkIndexUsersRequest req = BulkIndexUsersRequest.builder() @@ -127,7 +127,7 @@ public void testIndexingPermissions_PostApiIndexV1Indexgroup() throws Exception Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); IndexGroupRequest req = IndexGroupRequest.builder() @@ -150,7 +150,7 @@ public void testIndexingPermissions_PostApiIndexV1Bulkindexgroups() throws Excep Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); BulkIndexGroupsRequest req = BulkIndexGroupsRequest.builder() @@ -178,7 +178,7 @@ public void testIndexingPermissions_PostApiIndexV1Indexmembership() throws Excep Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); IndexMembershipRequest req = IndexMembershipRequest.builder() @@ -201,7 +201,7 @@ public void testIndexingPermissions_PostApiIndexV1Bulkindexmemberships() throws Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); BulkIndexMembershipsRequest req = BulkIndexMembershipsRequest.builder() @@ -229,7 +229,7 @@ public void testIndexingPermissions_PostApiIndexV1Processallmemberships() throws Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); PostApiIndexV1ProcessallmembershipsResponse res = sdk.indexing().permissions().processMemberships() @@ -244,7 +244,7 @@ public void testIndexingPermissions_PostApiIndexV1Deleteuser() throws Exception Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteUserRequest req = DeleteUserRequest.builder() @@ -265,7 +265,7 @@ public void testIndexingPermissions_PostApiIndexV1Deletegroup() throws Exception Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteGroupRequest req = DeleteGroupRequest.builder() @@ -286,7 +286,7 @@ public void testIndexingPermissions_PostApiIndexV1Deletemembership() throws Exce Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); DeleteMembershipRequest req = DeleteMembershipRequest.builder() @@ -309,7 +309,7 @@ public void testIndexingPermissions_PostApiIndexV1Betausers() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GreenlistUsersRequest req = GreenlistUsersRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/InsightsTests.java b/src/test/java/com/glean/api_client/glean_api_client/InsightsTests.java index c479213b..bd252bdb 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/InsightsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/InsightsTests.java @@ -75,7 +75,7 @@ public void testInsights_Insights() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); InsightsRequest req = InsightsRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/MessagesTests.java b/src/test/java/com/glean/api_client/glean_api_client/MessagesTests.java index fecc708c..b3f9a639 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/MessagesTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/MessagesTests.java @@ -98,7 +98,7 @@ public void testMessages_Messages() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); MessagesRequest req = MessagesRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/PeopleTests.java b/src/test/java/com/glean/api_client/glean_api_client/PeopleTests.java index 2c013d50..ae5077f8 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/PeopleTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/PeopleTests.java @@ -19,7 +19,7 @@ public void testPeople_PostApiIndexV1Processallemployeesandteams() throws Except Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); PostApiIndexV1ProcessallemployeesandteamsResponse res = sdk.indexing().people().processAllEmployeesAndTeams() diff --git a/src/test/java/com/glean/api_client/glean_api_client/PinsTests.java b/src/test/java/com/glean/api_client/glean_api_client/PinsTests.java index a4de2477..e153c2ec 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/PinsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/PinsTests.java @@ -76,7 +76,7 @@ public void testPins_Editpin() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); EditPinRequest req = EditPinRequest.builder() @@ -430,7 +430,7 @@ public void testPins_Getpin() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetPinRequest req = GetPinRequest.builder() @@ -959,7 +959,7 @@ public void testPins_Listpins() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListpinsRequest req = ListpinsRequest.builder() @@ -1573,7 +1573,7 @@ public void testPins_Pin() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); PinRequest req = PinRequest.builder() @@ -2053,7 +2053,7 @@ public void testPins_Unpin() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); Unpin req = Unpin.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/PoliciesTests.java b/src/test/java/com/glean/api_client/glean_api_client/PoliciesTests.java index ad6d60c4..e6de5381 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/PoliciesTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/PoliciesTests.java @@ -23,7 +23,7 @@ public void testPolicies_Getpolicy() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetpolicyResponse res = sdk.client().governance().data().policies().retrieve() @@ -58,7 +58,7 @@ public void testPolicies_Listpolicies() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ListpoliciesResponse res = sdk.client().governance().data().policies().list() diff --git a/src/test/java/com/glean/api_client/glean_api_client/SearchTests.java b/src/test/java/com/glean/api_client/glean_api_client/SearchTests.java index 70328d79..86b064ec 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/SearchTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/SearchTests.java @@ -118,7 +118,7 @@ public void testSearch_Adminsearch() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); SearchRequest req = SearchRequest.builder() @@ -256,7 +256,7 @@ public void testSearch_Autocomplete() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); AutocompleteRequest req = AutocompleteRequest.builder() @@ -301,7 +301,7 @@ public void testSearch_Feed() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); FeedRequest req = FeedRequest.builder() @@ -2180,7 +2180,7 @@ public void testSearch_Recommendations() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); RecommendationsRequest req = RecommendationsRequest.builder() @@ -9526,7 +9526,7 @@ public void testSearch_Search() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); SearchRequest req = SearchRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/SummarizeTests.java b/src/test/java/com/glean/api_client/glean_api_client/SummarizeTests.java index a7ee0312..8cb0dff9 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/SummarizeTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/SummarizeTests.java @@ -23,7 +23,7 @@ public void testSummarize_Summarize() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); SummarizeRequest req = SummarizeRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/ToolsTests.java b/src/test/java/com/glean/api_client/glean_api_client/ToolsTests.java index eb3cdb44..2be0b433 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/ToolsTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/ToolsTests.java @@ -25,7 +25,7 @@ public void testTools_GetRestApiV1ToolsList() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetRestApiV1ToolsListResponse res = sdk.client().tools().list() @@ -44,7 +44,7 @@ public void testTools_PostRestApiV1ToolsCall() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); ToolsCallRequest req = ToolsCallRequest.builder() diff --git a/src/test/java/com/glean/api_client/glean_api_client/TroubleshootingTests.java b/src/test/java/com/glean/api_client/glean_api_client/TroubleshootingTests.java index 4054d8de..02ce18e2 100644 --- a/src/test/java/com/glean/api_client/glean_api_client/TroubleshootingTests.java +++ b/src/test/java/com/glean/api_client/glean_api_client/TroubleshootingTests.java @@ -36,7 +36,7 @@ public void testTroubleshooting_PostApiIndexV1Checkdocumentaccess() throws Excep Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); CheckDocumentAccessRequest req = CheckDocumentAccessRequest.builder() @@ -63,7 +63,7 @@ public void testTroubleshooting_PostApiIndexV1Getdocumentstatus() throws Excepti Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetDocumentStatusRequest req = GetDocumentStatusRequest.builder() @@ -89,7 +89,7 @@ public void testTroubleshooting_PostApiIndexV1Getdocumentcount() throws Exceptio Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetDocumentCountRequest req = GetDocumentCountRequest.builder() @@ -113,7 +113,7 @@ public void testTroubleshooting_PostApiIndexV1Getusercount() throws Exception { Glean sdk = Glean.builder() .serverURL(Utils.environmentVariable("TEST_SERVER_URL", "http://localhost:18080")) .client(testHttpClient) - .apiToken("") + .apiToken("x-env: GLEAN_API_TOKEN") .build(); GetUserCountRequest req = GetUserCountRequest.builder() diff --git a/tests/mockserver/.gitignore b/tests/mockserver/.gitignore new file mode 100644 index 00000000..9544318b --- /dev/null +++ b/tests/mockserver/.gitignore @@ -0,0 +1 @@ +_debug diff --git a/tests/mockserver/Dockerfile b/tests/mockserver/Dockerfile new file mode 100644 index 00000000..efdea18c --- /dev/null +++ b/tests/mockserver/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.23 + +WORKDIR /usr/src/app + +COPY go.mod go.sum ./ +RUN go mod download && go mod verify +COPY . . +COPY *testdata /usr/local/bin/testdata +RUN go build -v -o /usr/local/bin/mockserver . +EXPOSE 18080 +ENTRYPOINT ["mockserver"] diff --git a/tests/mockserver/Makefile b/tests/mockserver/Makefile new file mode 100644 index 00000000..2ae6a36c --- /dev/null +++ b/tests/mockserver/Makefile @@ -0,0 +1,18 @@ +.PHONY: start + +start: + @if command -v docker >/dev/null 2>&1; then \ + echo "Starting mock server with Docker..."; \ + docker build -t mockserver . && \ + docker run -i -p 18080:18080 -t --rm mockserver; \ + elif command -v go >/dev/null 2>&1; then \ + echo "Docker not found. Starting mock server with Go..."; \ + go run .; \ + else \ + echo "Neither Docker nor Go found. To run the mock server:"; \ + echo "\nOption 1 - Using Docker:"; \ + echo " docker build -t mockserver ."; \ + echo " docker run -i -p 18080:18080 -t --rm mockserver"; \ + echo "\nOption 2 - Using Go:"; \ + echo " go run ."; \ + fi diff --git a/tests/mockserver/README.md b/tests/mockserver/README.md new file mode 100644 index 00000000..c8424fd3 --- /dev/null +++ b/tests/mockserver/README.md @@ -0,0 +1,52 @@ +# Mock Server + +A generated HTTP mock server based on your OpenAPI Specification (OAS). Use this mock server for integration and contract testing. + +## Usage + +The server can be built and started via the [Go programming language toolchain](https://go.dev/) or [Docker](https://www.docker.com/). + +If you have Go installed, start the server directly via: + +```shell +go run . +``` + +Otherwise, if you have Docker installed, build and run the server via: + +```shell +docker build -t mockserver . +docker run -i -p 18080:18080 -t --rm mockserver +``` + +By default, the server runs on port `18080`. + +### Server Paths + +The server contains generated paths from the OAS and the following additional built-in paths. + +| Path | Description | +|---|---| +| [`/_mockserver/health`](https://localhost:18080/_mockserver/health) | verify server is running | +| [`/_mockserver/log`](https://localhost:18080/_mockserver/log) | view per-OAS-operation logs | + +Any request outside the generated and built-in paths will return a `404 Not Found` response. + +### Server Customization + +The server supports the following flags for customization. + +| Flag | Default | Description | +|---|---|---| +| `-address` | `:18080` | server listen address | +| `-log-format` | `text` | logging format (supported: `JSON`, `text`) | +| `-log-level` | `INFO` | logging level (supported: `DEBUG`, `INFO`, `WARN`, `ERROR`) | + +For example, enabling server debug logging: + +```shell +# via `go run` +go run . -log-level=DEBUG +# via `docker run` +docker run -i -p 18080:18080 -t --rm mockserver -log-level=DEBUG +``` diff --git a/tests/mockserver/go.mod b/tests/mockserver/go.mod new file mode 100644 index 00000000..38b2d5e8 --- /dev/null +++ b/tests/mockserver/go.mod @@ -0,0 +1,15 @@ +module mockserver + +go 1.22 + +require ( + github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 + github.com/go-pkgz/expirable-cache/v3 v3.0.0 + github.com/gorilla/mux v1.8.1 +) + +require ( + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/stretchr/testify v1.9.0 // indirect +) diff --git a/tests/mockserver/go.sum b/tests/mockserver/go.sum new file mode 100644 index 00000000..fa86a5fc --- /dev/null +++ b/tests/mockserver/go.sum @@ -0,0 +1,16 @@ +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= +github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= +github.com/go-pkgz/expirable-cache/v3 v3.0.0 h1:u3/gcu3sabLYiTCevoRKv+WzjIn5oo7P8XtiXBeRDLw= +github.com/go-pkgz/expirable-cache/v3 v3.0.0/go.mod h1:2OQiDyEGQalYecLWmXprm3maPXeVb5/6/X7yRPYTzec= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tests/mockserver/internal/handler/assert/contenttype.go b/tests/mockserver/internal/handler/assert/contenttype.go new file mode 100644 index 00000000..42afbd06 --- /dev/null +++ b/tests/mockserver/internal/handler/assert/contenttype.go @@ -0,0 +1,99 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package assert + +import ( + "fmt" + "mime" + "net/http" + "strings" +) + +func ContentType(req *http.Request, expected string, isRequired bool) error { + got := req.Header.Get("Content-Type") + + if got == "" { + if isRequired { + return fmt.Errorf("expected Content-Type to be set, got: %s", got) + } + return nil + } + + mimeType, _, err := mime.ParseMediaType(got) + if err != nil { + return fmt.Errorf("got Content-Type %s is invalid: %w", got, err) + } + + expectedMimeType, _, err := mime.ParseMediaType(expected) + if err != nil { + return fmt.Errorf("expected Content-Type %s is invalid: %w", expected, err) + } + + if mimeType != expectedMimeType { + return fmt.Errorf( + "expected Content-Type to be %s, got: %s", + expected, + got, + ) + } + + return nil +} + +func AcceptHeader(req *http.Request, expectedValues []string) error { + if len(expectedValues) == 0 { + return nil + } + + gotAccept := req.Header.Get("Accept") + + gotValues := strings.Split(gotAccept, ",") + + for i, gotValue := range gotValues { + mimeType := strings.Split(strings.TrimSpace(gotValue), ";")[0] + + gotMimeType, _, err := mime.ParseMediaType(mimeType) + if err != nil { + return fmt.Errorf("got Accept value %s is invalid: %w", gotValue, err) + } + + gotValues[i] = gotMimeType + } + + allFound := true + + parsedExpectedValues := make([]string, len(expectedValues)) + + for i, expected := range expectedValues { + mimeType := strings.Split(expected, ";")[0] + + expectedMimeType, _, err := mime.ParseMediaType(mimeType) + if err != nil { + return fmt.Errorf("expected Accept value %s is invalid: %w", expected, err) + } + + parsedExpectedValues[i] = expectedMimeType + } + + for _, gotValue := range gotValues { + found := false + + for _, expected := range parsedExpectedValues { + if expected == gotValue { + found = true + break + } + } + + if !found { + allFound = false + break + } + } + + if !allFound { + return fmt.Errorf("expected Accept value to be one of %s, got: %s", strings.Join(parsedExpectedValues, ", "), gotAccept) + } + + return nil +} diff --git a/tests/mockserver/internal/handler/assert/header.go b/tests/mockserver/internal/handler/assert/header.go new file mode 100644 index 00000000..50f910d9 --- /dev/null +++ b/tests/mockserver/internal/handler/assert/header.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package assert + +import ( + "fmt" + "net/http" +) + +// HeaderExists generically verifies the given request header name exists with +// a single, non-empty value. If an unexpected value is found, it will return an +// error with a diagnostic text body and which should cause the handler to return +// immediately. +func HeaderExists(req *http.Request, name string) error { + values := req.Header.Values(name) + + if len(values) == 0 { + return fmt.Errorf("missing expected header %s", name) + } + + if len(values) > 1 { + return fmt.Errorf("expected single header for %s, got %d values", name, len(values)) + } + + got := values[0] + + if got == "" { + return fmt.Errorf("expected non-empty header %s", name) + } + + return nil +} + +// HeaderValues generically verifies the given request header name has the +// expected values. If an unexpected value is found, it will return an error +// with a diagnostic text body and which should cause the handler to return +// immediately. +func HeaderValues(req *http.Request, name string, expected []string) error { + got := req.Header.Values(name) + + if len(got) == 0 { + return fmt.Errorf( + "missing expected header %s which should be %v", + name, + expected, + ) + } + + if len(got) != len(expected) { + return fmt.Errorf( + "expected header %s to be %v, got: %v", + name, + expected, + got, + ) + } + + for index, expectedValue := range expected { + if got[index] != expectedValue { + return fmt.Errorf( + "expected header %s to be %v, got: %v", + name, + expected, + got, + ) + } + } + + return nil +} diff --git a/tests/mockserver/internal/handler/assert/parameter.go b/tests/mockserver/internal/handler/assert/parameter.go new file mode 100644 index 00000000..f8a5e45a --- /dev/null +++ b/tests/mockserver/internal/handler/assert/parameter.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package assert + +import ( + "fmt" + "net/http" + "net/url" +) + +// ParameterHeaderValues verifies the request header parameter key has the +// expected multiple values. If an unexpected value is found, it will return an +// error with a diagnostic text body and which should cause the handler to +// return immediately. +func ParameterHeaderValues(req *http.Request, key string, expected []string) error { + got := req.Header.Values(key) + + if len(got) == 0 { + return fmt.Errorf( + "missing expected header parameter %s which should be %v", + key, + expected, + ) + } + + if len(got) != len(expected) { + return fmt.Errorf( + "expected header parameter %s to be %s, got: %v", + key, + expected, + got, + ) + } + + for index, expectedValue := range expected { + if got[index] != expectedValue { + return fmt.Errorf( + "expected header parameter %s to be %v, got: %v", + key, + expected, + got, + ) + } + } + + return nil +} + +// ParameterPathValue verifies the request path parameter key has the expected +// value. If an unexpected value is found, it will return an error with +// a diagnostic text body and which should cause the handler to +// return immediately. +func ParameterPathValue(req *http.Request, key string, expected string) error { + got := req.PathValue(key) + + if got != expected { + return fmt.Errorf( + "expected path parameter %s to be %s, got: %s", + key, + expected, + got, + ) + } + + return nil +} + +// ParameterQueryValues verifies the request query parameter key has the +// expected multiple values. If an unexpected value is found, it will return an +// error with a diagnostic text body and which should cause the handler to +// return immediately. +func ParameterQueryValues(req *http.Request, key string, expected []string) error { + queryValues, err := url.ParseQuery(req.URL.RawQuery) + + if err != nil { + return fmt.Errorf("error parsing query parameters: %w", err) + } + + got, ok := queryValues[key] + + if !ok || len(got) == 0 { + return fmt.Errorf( + "missing expected query parameter %s which should be %v", + key, + expected, + ) + } + + if len(got) != len(expected) { + return fmt.Errorf( + "expected query parameter %s to be %s, got: %v", + key, + expected, + got, + ) + } + + for index, expectedValue := range expected { + if got[index] != expectedValue { + return fmt.Errorf( + "expected query parameter %s to be %v, got: %v", + key, + expected, + got, + ) + } + } + + return nil +} diff --git a/tests/mockserver/internal/handler/assert/pointer.go b/tests/mockserver/internal/handler/assert/pointer.go new file mode 100644 index 00000000..fa03e4c8 --- /dev/null +++ b/tests/mockserver/internal/handler/assert/pointer.go @@ -0,0 +1,12 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package assert + +// Pointer returns a pointer to the given value. +// +// This is intended to simplify inline builtin value expressions that are not +// implemented in the Go language specification, such as a hypothetical +// &"example". +func Pointer[T any](v T) *T { + return &v +} diff --git a/tests/mockserver/internal/handler/assert/security.go b/tests/mockserver/internal/handler/assert/security.go new file mode 100644 index 00000000..7d0a714a --- /dev/null +++ b/tests/mockserver/internal/handler/assert/security.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package assert + +import ( + "errors" + "fmt" + "net/http" + "strings" +) + +// SecurityAuthorizationHeader verifies the request security Authorization +// header is present and has the expected HTTP Authorization scheme with a value +// if required. If a missing value or multiple values are found, it will +// return an error with a diagnostic text body and which should cause the +// handler to return immediately. +func SecurityAuthorizationHeader(req *http.Request, optional bool, httpAuthorizationScheme string) error { + values := req.Header.Values("Authorization") + + if len(values) == 0 { + if optional { + return nil + } + + return errors.New("missing expected Authorization header") + } + + if len(values) > 1 { + return fmt.Errorf("expected single Authorization header, got %d values", len(values)) + } + + got := values[0] + + if got == "" { + // Should return error, even if optional, as that represents an errant + // client implementation. + return errors.New("expected non-empty Authorization header") + } + + if httpAuthorizationScheme != "" && !strings.HasPrefix(got, httpAuthorizationScheme+" ") { + return fmt.Errorf("expected HTTP Authorization scheme %s, got: %s", httpAuthorizationScheme, got) + } + + return nil +} + +// SecurityHeader verifies the request security header name is present and has +// a value if required. If a missing value or multiple values are found, it will +// return an error with a diagnostic text body and which should cause the +// handler to return immediately. +func SecurityHeader(req *http.Request, name string, optional bool) error { + values := req.Header.Values(name) + + if len(values) == 0 { + if optional { + return nil + } + + return fmt.Errorf("missing expected security header %s", name) + } + + if len(values) > 1 { + return fmt.Errorf("expected single security header for %s, got %d values", name, len(values)) + } + + got := values[0] + + if got == "" { + // Should return error, even if optional, as that represents an errant + // client implementation. + return fmt.Errorf("expected non-empty security header %s", name) + } + + return nil +} diff --git a/tests/mockserver/internal/handler/doc.go b/tests/mockserver/internal/handler/doc.go new file mode 100644 index 00000000..a4e60c89 --- /dev/null +++ b/tests/mockserver/internal/handler/doc.go @@ -0,0 +1,5 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +// Package handlers contains all generated HTTP handlers for the server. They +// are listed via the generated GeneratedHandlers() function. +package handler diff --git a/tests/mockserver/internal/handler/generated_handler.go b/tests/mockserver/internal/handler/generated_handler.go new file mode 100644 index 00000000..929558ef --- /dev/null +++ b/tests/mockserver/internal/handler/generated_handler.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "context" + "net/http" +) + +// GeneratedHandler is the type that encapsulates a generated handler. +type GeneratedHandler struct { + // HTTP request handler function. + handlerFunc http.HandlerFunc + + // HTTP method, such as GET. + Method string + + // URL path, such as /path. + Path string +} + +// NewGeneratedHandler creates a generated handler via method, path, and handler +// function. +func NewGeneratedHandler(ctx context.Context, method string, path string, handlerFunc http.HandlerFunc) *GeneratedHandler { + return &GeneratedHandler{ + handlerFunc: handlerFunc, + Method: method, + Path: path, + } +} + +// HandlerFunc returns the underlying HTTP handler function. +func (h GeneratedHandler) HandlerFunc() http.HandlerFunc { + return h.handlerFunc +} diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go new file mode 100644 index 00000000..7ad7aaa9 --- /dev/null +++ b/tests/mockserver/internal/handler/generated_handlers.go @@ -0,0 +1,100 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "context" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +// GeneratedHandlers returns all generated handlers. +func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) []*GeneratedHandler { + return []*GeneratedHandler{ + NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/agents/{agent_id}", pathGetRestAPIV1AgentsAgentID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/agents/{agent_id}/schemas", pathGetRestAPIV1AgentsAgentIDSchemas(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/governance/data/policies", pathGetRestAPIV1GovernanceDataPolicies(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/governance/data/policies/{id}", pathGetRestAPIV1GovernanceDataPoliciesID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/tools/list", pathGetRestAPIV1ToolsList(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/adddatasource", pathPostAPIIndexV1Adddatasource(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/betausers", pathPostAPIIndexV1Betausers(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/bulkindexdocuments", pathPostAPIIndexV1Bulkindexdocuments(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/bulkindexgroups", pathPostAPIIndexV1Bulkindexgroups(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/bulkindexmemberships", pathPostAPIIndexV1Bulkindexmemberships(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/bulkindexusers", pathPostAPIIndexV1Bulkindexusers(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/checkdocumentaccess", pathPostAPIIndexV1Checkdocumentaccess(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/deletedocument", pathPostAPIIndexV1Deletedocument(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/deletegroup", pathPostAPIIndexV1Deletegroup(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/deletemembership", pathPostAPIIndexV1Deletemembership(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/deleteuser", pathPostAPIIndexV1Deleteuser(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/getdatasourceconfig", pathPostAPIIndexV1Getdatasourceconfig(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/getdocumentcount", pathPostAPIIndexV1Getdocumentcount(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/getdocumentstatus", pathPostAPIIndexV1Getdocumentstatus(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/getusercount", pathPostAPIIndexV1Getusercount(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/indexdocument", pathPostAPIIndexV1Indexdocument(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/indexdocuments", pathPostAPIIndexV1Indexdocuments(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/indexgroup", pathPostAPIIndexV1Indexgroup(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/indexmembership", pathPostAPIIndexV1Indexmembership(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/indexuser", pathPostAPIIndexV1Indexuser(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/processalldocuments", pathPostAPIIndexV1Processalldocuments(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/processallemployeesandteams", pathPostAPIIndexV1Processallemployeesandteams(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/processallmemberships", pathPostAPIIndexV1Processallmemberships(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/rotatetoken", pathPostAPIIndexV1Rotatetoken(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/updatepermissions", pathPostAPIIndexV1Updatepermissions(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/activity", pathPostRestAPIV1Activity(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/addcollectionitems", pathPostRestAPIV1Addcollectionitems(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/addverificationreminder", pathPostRestAPIV1Addverificationreminder(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/adminsearch", pathPostRestAPIV1Adminsearch(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/autocomplete", pathPostRestAPIV1Autocomplete(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/chat", pathPostRestAPIV1Chat(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/createannouncement", pathPostRestAPIV1Createannouncement(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/createanswer", pathPostRestAPIV1Createanswer(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/createauthtoken", pathPostRestAPIV1Createauthtoken(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/createcollection", pathPostRestAPIV1Createcollection(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/createshortcut", pathPostRestAPIV1Createshortcut(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deleteallchats", pathPostRestAPIV1Deleteallchats(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deleteannouncement", pathPostRestAPIV1Deleteannouncement(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deleteanswer", pathPostRestAPIV1Deleteanswer(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deletechatfiles", pathPostRestAPIV1Deletechatfiles(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deletechats", pathPostRestAPIV1Deletechats(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deletecollection", pathPostRestAPIV1Deletecollection(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deletecollectionitem", pathPostRestAPIV1Deletecollectionitem(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/deleteshortcut", pathPostRestAPIV1Deleteshortcut(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/editanswer", pathPostRestAPIV1Editanswer(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/editcollection", pathPostRestAPIV1Editcollection(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/editcollectionitem", pathPostRestAPIV1Editcollectionitem(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/editpin", pathPostRestAPIV1Editpin(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/feed", pathPostRestAPIV1Feed(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/feedback", pathPostRestAPIV1Feedback(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getanswer", pathPostRestAPIV1Getanswer(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getchat", pathPostRestAPIV1Getchat(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getchatapplication", pathPostRestAPIV1Getchatapplication(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getchatfiles", pathPostRestAPIV1Getchatfiles(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getcollection", pathPostRestAPIV1Getcollection(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getdocpermissions", pathPostRestAPIV1Getdocpermissions(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getdocuments", pathPostRestAPIV1Getdocuments(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getdocumentsbyfacets", pathPostRestAPIV1Getdocumentsbyfacets(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getpin", pathPostRestAPIV1Getpin(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/getshortcut", pathPostRestAPIV1Getshortcut(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/insights", pathPostRestAPIV1Insights(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/listanswers", pathPostRestAPIV1Listanswers(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/listchats", pathPostRestAPIV1Listchats(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/listcollections", pathPostRestAPIV1Listcollections(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/listentities", pathPostRestAPIV1Listentities(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/listpins", pathPostRestAPIV1Listpins(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/listshortcuts", pathPostRestAPIV1Listshortcuts(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/listverifications", pathPostRestAPIV1Listverifications(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/messages", pathPostRestAPIV1Messages(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/people", pathPostRestAPIV1People(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/pin", pathPostRestAPIV1Pin(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/recommendations", pathPostRestAPIV1Recommendations(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/search", pathPostRestAPIV1Search(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/summarize", pathPostRestAPIV1Summarize(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/tools/call", pathPostRestAPIV1ToolsCall(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/unpin", pathPostRestAPIV1Unpin(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/updateannouncement", pathPostRestAPIV1Updateannouncement(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/updateshortcut", pathPostRestAPIV1Updateshortcut(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/verify", pathPostRestAPIV1Verify(dir, rt)), + } +} diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go new file mode 100644 index 00000000..41615362 --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentid.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetRestAPIV1AgentsAgentID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getAgent[0]": + dir.HandlerFunc("getAgent", testGetAgentGetAgent0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetAgentGetAgent0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.Agent = &components.Agent{ + AgentID: "", + Name: "", + Capabilities: components.AgentCapabilities{}, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go new file mode 100644 index 00000000..c10d567f --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetrestapiv1agentsagentidschemas.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetRestAPIV1AgentsAgentIDSchemas(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getAgentSchemas[0]": + dir.HandlerFunc("getAgentSchemas", testGetAgentSchemasGetAgentSchemas0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetAgentSchemasGetAgentSchemas0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.AgentSchemas = &components.AgentSchemas{ + AgentID: "", + InputSchema: components.InputSchema{}, + OutputSchema: components.OutputSchema{}, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go new file mode 100644 index 00000000..bbf888e6 --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapolicies.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetRestAPIV1GovernanceDataPolicies(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listpolicies[0]": + dir.HandlerFunc("listpolicies", testListpoliciesListpolicies0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListpoliciesListpolicies0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ListDlpReportsResponse = &components.ListDlpReportsResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go new file mode 100644 index 00000000..102ff17b --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetrestapiv1governancedatapoliciesid.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetRestAPIV1GovernanceDataPoliciesID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getpolicy[0]": + dir.HandlerFunc("getpolicy", testGetpolicyGetpolicy0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetpolicyGetpolicy0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetDlpReportResponse = &components.GetDlpReportResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go b/tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go new file mode 100644 index 00000000..163466cb --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetrestapiv1toolslist.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetRestAPIV1ToolsList(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "get_/rest/api/v1/tools/list[0]": + dir.HandlerFunc("get_/rest/api/v1/tools/list", testGetRestAPIV1ToolsListGetRestAPIV1ToolsList0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetRestAPIV1ToolsListGetRestAPIV1ToolsList0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ToolsListResponse = &components.ToolsListResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1adddatasource.go b/tests/mockserver/internal/handler/pathpostapiindexv1adddatasource.go new file mode 100644 index 00000000..34e56c05 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1adddatasource.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Adddatasource(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/adddatasource[0]": + dir.HandlerFunc("post_/api/index/v1/adddatasource", testPostAPIIndexV1AdddatasourcePostAPIIndexV1Adddatasource0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1AdddatasourcePostAPIIndexV1Adddatasource0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1betausers.go b/tests/mockserver/internal/handler/pathpostapiindexv1betausers.go new file mode 100644 index 00000000..3df89e08 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1betausers.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Betausers(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/betausers[0]": + dir.HandlerFunc("post_/api/index/v1/betausers", testPostAPIIndexV1BetausersPostAPIIndexV1Betausers0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1BetausersPostAPIIndexV1Betausers0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexdocuments.go b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexdocuments.go new file mode 100644 index 00000000..8801ff3b --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexdocuments.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Bulkindexdocuments(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/bulkindexdocuments[0]": + dir.HandlerFunc("post_/api/index/v1/bulkindexdocuments", testPostAPIIndexV1BulkindexdocumentsPostAPIIndexV1Bulkindexdocuments0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1BulkindexdocumentsPostAPIIndexV1Bulkindexdocuments0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexgroups.go b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexgroups.go new file mode 100644 index 00000000..8d3011e3 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexgroups.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Bulkindexgroups(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/bulkindexgroups[0]": + dir.HandlerFunc("post_/api/index/v1/bulkindexgroups", testPostAPIIndexV1BulkindexgroupsPostAPIIndexV1Bulkindexgroups0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1BulkindexgroupsPostAPIIndexV1Bulkindexgroups0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexmemberships.go b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexmemberships.go new file mode 100644 index 00000000..5ba85f74 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexmemberships.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Bulkindexmemberships(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/bulkindexmemberships[0]": + dir.HandlerFunc("post_/api/index/v1/bulkindexmemberships", testPostAPIIndexV1BulkindexmembershipsPostAPIIndexV1Bulkindexmemberships0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1BulkindexmembershipsPostAPIIndexV1Bulkindexmemberships0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexusers.go b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexusers.go new file mode 100644 index 00000000..7839fcf3 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1bulkindexusers.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Bulkindexusers(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/bulkindexusers[0]": + dir.HandlerFunc("post_/api/index/v1/bulkindexusers", testPostAPIIndexV1BulkindexusersPostAPIIndexV1Bulkindexusers0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1BulkindexusersPostAPIIndexV1Bulkindexusers0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go b/tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go new file mode 100644 index 00000000..694a298e --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1checkdocumentaccess.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Checkdocumentaccess(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/checkdocumentaccess[0]": + dir.HandlerFunc("post_/api/index/v1/checkdocumentaccess", testPostAPIIndexV1CheckdocumentaccessPostAPIIndexV1Checkdocumentaccess0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1CheckdocumentaccessPostAPIIndexV1Checkdocumentaccess0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.CheckDocumentAccessResponse = &components.CheckDocumentAccessResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1deletedocument.go b/tests/mockserver/internal/handler/pathpostapiindexv1deletedocument.go new file mode 100644 index 00000000..34beba46 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1deletedocument.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Deletedocument(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/deletedocument[0]": + dir.HandlerFunc("post_/api/index/v1/deletedocument", testPostAPIIndexV1DeletedocumentPostAPIIndexV1Deletedocument0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1DeletedocumentPostAPIIndexV1Deletedocument0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1deletegroup.go b/tests/mockserver/internal/handler/pathpostapiindexv1deletegroup.go new file mode 100644 index 00000000..b4ae2858 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1deletegroup.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Deletegroup(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/deletegroup[0]": + dir.HandlerFunc("post_/api/index/v1/deletegroup", testPostAPIIndexV1DeletegroupPostAPIIndexV1Deletegroup0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1DeletegroupPostAPIIndexV1Deletegroup0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1deletemembership.go b/tests/mockserver/internal/handler/pathpostapiindexv1deletemembership.go new file mode 100644 index 00000000..99968cf2 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1deletemembership.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Deletemembership(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/deletemembership[0]": + dir.HandlerFunc("post_/api/index/v1/deletemembership", testPostAPIIndexV1DeletemembershipPostAPIIndexV1Deletemembership0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1DeletemembershipPostAPIIndexV1Deletemembership0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1deleteuser.go b/tests/mockserver/internal/handler/pathpostapiindexv1deleteuser.go new file mode 100644 index 00000000..c8372237 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1deleteuser.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Deleteuser(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/deleteuser[0]": + dir.HandlerFunc("post_/api/index/v1/deleteuser", testPostAPIIndexV1DeleteuserPostAPIIndexV1Deleteuser0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1DeleteuserPostAPIIndexV1Deleteuser0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go b/tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go new file mode 100644 index 00000000..c7b4ab25 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getdatasourceconfig.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Getdatasourceconfig(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/getdatasourceconfig[0]": + dir.HandlerFunc("post_/api/index/v1/getdatasourceconfig", testPostAPIIndexV1GetdatasourceconfigPostAPIIndexV1Getdatasourceconfig0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1GetdatasourceconfigPostAPIIndexV1Getdatasourceconfig0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.CustomDatasourceConfig = &components.CustomDatasourceConfig{ + Name: "", + DatasourceCategory: components.DatasourceCategoryUncategorized.ToPointer(), + URLRegex: types.String("https://example-company.datasource.com/.*"), + Quicklinks: []components.Quicklink{ + components.Quicklink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + TrustURLRegexForViewActivity: types.Bool(true), + StripFragmentInCanonicalURL: types.Bool(true), + IsEntityDatasource: types.Bool(false), + IsTestDatasource: types.Bool(false), + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go new file mode 100644 index 00000000..dbc8be6a --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentcount.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Getdocumentcount(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/getdocumentcount[0]": + dir.HandlerFunc("post_/api/index/v1/getdocumentcount", testPostAPIIndexV1GetdocumentcountPostAPIIndexV1Getdocumentcount0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1GetdocumentcountPostAPIIndexV1Getdocumentcount0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetDocumentCountResponse = &components.GetDocumentCountResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go new file mode 100644 index 00000000..d7afbcdc --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getdocumentstatus.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Getdocumentstatus(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/getdocumentstatus[0]": + dir.HandlerFunc("post_/api/index/v1/getdocumentstatus", testPostAPIIndexV1GetdocumentstatusPostAPIIndexV1Getdocumentstatus0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1GetdocumentstatusPostAPIIndexV1Getdocumentstatus0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetDocumentStatusResponse = &components.GetDocumentStatusResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go b/tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go new file mode 100644 index 00000000..4fcb5e77 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1getusercount.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Getusercount(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/getusercount[0]": + dir.HandlerFunc("post_/api/index/v1/getusercount", testPostAPIIndexV1GetusercountPostAPIIndexV1Getusercount0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1GetusercountPostAPIIndexV1Getusercount0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetUserCountResponse = &components.GetUserCountResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1indexdocument.go b/tests/mockserver/internal/handler/pathpostapiindexv1indexdocument.go new file mode 100644 index 00000000..e6d4878c --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1indexdocument.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Indexdocument(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/indexdocument[0]": + dir.HandlerFunc("post_/api/index/v1/indexdocument", testPostAPIIndexV1IndexdocumentPostAPIIndexV1Indexdocument0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1IndexdocumentPostAPIIndexV1Indexdocument0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1indexdocuments.go b/tests/mockserver/internal/handler/pathpostapiindexv1indexdocuments.go new file mode 100644 index 00000000..d51b3b79 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1indexdocuments.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Indexdocuments(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/indexdocuments[0]": + dir.HandlerFunc("post_/api/index/v1/indexdocuments", testPostAPIIndexV1IndexdocumentsPostAPIIndexV1Indexdocuments0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1IndexdocumentsPostAPIIndexV1Indexdocuments0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1indexgroup.go b/tests/mockserver/internal/handler/pathpostapiindexv1indexgroup.go new file mode 100644 index 00000000..f95be6a8 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1indexgroup.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Indexgroup(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/indexgroup[0]": + dir.HandlerFunc("post_/api/index/v1/indexgroup", testPostAPIIndexV1IndexgroupPostAPIIndexV1Indexgroup0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1IndexgroupPostAPIIndexV1Indexgroup0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1indexmembership.go b/tests/mockserver/internal/handler/pathpostapiindexv1indexmembership.go new file mode 100644 index 00000000..237c6ab1 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1indexmembership.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Indexmembership(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/indexmembership[0]": + dir.HandlerFunc("post_/api/index/v1/indexmembership", testPostAPIIndexV1IndexmembershipPostAPIIndexV1Indexmembership0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1IndexmembershipPostAPIIndexV1Indexmembership0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1indexuser.go b/tests/mockserver/internal/handler/pathpostapiindexv1indexuser.go new file mode 100644 index 00000000..995587c3 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1indexuser.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Indexuser(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/indexuser[0]": + dir.HandlerFunc("post_/api/index/v1/indexuser", testPostAPIIndexV1IndexuserPostAPIIndexV1Indexuser0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1IndexuserPostAPIIndexV1Indexuser0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1processalldocuments.go b/tests/mockserver/internal/handler/pathpostapiindexv1processalldocuments.go new file mode 100644 index 00000000..11e34568 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1processalldocuments.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Processalldocuments(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/processalldocuments[0]": + dir.HandlerFunc("post_/api/index/v1/processalldocuments", testPostAPIIndexV1ProcessalldocumentsPostAPIIndexV1Processalldocuments0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1ProcessalldocumentsPostAPIIndexV1Processalldocuments0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", false); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1processallemployeesandteams.go b/tests/mockserver/internal/handler/pathpostapiindexv1processallemployeesandteams.go new file mode 100644 index 00000000..8bc7960b --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1processallemployeesandteams.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Processallemployeesandteams(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/processallemployeesandteams[0]": + dir.HandlerFunc("post_/api/index/v1/processallemployeesandteams", testPostAPIIndexV1ProcessallemployeesandteamsPostAPIIndexV1Processallemployeesandteams0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1ProcessallemployeesandteamsPostAPIIndexV1Processallemployeesandteams0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1processallmemberships.go b/tests/mockserver/internal/handler/pathpostapiindexv1processallmemberships.go new file mode 100644 index 00000000..dfe7762d --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1processallmemberships.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Processallmemberships(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/processallmemberships[0]": + dir.HandlerFunc("post_/api/index/v1/processallmemberships", testPostAPIIndexV1ProcessallmembershipsPostAPIIndexV1Processallmemberships0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1ProcessallmembershipsPostAPIIndexV1Processallmemberships0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", false); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go b/tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go new file mode 100644 index 00000000..23d1db7a --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1rotatetoken.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Rotatetoken(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/rotatetoken[0]": + dir.HandlerFunc("post_/api/index/v1/rotatetoken", testPostAPIIndexV1RotatetokenPostAPIIndexV1Rotatetoken0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1RotatetokenPostAPIIndexV1Rotatetoken0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.RotateTokenResponse = &components.RotateTokenResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiindexv1updatepermissions.go b/tests/mockserver/internal/handler/pathpostapiindexv1updatepermissions.go new file mode 100644 index 00000000..9bb5d576 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiindexv1updatepermissions.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIIndexV1Updatepermissions(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/api/index/v1/updatepermissions[0]": + dir.HandlerFunc("post_/api/index/v1/updatepermissions", testPostAPIIndexV1UpdatepermissionsPostAPIIndexV1Updatepermissions0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostAPIIndexV1UpdatepermissionsPostAPIIndexV1Updatepermissions0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1activity.go b/tests/mockserver/internal/handler/pathpostrestapiv1activity.go new file mode 100644 index 00000000..cf821af6 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1activity.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Activity(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "activity[0]": + dir.HandlerFunc("activity", testActivityActivity0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testActivityActivity0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go b/tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go new file mode 100644 index 00000000..dab5c26e --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1addcollectionitems.go @@ -0,0 +1,1517 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Addcollectionitems(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "addcollectionitems[0]": + dir.HandlerFunc("addcollectionitems", testAddcollectionitemsAddcollectionitems0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAddcollectionitemsAddcollectionitems0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.AddCollectionItemsResponse = &components.AddCollectionItemsResponse{ + Collection: &components.Collection{ + Name: "", + Description: "greedily indeed marten whereas rebel expansion", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 759858, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 976421, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 649696, + }, + components.Share{ + NumDaysAgo: 970396, + }, + components.Share{ + NumDaysAgo: 288210, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 489899, + }, + components.Reminder{ + RemindAt: 168446, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 390252, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 283321, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 869836, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 102608, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 289582, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 569138, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 978832, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 573370, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 542921, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 357599, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 477688, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go b/tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go new file mode 100644 index 00000000..8a13e8e1 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1addverificationreminder.go @@ -0,0 +1,761 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Addverificationreminder(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "addverificationreminder[0]": + dir.HandlerFunc("addverificationreminder", testAddverificationreminderAddverificationreminder0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAddverificationreminderAddverificationreminder0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.Verification = &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 310007, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 381872, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "ditch cruelly geez bah", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 922427, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 744290, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 857658, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + }, + }, + components.Collection{ + Name: "", + Description: "unfortunately brr brr whereas object if frantically randomize contrail silently", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 571806, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 991839, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 431849, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 121811, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go b/tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go new file mode 100644 index 00000000..be9f325e --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1adminsearch.go @@ -0,0 +1,163 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Adminsearch(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "adminsearch[0]": + dir.HandlerFunc("adminsearch", testAdminsearchAdminsearch0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAdminsearchAdminsearch0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.SearchResponse = &components.SearchResponse{ + TrackingToken: types.String("trackingToken"), + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://www.example.com/", + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + components.SearchResult{ + Title: types.String("title"), + URL: "https://www.example.com/", + Snippets: []components.SearchResultSnippet{}, + }, + }, + GleanDataError: &components.GleanDataError{ + ErrorMessages: []components.ErrorMessage{ + components.ErrorMessage{ + Source: types.String("gmail"), + ErrorMessage: types.String("invalid token"), + }, + components.ErrorMessage{ + Source: types.String("slack"), + ErrorMessage: types.String("expired token"), + }, + }, + }, + RequestID: types.String("5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100"), + FacetResults: []components.FacetResult{ + components.FacetResult{ + SourceName: types.String("sourceName"), + OperatorName: types.String("operatorName"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + }, + }, + components.FacetResult{ + SourceName: types.String("sourceName"), + OperatorName: types.String("operatorName"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + }, + }, + }, + RewrittenFacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("fieldName"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{}, + components.FacetFilterValue{}, + }, + }, + components.FacetFilter{ + FieldName: types.String("fieldName"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{}, + components.FacetFilterValue{}, + }, + }, + }, + HasMoreResults: types.Bool(true), + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go b/tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go new file mode 100644 index 00000000..f5022d6d --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1autocomplete.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Autocomplete(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "autocomplete[0]": + dir.HandlerFunc("autocomplete", testAutocompleteAutocomplete0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAutocompleteAutocomplete0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.AutocompleteResponse = &components.AutocompleteResponse{ + TrackingToken: types.String("trackingToken"), + Results: []components.AutocompleteResult{ + components.AutocompleteResult{ + Result: "sample result", + ResultType: components.AutocompleteResultResultTypeDocument.ToPointer(), + Score: types.Float64(4.56), + URL: types.String("https://www.example.com/"), + TrackingToken: types.String("abcd"), + }, + }, + BackendTimeMillis: types.Int64(1100), + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1chat.go b/tests/mockserver/internal/handler/pathpostrestapiv1chat.go new file mode 100644 index 00000000..24ba560b --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1chat.go @@ -0,0 +1,171 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Chat(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "chatStream-defaultExample[0]": + dir.HandlerFunc("chatStream", testChatStreamChatStreamDefaultExample0)(w, req) + case "chatStream-gptAgentExample[0]": + dir.HandlerFunc("chatStream", testChatStreamChatStreamGptAgentExample0)(w, req) + case "chatStream-streamingExample[0]": + dir.HandlerFunc("chatStream", testChatStreamChatStreamStreamingExample0)(w, req) + case "chatStream-updateResponse[0]": + dir.HandlerFunc("chatStream", testChatStreamChatStreamUpdateResponse0)(w, req) + case "chatStream-citationResponse[0]": + dir.HandlerFunc("chatStream", testChatStreamChatStreamCitationResponse0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testChatStreamChatStreamDefaultExample0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"text/plain"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + respBodyBytes := []byte("{\"messages\":[{\"author\":\"GLEAN_AI\",\"messageType\":\"CONTENT\",\"hasMoreFragments\":false,\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\"},\"fragments\":[{\"text\":\"There are no holidays!\"}]}]}") + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} + +func testChatStreamChatStreamGptAgentExample0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"text/plain"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + respBodyBytes := []byte("") + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} + +func testChatStreamChatStreamStreamingExample0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"text/plain"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + respBodyBytes := []byte("{\"messages\":[{\"author\":\"GLEAN_AI\",\"messageType\":\"CONTENT\",\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\",\"hasMoreFragments\":true},\"fragments\":null},{\"author\":\"GLEAN_AI\",\"messageType\":\"CONTENT\",\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\",\"hasMoreFragments\":true},\"fragments\":null},{\"author\":\"GLEAN_AI\",\"messageType\":\"CONTENT\",\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\",\"hasMoreFragments\":true},\"fragments\":[{\"text\":\"e are\"}]},{\"author\":\"GLEAN_AI\",\"messageType\":\"CONTENT\",\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\",\"hasMoreFragments\":true},\"fragments\":[{\"text\":\"no hol\"}]},{\"author\":\"GLEAN_AI\",\"messageType\":\"CONTENT\",\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\",\"hasMoreFragments\":false},\"fragments\":[{\"text\":\"idays!\"}]}]}") + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} + +func testChatStreamChatStreamUpdateResponse0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"text/plain"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + respBodyBytes := []byte("{\"messages\":[{\"author\":\"GLEAN_AI\",\"messageType\":\"UPDATE\",\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\"},\"fragments\":[{\"text\":\"**Reading:**\"},{\"structuredResults\":[{\"document\":{\"id\":\"123\",\"title\":\"Company Handbook\"}}]}]}]}") + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} + +func testChatStreamChatStreamCitationResponse0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"text/plain"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + respBodyBytes := []byte("{\"messages\":[{\"author\":\"GLEAN_AI\",\"messageType\":\"CONTENT\",\"agentConfig\":{\"agent\":\"DEFAULT\",\"mode\":\"DEFAULT\"},\"citations\":[{\"sourceDocument\":{\"id\":\"123\",\"title\":\"Company Handbook\",\"referenceRanges\":[{\"textRange\":{\"startIndex\":0,\"endIndex\":12,\"type\":\"CITATION\"}}]}}]}]}") + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go b/tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go new file mode 100644 index 00000000..50d77708 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createannouncement.go @@ -0,0 +1,2371 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Createannouncement(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "createannouncement[0]": + dir.HandlerFunc("createannouncement", testCreateannouncementCreateannouncement0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testCreateannouncementCreateannouncement0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.Announcement = &components.Announcement{ + Body: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 520049, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 800759, + }, + components.TextRange{ + StartIndex: 117747, + }, + components.TextRange{ + StartIndex: 589813, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 277321, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + MentionedPeople: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "sleet where schedule", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 108833, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 572012, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 616892, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + }, + }, + components.Collection{ + Name: "", + Description: "zowie nasalise punctually yippee", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 703146, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{ + Reactors: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 312813, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Share{ + NumDaysAgo: 903800, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 620608, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 188605, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 252418, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 874230, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DraftID: types.Int64(342), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 605172, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go b/tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go new file mode 100644 index 00000000..43a60a18 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createanswer.go @@ -0,0 +1,2065 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Createanswer(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "createanswer[0]": + dir.HandlerFunc("createanswer", testCreateanswerCreateanswer0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testCreateanswerCreateanswer0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.Answer = &components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 433224, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 995852, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "shadowy foodstuffs welcome via deeply writ amid", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 629063, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 338524, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 154150, + ItemType: components.CollectionItemItemTypeURL, + }, + components.CollectionItem{ + CollectionID: 739949, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 982866, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 749299, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 150565, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 572012, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 185076, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 616892, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 190973, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 665035, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 261757, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{ + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LikedByUser: true, + NumLikes: 453975, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 557925, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "massive under meh severe ditch bungalow when sauerkraut", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 404062, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 639388, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go b/tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go new file mode 100644 index 00000000..ab9263d4 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createauthtoken.go @@ -0,0 +1,65 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Createauthtoken(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "createauthtoken[0]": + dir.HandlerFunc("createauthtoken", testCreateauthtokenCreateauthtoken0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testCreateauthtokenCreateauthtoken0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.CreateAuthTokenResponse = &components.CreateAuthTokenResponse{ + Token: "", + ExpirationTime: 207213, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go new file mode 100644 index 00000000..4f0b0df3 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createcollection.go @@ -0,0 +1,1964 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Createcollection(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "createcollection[0]": + dir.HandlerFunc("createcollection", testCreatecollectionCreatecollection0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.CreateCollectionResponse = &components.CreateCollectionResponse{ + Name: "", + Description: "mentor early miserly stealthily without trick yahoo until planula", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 784768, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 913221, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "lobotomise apud overwork snuggle midst er how allocation", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 884414, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 312813, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 903800, + ItemType: components.CollectionItemItemTypeURL, + }, + }, + }, + components.Collection{ + Name: "", + Description: "given satisfy majority pace however crocodile yowza knowingly abaft", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 426375, + }, + components.Collection{ + Name: "", + Description: "failing white accompany whoever treasure", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 310702, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 446521, + }, + components.Share{ + NumDaysAgo: 909366, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 493315, + }, + components.Reminder{ + RemindAt: 778851, + }, + components.Reminder{ + RemindAt: 468734, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 307079, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 300662, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 488177, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 678847, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 48554, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 913385, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 816391, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "grade underachieve secret", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 772467, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 611865, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 488022, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "except solace fat whoa braid factorise apud generally out", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 560003, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeURL, + }, + }, + Children: []components.Collection{ + components.Collection{ + Name: "", + Description: "sweetly however whoever zowie wherever vivaciously", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 118148, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Collection{ + Name: "", + Description: "shinny ugh sheepishly mmm queasily factorize arrogantly", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 754554, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + }, + ErrorCode: components.CreateCollectionResponseErrorCodeConcurrentHierarchyEdit, + Collection: &components.Collection{ + Name: "", + Description: "adventurously given mean alienated geez than ack bah", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 958816, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go b/tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go new file mode 100644 index 00000000..1b2c9b91 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1createshortcut.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Createshortcut(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "createshortcut[0]": + dir.HandlerFunc("createshortcut", testCreateshortcutCreateshortcut0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testCreateshortcutCreateshortcut0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.CreateShortcutResponse = &components.CreateShortcutResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deleteallchats.go b/tests/mockserver/internal/handler/pathpostrestapiv1deleteallchats.go new file mode 100644 index 00000000..a8326202 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deleteallchats.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deleteallchats(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deleteallchats[0]": + dir.HandlerFunc("deleteallchats", testDeleteallchatsDeleteallchats0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeleteallchatsDeleteallchats0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deleteannouncement.go b/tests/mockserver/internal/handler/pathpostrestapiv1deleteannouncement.go new file mode 100644 index 00000000..8a58ed5c --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deleteannouncement.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deleteannouncement(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deleteannouncement[0]": + dir.HandlerFunc("deleteannouncement", testDeleteannouncementDeleteannouncement0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeleteannouncementDeleteannouncement0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deleteanswer.go b/tests/mockserver/internal/handler/pathpostrestapiv1deleteanswer.go new file mode 100644 index 00000000..0b853e55 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deleteanswer.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deleteanswer(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deleteanswer[0]": + dir.HandlerFunc("deleteanswer", testDeleteanswerDeleteanswer0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeleteanswerDeleteanswer0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deletechatfiles.go b/tests/mockserver/internal/handler/pathpostrestapiv1deletechatfiles.go new file mode 100644 index 00000000..9e26a1a0 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deletechatfiles.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deletechatfiles(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deletechatfiles[0]": + dir.HandlerFunc("deletechatfiles", testDeletechatfilesDeletechatfiles0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeletechatfilesDeletechatfiles0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deletechats.go b/tests/mockserver/internal/handler/pathpostrestapiv1deletechats.go new file mode 100644 index 00000000..d1b13693 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deletechats.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deletechats(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deletechats[0]": + dir.HandlerFunc("deletechats", testDeletechatsDeletechats0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeletechatsDeletechats0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deletecollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1deletecollection.go new file mode 100644 index 00000000..1089baf0 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deletecollection.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deletecollection(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deletecollection[0]": + dir.HandlerFunc("deletecollection", testDeletecollectionDeletecollection0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeletecollectionDeletecollection0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go b/tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go new file mode 100644 index 00000000..d97e781c --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deletecollectionitem.go @@ -0,0 +1,1847 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deletecollectionitem(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deletecollectionitem[0]": + dir.HandlerFunc("deletecollectionitem", testDeletecollectionitemDeletecollectionitem0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeletecollectionitemDeletecollectionitem0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.DeleteCollectionItemResponse = &components.DeleteCollectionItemResponse{ + Collection: &components.Collection{ + Name: "", + Description: "up nice seafood", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 735937, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 663050, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 934663, + }, + components.Share{ + NumDaysAgo: 307207, + }, + components.Share{ + NumDaysAgo: 246264, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 835281, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 239964, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 260387, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 784251, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 501323, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 220432, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 187266, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeURL, + }, + components.CollectionItem{ + CollectionID: 16069, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 696999, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1deleteshortcut.go b/tests/mockserver/internal/handler/pathpostrestapiv1deleteshortcut.go new file mode 100644 index 00000000..0c4dc328 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1deleteshortcut.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Deleteshortcut(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "deleteshortcut[0]": + dir.HandlerFunc("deleteshortcut", testDeleteshortcutDeleteshortcut0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testDeleteshortcutDeleteshortcut0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go b/tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go new file mode 100644 index 00000000..d84b2456 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editanswer.go @@ -0,0 +1,2231 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Editanswer(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "editanswer[0]": + dir.HandlerFunc("editanswer", testEditanswerEditanswer0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testEditanswerEditanswer0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.Answer = &components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 490266, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 949852, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "overwork scent er alert consequently brochure awful chilly scary", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 859594, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 359827, + ItemType: components.CollectionItemItemTypeText, + }, + }, + }, + components.Collection{ + Name: "", + Description: "below considering correctly poor instead", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 973585, + }, + components.Collection{ + Name: "", + Description: "brr pillbox exactly through scented drive etch", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 353341, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 119170, + }, + components.Share{ + NumDaysAgo: 28922, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 103434, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 57214, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 72991, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 900561, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 751237, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 488606, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{ + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LikedByUser: false, + NumLikes: 526808, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 945691, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "transparency lest while up yahoo towards fabricate motionless", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 882159, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 12186, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go new file mode 100644 index 00000000..c5dfa62d --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editcollection.go @@ -0,0 +1,1491 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Editcollection(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "editcollection[0]": + dir.HandlerFunc("editcollection", testEditcollectionEditcollection0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testEditcollectionEditcollection0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.EditCollectionResponse = &components.EditCollectionResponse{ + Name: "", + Description: "urgently voluntarily scale gut", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 643119, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 553539, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "exotic fussy shadowy", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 224552, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 774530, + ItemType: components.CollectionItemItemTypeDocument, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 115263, + }, + components.Share{ + NumDaysAgo: 925954, + }, + components.Share{ + NumDaysAgo: 538720, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 318637, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 219050, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 762098, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 595467, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 619716, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 22113, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "queasily down worthy generously than narrate pish off", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 567572, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Children: []components.Collection{ + components.Collection{ + Name: "", + Description: "since straight gadzooks pulp", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 89970, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + ErrorCode: components.EditCollectionResponseErrorCodeNameExists, + Collection: &components.Collection{ + Name: "", + Description: "ameliorate well political", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 151869, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go b/tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go new file mode 100644 index 00000000..186281db --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editcollectionitem.go @@ -0,0 +1,1134 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Editcollectionitem(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "editcollectionitem[0]": + dir.HandlerFunc("editcollectionitem", testEditcollectionitemEditcollectionitem0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testEditcollectionitemEditcollectionitem0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.EditCollectionItemResponse = &components.EditCollectionItemResponse{ + Collection: &components.Collection{ + Name: "", + Description: "where nasalise emphasize jealously appliance", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 927066, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 702646, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 600927, + }, + components.Share{ + NumDaysAgo: 753737, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 841463, + }, + components.Reminder{ + RemindAt: 402252, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 286790, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 519565, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 90490, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 304041, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 299381, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 992935, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 559534, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 788309, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 487486, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1editpin.go b/tests/mockserver/internal/handler/pathpostrestapiv1editpin.go new file mode 100644 index 00000000..e08ef257 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1editpin.go @@ -0,0 +1,406 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Editpin(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "editpin[0]": + dir.HandlerFunc("editpin", testEditpinEditpin0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testEditpinEditpin0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PinDocument = &components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 922296, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 47491, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "informal wrongly lest slime since pace into row", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 793957, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 841760, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 546659, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + }, + components.Collection{ + Name: "", + Description: "twine because unnaturally card gallery among agile duh pro athwart", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 201064, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 544237, + }, + components.Share{ + NumDaysAgo: 241956, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 448916, + }, + components.Reminder{ + RemindAt: 494003, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 29269, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1feed.go b/tests/mockserver/internal/handler/pathpostrestapiv1feed.go new file mode 100644 index 00000000..950ad3db --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1feed.go @@ -0,0 +1,2074 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Feed(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "feed[0]": + dir.HandlerFunc("feed", testFeedFeed0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testFeedFeed0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.FeedResponse = &components.FeedResponse{ + ServerTimestamp: 152670, + Results: []components.FeedResult{ + components.FeedResult{ + Category: components.FeedResultCategoryZeroStateWorkflowFavorites, + PrimaryEntry: components.FeedEntry{ + Title: "", + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Event: &components.CalendarEvent{ + ID: "", + URL: "https://cultivated-longboat.com", + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{ + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + GeneratedAttachments: []components.GeneratedAttachment{ + components.GeneratedAttachment{ + Documents: []components.Document{ + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Notes: types.String("CIO is interested in trying out the product."), + }, + ExternalLinks: []components.StructuredLink{ + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + Content: []components.GeneratedAttachmentContent{ + components.GeneratedAttachmentContent{ + DisplayHeader: types.String("Action Items"), + }, + }, + }, + }, + }, + Announcement: &components.Announcement{ + DraftID: types.Int64(342), + }, + Collection: &components.Collection{ + Name: "", + Description: "toward potentially zealous", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleOwner, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 455039, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 31514, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + ItemType: components.CollectionItemItemTypeText, + }, + components.CollectionItem{ + CollectionID: 698671, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + ItemType: components.CollectionItemItemTypeURL, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleViewer, + }, + }, + }, + CollectionItem: &components.CollectionItem{ + CollectionID: 250166, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "instead waft bah failing um under out", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 230306, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + PromptTemplate: &components.PromptTemplateResult{ + PromptTemplate: &components.PromptTemplate{ + Template: "", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + }, + }, + }, + Workflow: &components.WorkflowResult{ + Workflow: components.Workflow{ + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + Activities: []components.UserActivity{ + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + SecondaryEntries: []components.FeedEntry{ + components.FeedEntry{ + Title: "", + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Event: &components.CalendarEvent{ + ID: "", + URL: "https://partial-saw.com", + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{}, + }, + GeneratedAttachments: []components.GeneratedAttachment{ + components.GeneratedAttachment{ + Documents: []components.Document{ + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{}, + MergedCustomers: []components.Customer{}, + Notes: types.String("CIO is interested in trying out the product."), + }, + ExternalLinks: []components.StructuredLink{ + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + Content: []components.GeneratedAttachmentContent{ + components.GeneratedAttachmentContent{ + DisplayHeader: types.String("Action Items"), + }, + }, + }, + components.GeneratedAttachment{ + Documents: []components.Document{ + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{}, + MergedCustomers: []components.Customer{}, + Notes: types.String("CIO is interested in trying out the product."), + }, + ExternalLinks: []components.StructuredLink{ + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + Content: []components.GeneratedAttachmentContent{ + components.GeneratedAttachmentContent{ + DisplayHeader: types.String("Action Items"), + }, + }, + }, + }, + }, + Announcement: &components.Announcement{ + DraftID: types.Int64(342), + }, + Collection: &components.Collection{ + Name: "", + Description: "management polyester flustered dimly", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 301931, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + CollectionItem: &components.CollectionItem{ + CollectionID: 350031, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "deliquesce so where aw peninsula at standard brr failing owlishly", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 259619, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + ItemType: components.CollectionItemItemTypeCollection, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + PromptTemplate: &components.PromptTemplateResult{ + PromptTemplate: &components.PromptTemplate{ + Template: "", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + }, + }, + }, + Workflow: &components.WorkflowResult{ + Workflow: components.Workflow{ + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + Activities: []components.UserActivity{ + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + }, + }, + components.FeedResult{ + Category: components.FeedResultCategoryDisplayableList, + PrimaryEntry: components.FeedEntry{ + Title: "", + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Event: &components.CalendarEvent{ + ID: "", + URL: "https://qualified-plumber.info", + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{}, + }, + GeneratedAttachments: []components.GeneratedAttachment{ + components.GeneratedAttachment{ + Documents: []components.Document{ + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{}, + MergedCustomers: []components.Customer{}, + Notes: types.String("CIO is interested in trying out the product."), + }, + ExternalLinks: []components.StructuredLink{ + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + Content: []components.GeneratedAttachmentContent{ + components.GeneratedAttachmentContent{ + DisplayHeader: types.String("Action Items"), + }, + }, + }, + }, + }, + Announcement: &components.Announcement{ + DraftID: types.Int64(342), + }, + Collection: &components.Collection{ + Name: "", + Description: "grandiose yowza stale yet sinful mmm", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 659387, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + CollectionItem: &components.CollectionItem{ + CollectionID: 460790, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "since jubilantly meanwhile vestment muddy stiff", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 507793, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + ItemType: components.CollectionItemItemTypeText, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + PromptTemplate: &components.PromptTemplateResult{ + PromptTemplate: &components.PromptTemplate{ + Template: "", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleOwner, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + }, + }, + }, + Workflow: &components.WorkflowResult{ + Workflow: components.Workflow{ + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + Activities: []components.UserActivity{ + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + SecondaryEntries: []components.FeedEntry{ + components.FeedEntry{ + Title: "", + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Event: &components.CalendarEvent{ + ID: "", + URL: "https://utter-populist.net", + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{}, + }, + GeneratedAttachments: []components.GeneratedAttachment{ + components.GeneratedAttachment{ + Documents: []components.Document{ + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{}, + MergedCustomers: []components.Customer{}, + Notes: types.String("CIO is interested in trying out the product."), + }, + ExternalLinks: []components.StructuredLink{ + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + Content: []components.GeneratedAttachmentContent{ + components.GeneratedAttachmentContent{ + DisplayHeader: types.String("Action Items"), + }, + }, + }, + }, + }, + Announcement: &components.Announcement{ + DraftID: types.Int64(342), + }, + Collection: &components.Collection{ + Name: "", + Description: "verve however unhealthy delightfully formamide utter redress for finally", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 613860, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + CollectionItem: &components.CollectionItem{ + CollectionID: 938484, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "stoop dowse tensely duh atop which any", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 761068, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + ItemType: components.CollectionItemItemTypeURL, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + PromptTemplate: &components.PromptTemplateResult{ + PromptTemplate: &components.PromptTemplate{ + Template: "", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + }, + }, + }, + Workflow: &components.WorkflowResult{ + Workflow: components.Workflow{ + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + Activities: []components.UserActivity{ + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + components.FeedEntry{ + Title: "", + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Event: &components.CalendarEvent{ + ID: "", + URL: "https://babyish-quinoa.name/", + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{}, + }, + GeneratedAttachments: []components.GeneratedAttachment{ + components.GeneratedAttachment{ + Documents: []components.Document{ + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{}, + MergedCustomers: []components.Customer{}, + Notes: types.String("CIO is interested in trying out the product."), + }, + ExternalLinks: []components.StructuredLink{ + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + components.StructuredLink{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + Content: []components.GeneratedAttachmentContent{ + components.GeneratedAttachmentContent{ + DisplayHeader: types.String("Action Items"), + }, + }, + }, + }, + }, + Announcement: &components.Announcement{ + DraftID: types.Int64(342), + }, + Collection: &components.Collection{ + Name: "", + Description: "unearth grubby bathrobe instead brr soupy", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 591260, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + CollectionItem: &components.CollectionItem{ + CollectionID: 946419, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "awkwardly given whoever curiously around jump or", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 206282, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + ItemType: components.CollectionItemItemTypeText, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + PromptTemplate: &components.PromptTemplateResult{ + PromptTemplate: &components.PromptTemplate{ + Template: "", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleViewer, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleAnswerModerator, + }, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleViewer, + }, + }, + }, + }, + Workflow: &components.WorkflowResult{ + Workflow: components.Workflow{ + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + LastUpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + Activities: []components.UserActivity{ + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.UserActivity{ + Actor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + }, + }, + }, + FacetResults: map[string][]components.FacetResult{ + "key": []components.FacetResult{ + components.FacetResult{ + SourceName: types.String("container_name"), + OperatorName: types.String("SelectMultiple"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + HasMoreBuckets: types.Bool(false), + GroupName: types.String("Service Cloud"), + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1feedback.go b/tests/mockserver/internal/handler/pathpostrestapiv1feedback.go new file mode 100644 index 00000000..372a01f2 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1feedback.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Feedback(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "feedback[0]": + dir.HandlerFunc("feedback", testFeedbackFeedback0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testFeedbackFeedback0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", false); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go b/tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go new file mode 100644 index 00000000..a7e0758e --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getanswer.go @@ -0,0 +1,2650 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getanswer(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getanswer[0]": + dir.HandlerFunc("getanswer", testGetanswerGetanswer0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetanswerGetanswer0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetAnswerResponse = &components.GetAnswerResponse{ + AnswerResult: &components.AnswerResult{ + Answer: components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 521235, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 458049, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "carefully glorious scrabble ignite", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 159685, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 108980, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 644971, + ItemType: components.CollectionItemItemTypeURL, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 384844, + }, + components.Share{ + NumDaysAgo: 91052, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 656841, + }, + components.Reminder{ + RemindAt: 570980, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 607679, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 397483, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 455424, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 103111, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 392574, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 754054, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 710636, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 395188, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 547184, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{ + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LikedByUser: false, + NumLikes: 576892, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 258862, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "whether deflate book knotty er beneath nervously than", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 194354, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 831606, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + Error: &components.GetAnswerError{ + AnswerAuthor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go new file mode 100644 index 00000000..6e47d93c --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go @@ -0,0 +1,1202 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getchat(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getchat[0]": + dir.HandlerFunc("getchat", testGetchatGetchat0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetchatGetchat0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetChatResponse = &components.GetChatResponse{ + ChatResult: &components.ChatResult{ + Chat: &components.Chat{ + ID: types.String("string"), + CreateTime: types.Int64(0), + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdateTime: types.Int64(0), + Name: types.String("string"), + ApplicationID: types.String("string"), + ApplicationName: types.String("string"), + Icon: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + Messages: []components.ChatMessage{ + components.ChatMessage{ + AgentConfig: &components.AgentConfig{ + Agent: components.AgentEnumDefault.ToPointer(), + Mode: components.ModeDefault.ToPointer(), + }, + Author: components.AuthorUser.ToPointer(), + Citations: []components.ChatMessageCitation{ + components.ChatMessageCitation{ + TrackingToken: types.String("string"), + SourceDocument: &components.Document{ + ID: types.String("string"), + Datasource: types.String("string"), + ConnectorType: components.ConnectorTypeAPICrawl.ToPointer(), + DocType: types.String("string"), + Content: &components.DocumentContent{ + FullTextList: []string{ + "", + }, + }, + Title: types.String("string"), + URL: types.String("string"), + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + Sections: []components.DocumentSection{ + components.DocumentSection{ + Title: types.String(""), + URL: types.String("https://normal-making.name"), + }, + }, + }, + SourceFile: &components.ChatFile{ + ID: types.String("FILE_1234"), + URL: types.String("www.google.com"), + Name: types.String("sample.pdf"), + Metadata: &components.ChatFileMetadata{ + Status: components.ChatFileStatusProcessing.ToPointer(), + UploadTime: types.Int64(0), + ProcessedSize: types.Int64(0), + FailureReason: components.ChatFileFailureReasonParseFailed.ToPointer(), + MimeType: types.String("string"), + }, + }, + SourcePerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + ReferenceRanges: []components.ReferenceRange{ + components.ReferenceRange{ + TextRange: &components.TextRange{ + StartIndex: 969961, + EndIndex: types.Int64(458049), + Type: components.TextRangeTypeCitation.ToPointer(), + URL: types.String("https://earnest-tuber.info/"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "", + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 78888, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 219956, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 313464, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + UploadedFileIds: []string{ + "string", + }, + Fragments: []components.ChatMessageFragment{ + components.ChatMessageFragment{ + StructuredResults: []components.StructuredResult{ + components.StructuredResult{ + Document: &components.Document{ + ID: types.String(""), + Datasource: types.String(""), + ConnectorType: components.ConnectorTypeAPICrawl.ToPointer(), + DocType: types.String(""), + Title: types.String(""), + URL: types.String("https://strange-gloom.net"), + Metadata: &components.DocumentMetadata{ + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + MentionedPeople: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "scrabble ignite aw showboat shakily", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleEditor, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 843618, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 149108, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + ItemType: components.CollectionItemItemTypeURL, + }, + components.CollectionItem{ + CollectionID: 503671, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Role: components.UserRoleOwner, + }, + }, + }, + components.Collection{ + Name: "", + Description: "ah ack aha bah", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 72193, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Items: []components.CollectionItem{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{ + Reactors: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + components.Reaction{ + Reactors: []components.Person{}, + }, + components.Reaction{ + Reactors: []components.Person{}, + }, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 786783, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.Share{ + NumDaysAgo: 972276, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + RemindAt: 844917, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + RemindAt: 531548, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + RemindAt: 576892, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Sections: []components.DocumentSection{}, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Customer: &components.Customer{ + ID: "", + Domains: []string{}, + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + DocumentCounts: map[string]int64{ + "key": 534384, + "key1": 901064, + }, + Poc: []components.Person{}, + MergedCustomers: []components.Customer{}, + StartDate: types.MustNewDateFromString("2025-09-27"), + ContractAnnualRevenue: types.Float64(2187.45), + Notes: types.String(""), + }, + Team: &components.Team{ + ID: "", + Name: "", + Description: types.String("aw fibre hassle freezing but conversation under"), + BusinessUnit: types.String(""), + Department: types.String(""), + PhotoURL: types.String("https://sizzling-accountability.net/"), + BannerURL: types.String("https://miserable-hydrant.biz/"), + ExternalLink: types.String("https://hasty-cappelletti.name/"), + Members: []components.PersonToTeamRelationship{}, + MemberCount: types.Int64(626356), + Emails: []components.TeamEmail{}, + DatasourceProfiles: []components.DatasourceProfile{}, + Datasource: types.String(""), + CreatedFrom: types.String(""), + LastUpdatedAt: types.MustNewTimeFromString("2023-08-02T00:17:06.651Z"), + Status: components.TeamStatusQueuedForCreation.ToPointer(), + CanBeDeleted: types.Bool(false), + LoggingID: types.String(""), + }, + CustomEntity: &components.CustomEntity{ + ID: types.String(""), + Title: types.String(""), + Datasource: types.String(""), + ObjectType: types.String(""), + Roles: []components.UserRoleSpecification{}, + }, + Answer: &components.Answer{ + ID: 313992, + DocID: types.String(""), + Question: types.String(""), + QuestionVariations: []string{}, + BodyText: types.String(""), + BoardID: types.Int64(933583), + AudienceFilters: []components.FacetFilter{}, + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + Roles: []components.UserRoleSpecification{}, + SourceDocumentSpec: types.Pointer(components.CreateDocumentSpecUnionDocumentSpec1( + components.DocumentSpec1{}, + )), + SourceType: components.AnswerSourceTypeAssistant.ToPointer(), + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{}, + LikedByUser: false, + NumLikes: 30856, + }, + Author: &components.Person{ + Name: "", + ObfuscatedID: "", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{}, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + Results: []components.SearchResult{}, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + Results: []components.SearchResult{}, + }, + }, + Metadata: &components.PersonMetadata{ + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + }, + }, + CreateTime: types.MustNewTimeFromString("2024-01-11T09:24:54.882Z"), + UpdateTime: types.MustNewTimeFromString("2024-10-30T08:25:44.878Z"), + UpdatedBy: &components.Person{ + Name: "", + ObfuscatedID: "", + RelatedDocuments: []components.RelatedDocuments{}, + Metadata: &components.PersonMetadata{ + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + Reminders: []components.Reminder{}, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + RemindAt: 306618, + }, + CandidateVerifiers: []components.Person{}, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "indolent vainly closely", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 601522, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + Roles: []components.UserRoleSpecification{}, + }, + Collections: []components.Collection{}, + DocumentCategory: types.String(""), + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + ExtractedQnA: &components.ExtractedQnA{ + Heading: types.String(""), + Question: types.String(""), + QuestionResult: &components.SearchResult{ + StructuredResults: []components.StructuredResult{}, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "name", + ObfuscatedID: "", + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + URL: "https://gorgeous-custom.org/", + Snippets: []components.SearchResultSnippet{}, + RelatedResults: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + Results: []components.SearchResult{}, + }, + }, + AllClusteredResults: []components.ClusterGroup{ + components.ClusterGroup{ + ClusteredResults: []components.SearchResult{}, + VisibleCountHint: 564329, + }, + }, + MustIncludeSuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + Pins: []components.PinDocument{}, + }, + }, + Meeting: &components.Meeting{ + ID: types.String(""), + Title: types.String(""), + Description: types.String("inside dulcimer however sonnet um eek until geez phew"), + StartTime: types.MustNewTimeFromString("2025-10-27T12:29:37.632Z"), + EndTime: types.MustNewTimeFromString("2024-03-28T07:14:42.093Z"), + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{ + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + GroupAttendees: []components.CalendarAttendee{}, + }, + }, + }, + }, + App: &components.AppResult{ + Datasource: "", + DocType: types.String(""), + MimeType: types.String(""), + IconURL: types.String("https://bustling-birdbath.org"), + }, + Collection: &components.Collection{ + Name: "", + Description: "unless yuck serenade cuddly rundown neighboring considering upliftingly why", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{}, + Icon: types.String(""), + AdminLocked: types.Bool(false), + ParentID: types.Int64(896826), + AllowedDatasource: types.String(""), + ID: 67110, + CreateTime: types.MustNewTimeFromString("2024-07-30T13:34:32.569Z"), + UpdateTime: types.MustNewTimeFromString("2023-04-24T03:06:17.109Z"), + Creator: &components.Person{ + Name: "", + ObfuscatedID: "", + RelatedDocuments: []components.RelatedDocuments{}, + Metadata: &components.PersonMetadata{ + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + }, + }, + UpdatedBy: &components.Person{ + Name: "", + ObfuscatedID: "", + RelatedDocuments: []components.RelatedDocuments{}, + Metadata: &components.PersonMetadata{ + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + }, + }, + ItemCount: types.Int64(534236), + ChildCount: types.Int64(215291), + Items: []components.CollectionItem{}, + Shortcuts: []string{}, + Children: []components.Collection{}, + Roles: []components.UserRoleSpecification{}, + }, + AnswerBoard: &components.AnswerBoard{ + Name: "", + Description: "innocent downchange ick rudely what youthfully lightly yum", + AddedRoles: []components.UserRoleSpecification{}, + RemovedRoles: []components.UserRoleSpecification{}, + AudienceFilters: []components.FacetFilter{}, + ID: 569914, + CreateTime: types.MustNewTimeFromString("2023-02-12T07:51:20.736Z"), + UpdateTime: types.MustNewTimeFromString("2024-03-18T02:09:52.587Z"), + Creator: &components.Person{ + Name: "", + ObfuscatedID: "", + RelatedDocuments: []components.RelatedDocuments{}, + Metadata: &components.PersonMetadata{ + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + }, + }, + UpdatedBy: &components.Person{ + Name: "", + ObfuscatedID: "", + RelatedDocuments: []components.RelatedDocuments{}, + Metadata: &components.PersonMetadata{ + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + }, + }, + ItemCount: types.Int64(771154), + Roles: []components.UserRoleSpecification{}, + }, + Code: &components.Code{ + RepoName: types.String("scio"), + FileName: types.String("README.md"), + }, + Shortcut: &components.Shortcut{ + InputAlias: "", + DestinationURL: types.String("https://tight-version.org/"), + Description: types.String("however generally ew ha sonar usually slow guacamole"), + Unlisted: types.Bool(false), + URLTemplate: types.String(""), + CreatedBy: &components.Person{}, + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdatedBy: &components.Person{}, + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{}, + Person: &components.Person{ + Name: "", + ObfuscatedID: "", + RelatedDocuments: []components.RelatedDocuments{}, + Metadata: &components.PersonMetadata{ + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + }, + }, + }, + RelatedDocuments: []components.RelatedDocuments{}, + RelatedQuestion: &components.RelatedQuestion{ + Question: types.String(""), + Answer: types.String(""), + Ranges: []components.TextRange{}, + }, + Disambiguation: &components.Disambiguation{ + Name: types.String(""), + ID: types.String(""), + Type: components.EntityTypePerson.ToPointer(), + }, + Snippets: []components.SearchResultSnippet{}, + TrackingToken: types.String("string"), + Prominence: components.ProminenceHero.ToPointer(), + Source: components.StructuredResultSourceExpertDetection.ToPointer(), + }, + }, + TrackingToken: types.String("string"), + Text: types.String("string"), + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + File: &components.ChatFile{ + ID: types.String("FILE_1234"), + URL: types.String("www.google.com"), + Name: types.String("sample.pdf"), + Metadata: &components.ChatFileMetadata{ + Status: components.ChatFileStatusProcessing.ToPointer(), + UploadTime: types.Int64(0), + ProcessedSize: types.Int64(0), + FailureReason: components.ChatFileFailureReasonParseFailed.ToPointer(), + MimeType: types.String("string"), + }, + }, + Action: &components.ToolInfo{ + Metadata: &components.ToolMetadata{ + Type: components.ToolMetadataTypeRetrieval, + Name: "string", + DisplayName: "string", + ToolID: types.String("string"), + DisplayDescription: "string", + LogoURL: types.String("string"), + ObjectName: types.String("[\"HR ticket\",\"Email\",\"Chat message\"]"), + KnowledgeType: components.KnowledgeTypeNeutralKnowledge.ToPointer(), + CreatedBy: &components.PersonObject{ + Name: "", + ObfuscatedID: "", + }, + LastUpdatedBy: &components.PersonObject{ + Name: "", + ObfuscatedID: "", + }, + CreatedAt: types.MustNewTimeFromString("2019-08-24T14:15:22Z"), + LastUpdatedAt: types.MustNewTimeFromString("2019-08-24T14:15:22Z"), + WriteActionType: components.WriteActionTypeRedirect.ToPointer(), + AuthType: components.AuthTypeNone.ToPointer(), + Auth: &components.AuthConfig{ + IsOnPrem: types.Bool(true), + UsesCentralAuth: types.Bool(false), + Type: components.AuthConfigTypeDwd.ToPointer(), + GrantType: components.GrantTypeAuthCode.ToPointer(), + Status: components.AuthConfigStatusAuthorized.ToPointer(), + ClientURL: types.String("https://woeful-trench.com/"), + Scopes: []string{}, + Audiences: []string{}, + AuthorizationURL: types.String("https://imaginative-premium.com/"), + LastAuthorizedAt: types.MustNewTimeFromString("2023-12-19T20:03:14.149Z"), + }, + Permissions: &components.ObjectPermissions{}, + UsageInstructions: types.String("string"), + IsSetupFinished: types.Bool(true), + }, + Parameters: map[string]components.WriteActionParameter{ + "property1": components.WriteActionParameter{ + Type: components.WriteActionParameterTypeUnknown.ToPointer(), + DisplayName: types.String("Shemar63"), + Value: types.String(""), + IsRequired: types.Bool(true), + Description: types.String("handle unlike unlike fen gently or exotic mortally nor"), + PossibleValues: []components.PossibleValue{}, + }, + "property2": components.WriteActionParameter{ + Type: components.WriteActionParameterTypeString.ToPointer(), + DisplayName: types.String("Ahmad_Reichel95"), + Value: types.String(""), + IsRequired: types.Bool(false), + Description: types.String("mmm premise pro instead bleakly starch including per ill-fated"), + PossibleValues: []components.PossibleValue{}, + }, + }, + }, + }, + }, + Ts: types.String("string"), + MessageID: types.String("string"), + MessageTrackingToken: types.String("string"), + MessageType: components.MessageTypeUpdate.ToPointer(), + HasMoreFragments: types.Bool(true), + }, + }, + }, + TrackingToken: types.String("string"), + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go new file mode 100644 index 00000000..c7983c60 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getchatapplication(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getchatapplication[0]": + dir.HandlerFunc("getchatapplication", testGetchatapplicationGetchatapplication0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetchatapplicationGetchatapplication0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetChatApplicationResponse = &components.GetChatApplicationResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go new file mode 100644 index 00000000..73feb6db --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchatfiles.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getchatfiles(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getchatfiles[0]": + dir.HandlerFunc("getchatfiles", testGetchatfilesGetchatfiles0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetchatfilesGetchatfiles0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetChatFilesResponse = &components.GetChatFilesResponse{ + Files: map[string]components.ChatFile{ + "key": components.ChatFile{ + ID: types.String("FILE_1234"), + URL: types.String("www.google.com"), + Name: types.String("sample.pdf"), + }, + "key1": components.ChatFile{ + ID: types.String("FILE_1234"), + URL: types.String("www.google.com"), + Name: types.String("sample.pdf"), + }, + "key2": components.ChatFile{ + ID: types.String("FILE_1234"), + URL: types.String("www.google.com"), + Name: types.String("sample.pdf"), + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go b/tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go new file mode 100644 index 00000000..d0aa8100 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getcollection.go @@ -0,0 +1,1335 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getcollection(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getcollection[0]": + dir.HandlerFunc("getcollection", testGetcollectionGetcollection0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetcollectionGetcollection0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetCollectionResponse = &components.GetCollectionResponse{ + Collection: &components.Collection{ + Name: "", + Description: "for carefully glorious scrabble ignite aw showboat", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 607679, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 397483, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 392574, + }, + components.Share{ + NumDaysAgo: 908293, + }, + components.Share{ + NumDaysAgo: 754054, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 149108, + }, + components.Reminder{ + RemindAt: 741131, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 503671, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 486669, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 81373, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 165215, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 666980, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 25042, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 168726, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 491026, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 844917, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeURL, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + }, + RootCollection: &components.Collection{ + Name: "", + Description: "aw fibre hassle freezing but conversation under", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 22258, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go b/tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go new file mode 100644 index 00000000..3d7e842f --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getdocpermissions.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getdocpermissions(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getdocpermissions[0]": + dir.HandlerFunc("getdocpermissions", testGetdocpermissionsGetdocpermissions0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetdocpermissionsGetdocpermissions0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetDocPermissionsResponse = &components.GetDocPermissionsResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go b/tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go new file mode 100644 index 00000000..453834ab --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getdocuments.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getdocuments(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getdocuments[0]": + dir.HandlerFunc("getdocuments", testGetdocumentsGetdocuments0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetdocumentsGetdocuments0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", false); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetDocumentsResponse = &components.GetDocumentsResponse{ + Documents: map[string]components.DocumentOrErrorUnion{ + "key": components.CreateDocumentOrErrorUnionDocument( + components.Document{}, + ), + "key1": components.CreateDocumentOrErrorUnionDocument( + components.Document{}, + ), + "key2": components.CreateDocumentOrErrorUnionDocument( + components.Document{}, + ), + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go b/tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go new file mode 100644 index 00000000..2548de24 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getdocumentsbyfacets.go @@ -0,0 +1,1341 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getdocumentsbyfacets(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getdocumentsbyfacets[0]": + dir.HandlerFunc("getdocumentsbyfacets", testGetdocumentsbyfacetsGetdocumentsbyfacets0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetdocumentsbyfacetsGetdocumentsbyfacets0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", false); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetDocumentsByFacetsResponse = &components.GetDocumentsByFacetsResponse{ + Documents: []components.Document{ + components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 847689, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 244762, + }, + components.TextRange{ + StartIndex: 577503, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 946448, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + MentionedPeople: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "since unlike huzzah chunder ignite loftily bar circa flame", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 327937, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 69838, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 996681, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeText, + }, + components.CollectionItem{ + CollectionID: 480101, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{ + Reactors: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 414155, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 818513, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 511688, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getpin.go b/tests/mockserver/internal/handler/pathpostrestapiv1getpin.go new file mode 100644 index 00000000..d99e95ec --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getpin.go @@ -0,0 +1,605 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getpin(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getpin[0]": + dir.HandlerFunc("getpin", testGetpinGetpin0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetpinGetpin0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetPinResponse = &components.GetPinResponse{ + Pin: &components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 544221, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 969961, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "extract neaten qua meanwhile bah", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 808481, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 656841, + ItemType: components.CollectionItemItemTypeURL, + }, + components.CollectionItem{ + CollectionID: 607679, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + }, + components.Collection{ + Name: "", + Description: "once out effector determined backburn weary", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 547184, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 31446, + }, + components.Share{ + NumDaysAgo: 339847, + }, + components.Share{ + NumDaysAgo: 844917, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 845806, + }, + components.Reminder{ + RemindAt: 350813, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 534384, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 913207, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 533795, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 949290, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 716267, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go b/tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go new file mode 100644 index 00000000..97cd66fe --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getshortcut.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Getshortcut(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "getshortcut[0]": + dir.HandlerFunc("getshortcut", testGetshortcutGetshortcut0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetshortcutGetshortcut0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetShortcutResponse = &components.GetShortcutResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1insights.go b/tests/mockserver/internal/handler/pathpostrestapiv1insights.go new file mode 100644 index 00000000..6f0e3cea --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1insights.go @@ -0,0 +1,5262 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Insights(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "insights[0]": + dir.HandlerFunc("insights", testInsightsInsights0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testInsightsInsights0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.InsightsResponse = &components.InsightsResponse{ + Users: &components.UserInsightsResponse{ + ActivityInsights: []components.UserActivityInsight{ + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 450824, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 213457, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "yahoo disapprove glum ugh roundabout middle ha rise readily", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 237994, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 256758, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 783459, + ItemType: components.CollectionItemItemTypeURL, + }, + components.CollectionItem{ + CollectionID: 188420, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + }, + }, + components.Collection{ + Name: "", + Description: "bell unabashedly unwilling disk", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 698722, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 365275, + }, + components.Share{ + NumDaysAgo: 790898, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 856562, + }, + components.Reminder{ + RemindAt: 328633, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 287673, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 140875, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 210313, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumSearch, + }, + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumAll, + }, + }, + InactiveInsights: []components.UserActivityInsight{ + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumSearch, + }, + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumSearch, + }, + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumAll, + }, + }, + }, + Content: &components.ContentInsightsResponse{ + DocumentInsights: []components.DocumentInsight{ + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 783566, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 519998, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 500839, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + Collections: &components.ContentInsightsResponse{ + DocumentInsights: []components.DocumentInsight{ + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 609810, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 413854, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 150399, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + CollectionsV2: &components.ContentInsightsResponse{ + DocumentInsights: []components.DocumentInsight{ + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 148964, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 541220, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 222075, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + Announcements: &components.ContentInsightsResponse{ + DocumentInsights: []components.DocumentInsight{ + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 15843, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + Answers: &components.ContentInsightsResponse{ + DocumentInsights: []components.DocumentInsight{ + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 39567, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 892341, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.DocumentInsight{ + Document: components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 486092, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + Ai: &components.AiInsightsResponse{ + AssistantInsights: []components.UserActivityInsight{ + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumSearch, + }, + }, + }, + AiApps: &components.AiAppsInsightsResponse{ + AiAppInsights: []components.UserActivityInsight{ + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumSearch, + }, + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumAll, + }, + }, + }, + GleanAssist: &components.GleanAssistInsightsResponse{ + ActivityInsights: []components.UserActivityInsight{ + components.UserActivityInsight{ + User: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Activity: components.ActivityEnumSearch, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go b/tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go new file mode 100644 index 00000000..6380017d --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listanswers.go @@ -0,0 +1,3497 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Listanswers(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listanswers[0]": + dir.HandlerFunc("listanswers", testListanswersListanswers0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListanswersListanswers0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ListAnswersResponse = &components.ListAnswersResponse{ + AnswerResults: []components.AnswerResult{ + components.AnswerResult{ + Answer: components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 229716, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 635532, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "avalanche jungle unto meanwhile beside tromp worth reluctantly", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 781409, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 66993, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 294083, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 678179, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 810770, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 956959, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 948614, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 20615, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 370293, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{}, + LikedByUser: false, + NumLikes: 50388, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 487446, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "boo massive sorrowful aw strict behind along energetic oddball", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 472871, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 367314, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + components.AnswerResult{ + Answer: components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{}, + LikedByUser: false, + NumLikes: 233358, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 536405, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "likely up questionably forgery glow warmhearted", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 674469, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 359708, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + components.AnswerResult{ + Answer: components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{}, + LikedByUser: true, + NumLikes: 80289, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 327973, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "freely overcook till boo ack", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 477827, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 238432, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listchats.go b/tests/mockserver/internal/handler/pathpostrestapiv1listchats.go new file mode 100644 index 00000000..2b3865dc --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listchats.go @@ -0,0 +1,626 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Listchats(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listchats[0]": + dir.HandlerFunc("listchats", testListchatsListchats0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListchatsListchats0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ListChatsResponse = &components.ListChatsResponse{ + ChatResults: []components.ChatMetadataResult{ + components.ChatMetadataResult{ + Chat: &components.ChatMetadata{ + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 177706, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 152837, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "accountability pish likewise", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleAnswerModerator, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 425334, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 480616, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 523875, + ItemType: components.CollectionItemItemTypeCollection, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + }, + }, + components.Collection{ + Name: "", + Description: "safely briefly ugh fen", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 96709, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 5229, + }, + components.Share{ + NumDaysAgo: 810770, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 505778, + }, + components.Reminder{ + RemindAt: 948614, + }, + components.Reminder{ + RemindAt: 900109, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 20615, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 726700, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Icon: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + components.ChatMetadataResult{ + Chat: &components.ChatMetadata{ + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Icon: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + components.ChatMetadataResult{ + Chat: &components.ChatMetadata{ + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Icon: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go b/tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go new file mode 100644 index 00000000..04b48fcf --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listcollections.go @@ -0,0 +1,1907 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Listcollections(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listcollections[0]": + dir.HandlerFunc("listcollections", testListcollectionsListcollections0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListcollectionsListcollections0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ListCollectionsResponse = &components.ListCollectionsResponse{ + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "yuck accountability pish likewise excepting unimpressively quickly", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 692918, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 838930, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 164965, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 777245, + }, + components.Reminder{ + RemindAt: 141764, + }, + components.Reminder{ + RemindAt: 664080, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 284580, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 544651, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastReminder: &components.Reminder{ + RemindAt: 60868, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 993305, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 258945, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 29267, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 408066, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 370293, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 900911, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 462343, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + }, + components.Collection{ + Name: "", + Description: "massive sorrowful aw", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 314888, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Collection{ + Name: "", + Description: "merrily wherever failing orchestrate lest", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 895039, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listentities.go b/tests/mockserver/internal/handler/pathpostrestapiv1listentities.go new file mode 100644 index 00000000..37ad6f80 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listentities.go @@ -0,0 +1,709 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Listentities(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listentities[0]": + dir.HandlerFunc("listentities", testListentitiesListentities0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListentitiesListentities0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ListEntitiesResponse = &components.ListEntitiesResponse{ + Results: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + TeamResults: []components.Team{ + components.Team{ + ID: "", + Name: "", + Members: []components.PersonToTeamRelationship{ + components.PersonToTeamRelationship{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 229716, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 635532, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "avalanche jungle unto meanwhile beside tromp worth reluctantly", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 294083, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 747562, + ItemType: components.CollectionItemItemTypeText, + }, + components.CollectionItem{ + CollectionID: 324206, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 678179, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Role: components.UserRoleAnswerModerator, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 20615, + }, + components.Share{ + NumDaysAgo: 467775, + }, + components.Share{ + NumDaysAgo: 993677, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 406555, + }, + components.Reminder{ + RemindAt: 29267, + }, + components.Reminder{ + RemindAt: 652326, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 688784, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 41398, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 329360, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Relationship: components.PersonToTeamRelationshipRelationshipMember.ToPointer(), + }, + components.PersonToTeamRelationship{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Relationship: components.PersonToTeamRelationshipRelationshipMember.ToPointer(), + }, + }, + DatasourceProfiles: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + Status: components.TeamStatusProcessed.ToPointer(), + CanBeDeleted: types.Bool(true), + }, + components.Team{ + ID: "", + Name: "", + DatasourceProfiles: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + Status: components.TeamStatusProcessed.ToPointer(), + CanBeDeleted: types.Bool(true), + }, + components.Team{ + ID: "", + Name: "", + DatasourceProfiles: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + Status: components.TeamStatusProcessed.ToPointer(), + CanBeDeleted: types.Bool(true), + }, + }, + CustomEntityResults: []components.CustomEntity{ + components.CustomEntity{}, + components.CustomEntity{}, + }, + FacetResults: []components.FacetResult{ + components.FacetResult{ + SourceName: types.String("container_name"), + OperatorName: types.String("SelectMultiple"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + HasMoreBuckets: types.Bool(false), + GroupName: types.String("Service Cloud"), + }, + components.FacetResult{ + SourceName: types.String("container_name"), + OperatorName: types.String("SelectMultiple"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + HasMoreBuckets: types.Bool(false), + GroupName: types.String("Service Cloud"), + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listpins.go b/tests/mockserver/internal/handler/pathpostrestapiv1listpins.go new file mode 100644 index 00000000..7bb86559 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listpins.go @@ -0,0 +1,692 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Listpins(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listpins[0]": + dir.HandlerFunc("listpins", testListpinsListpins0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListpinsListpins0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ListPinsResponse = &components.ListPinsResponse{ + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 177706, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 152837, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "bah since zowie loudly aha although gosh whenever", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 544651, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 60868, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + }, + }, + components.Collection{ + Name: "", + Description: "via during someplace woot excepting gah only despite", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 933854, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 500063, + }, + components.Share{ + NumDaysAgo: 206163, + }, + components.Share{ + NumDaysAgo: 310383, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 838038, + }, + components.Reminder{ + RemindAt: 517221, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 774578, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 213989, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go b/tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go new file mode 100644 index 00000000..29fd4d6a --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listshortcuts.go @@ -0,0 +1,153 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Listshortcuts(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listshortcuts[0]": + dir.HandlerFunc("listshortcuts", testListshortcutsListshortcuts0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListshortcutsListshortcuts0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ListShortcutsPaginatedResponse = &components.ListShortcutsPaginatedResponse{ + Shortcuts: []components.Shortcut{ + components.Shortcut{ + InputAlias: "", + DestinationURL: types.String("https://remorseful-concentration.biz"), + CreatedBy: &components.Person{}, + }, + components.Shortcut{ + InputAlias: "", + DestinationURL: types.String("https://primary-paintwork.com/"), + CreatedBy: &components.Person{}, + }, + components.Shortcut{ + InputAlias: "", + DestinationURL: types.String("https://breakable-bathrobe.net"), + CreatedBy: &components.Person{}, + }, + }, + FacetResults: []components.FacetResult{ + components.FacetResult{ + SourceName: types.String("container_name"), + OperatorName: types.String("SelectMultiple"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + HasMoreBuckets: types.Bool(false), + GroupName: types.String("Service Cloud"), + }, + components.FacetResult{ + SourceName: types.String("container_name"), + OperatorName: types.String("SelectMultiple"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + HasMoreBuckets: types.Bool(false), + GroupName: types.String("Service Cloud"), + }, + }, + Meta: components.ShortcutsPaginationMetadata{}, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go b/tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go new file mode 100644 index 00000000..243b58d4 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1listverifications.go @@ -0,0 +1,1716 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Listverifications(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "listverifications[0]": + dir.HandlerFunc("listverifications", testListverificationsListverifications0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testListverificationsListverifications0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.VerificationFeed = &components.VerificationFeed{ + Documents: []components.Verification{ + components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 229716, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 635532, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "avalanche jungle unto meanwhile beside tromp worth reluctantly", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 294083, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 747562, + ItemType: components.CollectionItemItemTypeText, + }, + components.CollectionItem{ + CollectionID: 324206, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 678179, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Role: components.UserRoleAnswerModerator, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 20615, + }, + components.Share{ + NumDaysAgo: 467775, + }, + components.Share{ + NumDaysAgo: 993677, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 406555, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 652326, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 370293, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 900911, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 424586, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 221489, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 277523, + }, + }, + }, + components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 749833, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1messages.go b/tests/mockserver/internal/handler/pathpostrestapiv1messages.go new file mode 100644 index 00000000..4d477fa5 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1messages.go @@ -0,0 +1,8718 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Messages(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "messages[0]": + dir.HandlerFunc("messages", testMessagesMessages0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testMessagesMessages0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.MessagesResponse = &components.MessagesResponse{ + HasMore: false, + SearchResponse: &components.SearchResponse{ + TrackingToken: types.String("trackingToken"), + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + StructuredResults: []components.StructuredResult{ + components.StructuredResult{ + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 450824, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 213457, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 438142, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 78888, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + MentionedPeople: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "meanwhile bah because impassioned responsibility jogging airman per", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 168726, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 491026, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeURL, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{ + Reactors: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 845806, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Share{ + NumDaysAgo: 534384, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 387819, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 698722, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 365275, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Notes: types.String("CIO is interested in trying out the product."), + }, + Team: &components.Team{ + ID: "", + Name: "", + Members: []components.PersonToTeamRelationship{ + components.PersonToTeamRelationship{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Relationship: components.PersonToTeamRelationshipRelationshipMember.ToPointer(), + }, + }, + DatasourceProfiles: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + Status: components.TeamStatusProcessed.ToPointer(), + CanBeDeleted: types.Bool(true), + }, + CustomEntity: &components.CustomEntity{}, + Answer: &components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 637897, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 960234, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 163922, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{ + components.AnswerLike{ + User: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LikedByUser: true, + NumLikes: 750176, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 194354, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "absolve beside makeover amidst diver if behind drat", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 435401, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 382213, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + ExtractedQnA: &components.ExtractedQnA{ + QuestionResult: &components.SearchResult{ + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 990860, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + RelatedResults: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 820095, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 346523, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 193124, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + AllClusteredResults: []components.ClusterGroup{ + components.ClusterGroup{ + VisibleCountHint: 197787, + }, + components.ClusterGroup{ + VisibleCountHint: 60189, + }, + }, + MustIncludeSuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 478496, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Meeting: &components.Meeting{ + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{ + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "baptise kick ick gosh stall phew", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 999561, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + AnswerBoard: &components.AnswerBoard{ + Name: "", + Description: "unnecessarily medium following pfft bashfully before", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 534236, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + Code: &components.Code{ + RepoName: types.String("scio"), + FileName: types.String("README.md"), + Lines: []components.CodeLine{ + components.CodeLine{}, + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + RelatedQuestion: &components.RelatedQuestion{}, + }, + components.StructuredResult{ + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 972200, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Notes: types.String("CIO is interested in trying out the product."), + }, + Team: &components.Team{ + ID: "", + Name: "", + DatasourceProfiles: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + Status: components.TeamStatusProcessed.ToPointer(), + CanBeDeleted: types.Bool(true), + }, + CustomEntity: &components.CustomEntity{}, + Answer: &components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{}, + LikedByUser: false, + NumLikes: 738008, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 688038, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "parade since delightfully", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 207365, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 961784, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + ExtractedQnA: &components.ExtractedQnA{ + QuestionResult: &components.SearchResult{ + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 61187, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + MustIncludeSuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 950775, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Meeting: &components.Meeting{ + Attendees: &components.CalendarAttendees{}, + }, + Collection: &components.Collection{ + Name: "", + Description: "whereas chubby bah er taut toward footrest victorious custody huzzah", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 863294, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + AnswerBoard: &components.AnswerBoard{ + Name: "", + Description: "er until seal er", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 591321, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + Code: &components.Code{ + RepoName: types.String("scio"), + FileName: types.String("README.md"), + }, + QuerySuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + RelatedQuestion: &components.RelatedQuestion{}, + }, + }, + GeneratedQnaResult: &components.GeneratedQna{ + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 73819, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 743152, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + GleanDataError: &components.GleanDataError{ + ErrorMessages: []components.ErrorMessage{ + components.ErrorMessage{ + Source: types.String("gmail"), + ErrorMessage: types.String("invalid token"), + }, + components.ErrorMessage{ + Source: types.String("slack"), + ErrorMessage: types.String("expired token"), + }, + }, + }, + RequestID: types.String("5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100"), + BackendTimeMillis: types.Int64(1100), + Metadata: &components.SearchResponseMetadata{ + SearchedQueryRanges: []components.TextRange{ + components.TextRange{ + StartIndex: 245129, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 298813, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 147593, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 954659, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 600259, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 195022, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 801589, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + AdditionalQuerySuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + FacetResults: []components.FacetResult{ + components.FacetResult{ + SourceName: types.String("container_name"), + OperatorName: types.String("SelectMultiple"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + HasMoreBuckets: types.Bool(false), + GroupName: types.String("Service Cloud"), + }, + components.FacetResult{ + SourceName: types.String("container_name"), + OperatorName: types.String("SelectMultiple"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Datasource: types.String("jira"), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("engineering"), + IntegerValue: types.Int64(5), + DisplayLabel: types.String("engineering"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + HasMoreBuckets: types.Bool(false), + GroupName: types.String("Service Cloud"), + }, + }, + ResultsDescription: &components.ResultsDescription{ + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + RewrittenFacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + HasMoreResults: types.Bool(true), + }, + RootMessage: &components.SearchResult{ + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 733319, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + MustIncludeSuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 359740, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1people.go b/tests/mockserver/internal/handler/pathpostrestapiv1people.go new file mode 100644 index 00000000..9b82e330 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1people.go @@ -0,0 +1,1640 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1People(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "people[0]": + dir.HandlerFunc("people", testPeoplePeople0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPeoplePeople0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PeopleResponse = &components.PeopleResponse{ + Results: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 325985, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 5324, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{ + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + components.CreateCustomFieldValueCustomFieldValueStr( + components.CustomFieldValueStr{}, + ), + }, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + MentionedPeople: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "underneath whoa electronics tributary", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 544551, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 450370, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 574783, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + }, + components.Collection{ + Name: "", + Description: "playfully heavy finally altruistic whenever er utter notwithstanding", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 372647, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Collection{ + Name: "", + Description: "boohoo analogy hm and rise weight", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 705939, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{ + Reactors: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 406671, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 870639, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 945399, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 970028, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1pin.go b/tests/mockserver/internal/handler/pathpostrestapiv1pin.go new file mode 100644 index 00000000..6d279e1e --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1pin.go @@ -0,0 +1,546 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Pin(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "pin[0]": + dir.HandlerFunc("pin", testPinPin0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPinPin0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PinDocument = &components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 417458, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 69025, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "vice between gee", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 550483, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 452224, + ItemType: components.CollectionItemItemTypeText, + }, + components.CollectionItem{ + CollectionID: 259772, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 137324, + ItemType: components.CollectionItemItemTypeURL, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Role: components.UserRoleAnswerModerator, + }, + }, + }, + components.Collection{ + Name: "", + Description: "attend alongside aw blend ha ew", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 497070, + }, + components.Collection{ + Name: "", + Description: "embalm simple ouch when pfft ah vainly", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 154150, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 842284, + }, + components.Share{ + NumDaysAgo: 466260, + }, + components.Share{ + NumDaysAgo: 931588, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + Reminders: []components.Reminder{ + components.Reminder{ + RemindAt: 982866, + }, + }, + LastReminder: &components.Reminder{ + RemindAt: 482357, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 150565, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go b/tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go new file mode 100644 index 00000000..6eded0b5 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1recommendations.go @@ -0,0 +1,5663 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Recommendations(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "recommendations[0]": + dir.HandlerFunc("recommendations", testRecommendationsRecommendations0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testRecommendationsRecommendations0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ResultsResponse = &components.ResultsResponse{ + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + StructuredResults: []components.StructuredResult{ + components.StructuredResult{ + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 257594, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 538524, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 650257, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + MentionedPeople: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "dusk entwine cease than materialise whenever fireplace eek", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 71727, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 102105, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeCollection, + }, + components.CollectionItem{ + CollectionID: 515424, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 330168, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleVerifier, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{ + Reactors: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 364853, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Share{ + NumDaysAgo: 533353, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Share{ + NumDaysAgo: 82419, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 606221, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 33153, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 624169, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 535774, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Customer: &components.Customer{ + ID: "", + Company: components.Company{ + Name: "", + Location: types.String("New York City"), + Industry: types.String("Finances"), + About: types.String("Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"), + }, + Poc: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Notes: types.String("CIO is interested in trying out the product."), + }, + Team: &components.Team{ + ID: "", + Name: "", + Members: []components.PersonToTeamRelationship{ + components.PersonToTeamRelationship{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Relationship: components.PersonToTeamRelationshipRelationshipMember.ToPointer(), + }, + components.PersonToTeamRelationship{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Relationship: components.PersonToTeamRelationshipRelationshipMember.ToPointer(), + }, + }, + DatasourceProfiles: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + Status: components.TeamStatusProcessed.ToPointer(), + CanBeDeleted: types.Bool(true), + }, + CustomEntity: &components.CustomEntity{}, + Answer: &components.Answer{ + ID: 3, + DocID: types.String("ANSWERS_answer_3"), + Question: types.String("Why is the sky blue?"), + BodyText: types.String("From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light."), + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + CombinedAnswerText: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 962229, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 395713, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + Likes: &components.AnswerLikes{ + LikedBy: []components.AnswerLike{}, + LikedByUser: false, + NumLikes: 297770, + }, + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 752324, + }, + }, + }, + Board: &components.AnswerBoard{ + Name: "", + Description: "adventurously notwithstanding canter generously tenderly helpfully front schnitzel", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 324124, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 912614, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + ExtractedQnA: &components.ExtractedQnA{ + QuestionResult: &components.SearchResult{ + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 565417, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + RelatedResults: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 358317, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 116602, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 975675, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + AllClusteredResults: []components.ClusterGroup{ + components.ClusterGroup{ + VisibleCountHint: 49580, + }, + components.ClusterGroup{ + VisibleCountHint: 242509, + }, + components.ClusterGroup{ + VisibleCountHint: 812000, + }, + }, + MustIncludeSuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 952650, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Meeting: &components.Meeting{ + Attendees: &components.CalendarAttendees{ + People: []components.CalendarAttendee{ + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.CalendarAttendee{ + Person: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + Collection: &components.Collection{ + Name: "", + Description: "furthermore hence formal tune flowery aside the schedule witty", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 965, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + AnswerBoard: &components.AnswerBoard{ + Name: "", + Description: "fess um whoa times boohoo down", + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 762536, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + Code: &components.Code{ + RepoName: types.String("scio"), + FileName: types.String("README.md"), + Lines: []components.CodeLine{ + components.CodeLine{}, + components.CodeLine{}, + components.CodeLine{}, + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + RelatedQuestion: &components.RelatedQuestion{}, + }, + }, + GeneratedQnaResult: &components.GeneratedQna{ + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 389859, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 916413, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 63382, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateVerified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 928524, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 466270, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 569654, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + BackendTimeMillis: types.Int64(1100), + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1search.go b/tests/mockserver/internal/handler/pathpostrestapiv1search.go new file mode 100644 index 00000000..36f7c3f7 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1search.go @@ -0,0 +1,163 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Search(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "search[0]": + dir.HandlerFunc("search", testSearchSearch0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testSearchSearch0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.SearchResponse = &components.SearchResponse{ + TrackingToken: types.String("trackingToken"), + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://www.example.com/", + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + components.SearchResult{ + Title: types.String("title"), + URL: "https://www.example.com/", + Snippets: []components.SearchResultSnippet{}, + }, + }, + GleanDataError: &components.GleanDataError{ + ErrorMessages: []components.ErrorMessage{ + components.ErrorMessage{ + Source: types.String("gmail"), + ErrorMessage: types.String("invalid token"), + }, + components.ErrorMessage{ + Source: types.String("slack"), + ErrorMessage: types.String("expired token"), + }, + }, + }, + RequestID: types.String("5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100"), + FacetResults: []components.FacetResult{ + components.FacetResult{ + SourceName: types.String("sourceName"), + OperatorName: types.String("operatorName"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + }, + }, + components.FacetResult{ + SourceName: types.String("sourceName"), + OperatorName: types.String("operatorName"), + Buckets: []components.FacetBucket{ + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + components.FacetBucket{ + Count: types.Int64(1), + Percentage: types.Int64(5), + Value: &components.FacetValue{ + StringValue: types.String("stringValue"), + IntegerValue: types.Int64(5), + }, + }, + }, + }, + }, + RewrittenFacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("fieldName"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{}, + components.FacetFilterValue{}, + }, + }, + components.FacetFilter{ + FieldName: types.String("fieldName"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{}, + components.FacetFilterValue{}, + }, + }, + }, + HasMoreResults: types.Bool(true), + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1summarize.go b/tests/mockserver/internal/handler/pathpostrestapiv1summarize.go new file mode 100644 index 00000000..2184efd6 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1summarize.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Summarize(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "summarize[0]": + dir.HandlerFunc("summarize", testSummarizeSummarize0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testSummarizeSummarize0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.SummarizeResponse = &components.SummarizeResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go b/tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go new file mode 100644 index 00000000..1676df61 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1toolscall.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1ToolsCall(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "post_/rest/api/v1/tools/call[0]": + dir.HandlerFunc("post_/rest/api/v1/tools/call", testPostRestAPIV1ToolsCallPostRestAPIV1ToolsCall0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPostRestAPIV1ToolsCallPostRestAPIV1ToolsCall0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.ToolsCallResponse = &components.ToolsCallResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1unpin.go b/tests/mockserver/internal/handler/pathpostrestapiv1unpin.go new file mode 100644 index 00000000..c1a7228b --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1unpin.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Unpin(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "unpin[0]": + dir.HandlerFunc("unpin", testUnpinUnpin0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testUnpinUnpin0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"*/*"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + w.WriteHeader(http.StatusOK) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go b/tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go new file mode 100644 index 00000000..16017575 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1updateannouncement.go @@ -0,0 +1,2580 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Updateannouncement(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "updateannouncement[0]": + dir.HandlerFunc("updateannouncement", testUpdateannouncementUpdateannouncement0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testUpdateannouncementUpdateannouncement0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.Announcement = &components.Announcement{ + Body: &components.StructuredText{ + Text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.", + StructuredList: []components.StructuredTextItem{ + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 517232, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 676467, + }, + components.TextRange{ + StartIndex: 749867, + }, + components.TextRange{ + StartIndex: 595467, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 454586, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + MentionedPeople: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + Attribution: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "queasily down worthy generously than narrate pish off", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleOwner, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 162698, + Creator: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 553022, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeURL, + }, + components.CollectionItem{ + CollectionID: 322125, + CreatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + ItemType: components.CollectionItemItemTypeText, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleViewer, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleEditor, + }, + components.UserRoleSpecification{ + Person: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Role: components.UserRoleAnswerModerator, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{ + Reactors: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 132693, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Share{ + NumDaysAgo: 241217, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + components.Share{ + NumDaysAgo: 355708, + Sharer: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + }, + Verification: &components.Verification{ + State: components.StateUnverified, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 46236, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 25092, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 109020, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 390161, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + components.StructuredTextItem{ + Link: types.String("https://en.wikipedia.org/wiki/Diffuse_sky_radiation"), + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 349429, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Text: types.String("Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."), + }, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DraftID: types.Int64(342), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + SourceDocument: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + Verification: &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 726281, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go b/tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go new file mode 100644 index 00000000..835c96f1 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1updateshortcut.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Updateshortcut(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "updateshortcut[0]": + dir.HandlerFunc("updateshortcut", testUpdateshortcutUpdateshortcut0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testUpdateshortcutUpdateshortcut0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.UpdateShortcutResponse = &components.UpdateShortcutResponse{} + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1verify.go b/tests/mockserver/internal/handler/pathpostrestapiv1verify.go new file mode 100644 index 00000000..95b10abb --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostrestapiv1verify.go @@ -0,0 +1,899 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1Verify(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "verify[0]": + dir.HandlerFunc("verify", testVerifyVerify0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testVerifyVerify0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.Verification = &components.Verification{ + State: components.StateDeprecated, + Metadata: &components.VerificationMetadata{ + LastVerifier: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + RelatedDocuments: []components.RelatedDocuments{ + components.RelatedDocuments{ + QuerySuggestion: &components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + SearchProviderInfo: &components.SearchProviderInfo{ + Name: types.String("Google"), + SearchLinkURLTemplate: types.String("https://www.google.com/search?q={query}&hl=en"), + }, + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + RequestOptions: &components.SearchRequestOptions{ + DatasourceFilter: types.String("JIRA"), + DatasourcesFilter: []string{ + "JIRA", + }, + QueryOverridesFacetFilters: types.Bool(true), + FacetFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + FacetFilterSets: []components.FacetFilterSet{ + components.FacetFilterSet{ + Filters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + }, + }, + FacetBucketSize: 227138, + AuthTokens: []components.AuthToken{ + components.AuthToken{ + AccessToken: "123abc", + Datasource: "gmail", + Scope: types.String("email profile https://www.googleapis.com/auth/gmail.readonly"), + TokenType: types.String("Bearer"), + AuthUser: types.String("1"), + }, + }, + }, + Ranges: []components.TextRange{ + components.TextRange{ + StartIndex: 394054, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Pins: []components.PinDocument{ + components.PinDocument{ + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + DocumentID: "", + }, + }, + Collections: []components.Collection{ + components.Collection{ + Name: "", + Description: "fiddle gee lightly these unique", + AddedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + }, + RemovedRoles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleViewer, + }, + }, + AudienceFilters: []components.FacetFilter{ + components.FacetFilter{ + FieldName: types.String("type"), + Values: []components.FacetFilterValue{ + components.FacetFilterValue{ + Value: types.String("Spreadsheet"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + components.FacetFilterValue{ + Value: types.String("Presentation"), + RelationType: components.RelationTypeEquals.ToPointer(), + }, + }, + }, + }, + ID: 248707, + Items: []components.CollectionItem{ + components.CollectionItem{ + CollectionID: 159863, + ItemType: components.CollectionItemItemTypeDocument, + }, + components.CollectionItem{ + CollectionID: 725143, + ItemType: components.CollectionItemItemTypeDocument, + }, + }, + Roles: []components.UserRoleSpecification{ + components.UserRoleSpecification{ + Role: components.UserRoleOwner, + }, + components.UserRoleSpecification{ + Role: components.UserRoleVerifier, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{ + Reacts: []components.Reaction{ + components.Reaction{}, + components.Reaction{}, + }, + Shares: []components.Share{ + components.Share{ + NumDaysAgo: 638745, + }, + components.Share{ + NumDaysAgo: 331260, + }, + components.Share{ + NumDaysAgo: 759941, + }, + }, + }, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 344155, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + components.TextRange{ + StartIndex: 851433, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + }, + }, + }, + }, + InputDetails: &components.SearchRequestInputDetails{ + HasCopyPaste: types.Bool(true), + }, + }, + Results: []components.SearchResult{ + components.SearchResult{ + Title: types.String("title"), + URL: "https://example.com/foo/bar", + NativeAppURL: types.String("slack://foo/bar"), + Snippets: []components.SearchResultSnippet{ + components.SearchResultSnippet{ + Snippet: "snippet", + MimeType: types.String("mimeType"), + }, + }, + }, + }, + }, + }, + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{ + Suggestions: []components.QuerySuggestion{ + components.QuerySuggestion{ + Query: "app:github type:pull author:mortimer", + Label: types.String("Mortimer's PRs"), + Datasource: types.String("github"), + }, + }, + }, + InviteInfo: &components.InviteInfo{ + Invites: []components.ChannelInviteInfo{ + components.ChannelInviteInfo{}, + components.ChannelInviteInfo{}, + }, + }, + CustomFields: []components.CustomFieldData{ + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + components.CustomFieldData{ + Label: "", + Values: []components.CustomFieldValue{}, + Displayable: types.Bool(true), + }, + }, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Document: &components.Document{ + Metadata: &components.DocumentMetadata{ + Datasource: types.String("datasource"), + ObjectType: types.String("Feature Request"), + Container: types.String("container"), + ParentID: types.String("JIRA_EN-1337"), + MimeType: types.String("mimeType"), + DocumentID: types.String("documentId"), + CreateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + UpdateTime: types.MustNewTimeFromString("2000-01-23T04:56:07.000Z"), + Author: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Owner: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Components: []string{ + "Backend", + "Networking", + }, + Status: types.String("[\"Done\"]"), + AssignedTo: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + UpdatedBy: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Interactions: &components.DocumentInteractions{}, + CustomData: map[string]components.CustomDataValue{ + "someCustomField": components.CustomDataValue{}, + }, + ContactPerson: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + }, + }, + Reminders: []components.Reminder{ + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 732097, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 510781, + }, + components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 875373, + }, + }, + LastReminder: &components.Reminder{ + Assignee: components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + Requestor: &components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + Metadata: &components.PersonMetadata{ + Type: components.PersonMetadataTypeFullTime.ToPointer(), + Title: types.String("Actor"), + Department: types.String("Movies"), + Email: types.String("george@example.com"), + Location: types.String("Hollywood, CA"), + Phone: types.String("6505551234"), + PhotoURL: types.String("https://example.com/george.jpg"), + StartDate: types.MustNewDateFromString("2000-01-23"), + DatasourceProfile: []components.DatasourceProfile{ + components.DatasourceProfile{ + Datasource: "github", + Handle: "", + }, + }, + QuerySuggestions: &components.QuerySuggestionList{}, + InviteInfo: &components.InviteInfo{}, + Badges: []components.Badge{ + components.Badge{ + Key: types.String("deployment_name_new_hire"), + DisplayName: types.String("New hire"), + IconConfig: &components.IconConfig{ + Color: types.String("#343CED"), + Key: types.String("person_icon"), + IconType: components.IconTypeGlyph.ToPointer(), + Name: types.String("user"), + }, + }, + }, + }, + }, + RemindAt: 740498, + }, + CandidateVerifiers: []components.Person{ + components.Person{ + Name: "George Clooney", + ObfuscatedID: "abc123", + }, + }, + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/values/files.go b/tests/mockserver/internal/handler/values/files.go new file mode 100644 index 00000000..6eca8858 --- /dev/null +++ b/tests/mockserver/internal/handler/values/files.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package values + +import ( + "io" + "os" +) + +func ReadFileToStream(fileName string) io.Reader { + s, err := os.Open(fileName) + if err != nil { + panic(err) + } + return s +} + +func ReadFileToBytes(fileName string) []byte { + data, err := os.ReadFile(fileName) + if err != nil { + panic(err) + } + return data +} + +func ReadFileToString(fileName string) string { + data, err := os.ReadFile(fileName) + if err != nil { + panic(err) + } + return string(data) +} + +func ReadBytes(r io.Reader) []byte { + data, err := io.ReadAll(r) + if err != nil { + panic(err) + } + return data +} diff --git a/tests/mockserver/internal/logging/doc.go b/tests/mockserver/internal/logging/doc.go new file mode 100644 index 00000000..8835f1cc --- /dev/null +++ b/tests/mockserver/internal/logging/doc.go @@ -0,0 +1,4 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +// Package logging contains the implementation and helpers for logging. +package logging diff --git a/tests/mockserver/internal/logging/formats.go b/tests/mockserver/internal/logging/formats.go new file mode 100644 index 00000000..d6ab53c8 --- /dev/null +++ b/tests/mockserver/internal/logging/formats.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package logging + +import ( + "fmt" + "strings" +) + +const ( + // JSON log format. + FormatJSON = "JSON" + + // Plaintext log format. + FormatText = "text" + + // Default log format. + DefaultFormat = FormatText +) + +// Formats returns all supported formats. +func Formats() []string { + return []string{ + FormatJSON, + FormatText, + } +} + +func formatFromString(format string) (string, error) { + switch format { + case FormatJSON: + return format, nil + case FormatText: + return format, nil + default: + return "", fmt.Errorf("unsupported log format (%s), supported formats: %s", format, strings.Join(Formats(), ", ")) + } +} diff --git a/tests/mockserver/internal/logging/http_file.go b/tests/mockserver/internal/logging/http_file.go new file mode 100644 index 00000000..d690d915 --- /dev/null +++ b/tests/mockserver/internal/logging/http_file.go @@ -0,0 +1,310 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package logging + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "io/fs" + "log" + "net/http" + "net/http/httptest" + "net/http/httputil" + "os" + "path/filepath" + "strconv" + "strings" + "sync" +) + +const ( + // DefaultHTTPFileDirectory is the default directory used for raw HTTP + // request and response files. + DefaultHTTPFileDirectory = "_debug" +) + +// HTTPFileDirectory is the directory where raw HTTP request and response files +// are written. +type HTTPFileDirectory struct { + // Filesystem at path. + filesystem fs.FS + + // Mapping of operations to call count. Used to sequentially increment file + // names and return current count. + operationCalls map[string]int64 + + // Mutex to protect operationCalls. + operationCallsMutex *sync.RWMutex + + // Absolute path to directory. + path string +} + +// NewHTTPFileDirectory will create a HTTPFileDirectory which exists and is a +// directory or will return an error. +func NewHTTPFileDirectory(explicitPath string) (*HTTPFileDirectory, error) { + path, err := filepath.Abs(DefaultHTTPFileDirectory) + if err != nil { + return nil, fmt.Errorf("error getting absolute path of HTTP file directory (%s): %w", DefaultHTTPFileDirectory, err) + } + + if explicitPath != "" { + absExplicitPath, err := filepath.Abs(explicitPath) + if err != nil { + return nil, fmt.Errorf("error getting absolute path of HTTP file directory (%s): %w", explicitPath, err) + } + + path = absExplicitPath + } + + result := &HTTPFileDirectory{ + filesystem: os.DirFS(path), + operationCalls: make(map[string]int64), + operationCallsMutex: new(sync.RWMutex), + path: path, + } + + fileInfo, err := os.Stat(path) + + if errors.Is(err, os.ErrNotExist) { + err := os.Mkdir(path, 0o2777) + if err != nil { + return nil, fmt.Errorf("error making HTTP file directory (%s): %w", path, err) + } + + return result, nil + } + + if err != nil { + return nil, fmt.Errorf("error reading HTTP file directory (%s): %w", path, err) + } + + if !fileInfo.IsDir() { + return nil, fmt.Errorf("error using HTTP file directory (%s): not a directory", path) + } + + return result, nil +} + +// Clean will remove all files from HTTPFileDirectory. +func (d *HTTPFileDirectory) Clean() error { + walkDirFunc := func(path string, entry fs.DirEntry, err error) error { + if err != nil { + return fmt.Errorf("error walking %s: %w", d.path, err) + } + + if path == "." { + return nil + } + + if entry.IsDir() { + return fs.SkipDir + } + + absPath := filepath.Join(d.path, path) + + err = os.Remove(absPath) + if err != nil { + return fmt.Errorf("error removing %s: %w", absPath, err) + } + + return nil + } + + return fs.WalkDir(d.filesystem, ".", walkDirFunc) +} + +// HandlerFunc is a HTTP handler that automatically writes the raw HTTP +// request and response to {path}/{operationId}_{call}_request and +// {path}/{operationId}_{call}_response files respectively. +func (d *HTTPFileDirectory) HandlerFunc(operationId string, next http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + call := d.nextOperationCall(operationId) + + dump, err := httputil.DumpRequest(req, true) + if err != nil { + log.Printf("error dumping HTTP request: %s", err) + } + + if len(dump) > 0 { + requestPath := filepath.Join(d.path, d.operationCallRequestFilename(operationId, call)) + + err = os.WriteFile(requestPath, dump, 0o644) + if err != nil { + log.Printf("error writing HTTP request file (%s): %s", requestPath, err) + } + } + + recorder := httptest.NewRecorder() + + next(recorder, req) + + dump, err = httputil.DumpResponse(recorder.Result(), true) + if err != nil { + log.Printf("error dumping HTTP response: %s", err) + } + + if len(dump) > 0 { + responsePath := filepath.Join(d.path, d.operationCallResponseFilename(operationId, call)) + err = os.WriteFile(responsePath, dump, 0o644) + if err != nil { + log.Printf("error writing HTTP response file (%s): %s", responsePath, err) + } + } + + recorderToWriter(recorder, w) + } +} + +// Operation will return a new OASOperation from HTTPFileDirectory. +func (d *HTTPFileDirectory) Operation(operationId string) (*OASOperation, error) { + request, err := d.Request(operationId, 1) + if err != nil { + return nil, err + } + + result := NewOASOperation(d, operationId, request.Method, request.URL.Path) + + return result, nil +} + +// Operations will return all detected OASOperation from HTTPFileDirectory. +func (d *HTTPFileDirectory) Operations() ([]*OASOperation, error) { + var result []*OASOperation + + walkDirFunc := func(path string, entry fs.DirEntry, err error) error { + if err != nil { + return fmt.Errorf("error walking %s: %w", d.path, err) + } + + if !strings.HasSuffix(path, "_1_request") { + return nil + } + + operationId := strings.TrimSuffix(path, "_1_request") + operation, err := d.Operation(operationId) + if err != nil { + return err + } + + result = append(result, operation) + + return nil + } + + err := fs.WalkDir(d.filesystem, ".", walkDirFunc) + + return result, err +} + +// OperationCallCount will return the number of detected calls for an +// OASOperation. +func (d *HTTPFileDirectory) OperationCallCount(operationId string) int64 { + d.operationCallsMutex.RLock() + defer d.operationCallsMutex.RUnlock() + + result, ok := d.operationCalls[operationId] + + if ok { + return result + } + + return 0 +} + +// RawRequest returns the raw HTTP request contents as dumped by +// [httputil.DumpRequest]. +func (d *HTTPFileDirectory) RawRequest(operationId string, call int64) ([]byte, error) { + filename := d.operationCallRequestFilename(operationId, call) + file, err := fs.ReadFile(d.filesystem, filename) + if err != nil { + return nil, fmt.Errorf("error reading HTTP request file (%s): %w", filename, err) + } + + return file, nil +} + +// RawResponse returns the raw HTTP response contents as dumped by +// [httputil.DumpResponse]. +func (d *HTTPFileDirectory) RawResponse(operationId string, call int64) ([]byte, error) { + filename := d.operationCallResponseFilename(operationId, call) + file, err := fs.ReadFile(d.filesystem, d.operationCallResponseFilename(operationId, call)) + if err != nil { + return nil, fmt.Errorf("error reading HTTP response file (%s): %w", filename, err) + } + + return file, nil +} + +// Request returns the parsed HTTP request contents. +func (d *HTTPFileDirectory) Request(operationId string, call int64) (*http.Request, error) { + rawRequest, err := d.RawRequest(operationId, call) + if err != nil { + return nil, err + } + + result, err := http.ReadRequest(bufio.NewReader(bytes.NewReader(rawRequest))) + if err != nil { + return nil, fmt.Errorf("error converting HTTP request for operation %s call %d: %w", operationId, call, err) + } + + return result, nil +} + +// Response returns the parsed HTTP response contents. +func (d *HTTPFileDirectory) Response(operationId string, call int64) (*http.Response, error) { + rawResponse, err := d.RawResponse(operationId, call) + if err != nil { + return nil, err + } + + result, err := http.ReadResponse(bufio.NewReader(bytes.NewReader(rawResponse)), nil) + if err != nil { + return nil, fmt.Errorf("error converting HTTP response for operation %s call %d: %w", operationId, call, err) + } + + return result, nil +} + +// nextOperationCall returns the incremented call number for an operation. +func (d *HTTPFileDirectory) nextOperationCall(operationId string) int64 { + d.operationCallsMutex.Lock() + defer d.operationCallsMutex.Unlock() + + var result int64 + + priorCalls, ok := d.operationCalls[operationId] + + if ok { + result = priorCalls + 1 + } else { + // Start call counts at 1 for human consumption. + result = 1 + } + + d.operationCalls[operationId] = result + + return result +} + +// operationCallRequestFilename returns the raw HTTP request file name for the +// given operation and call. +func (d *HTTPFileDirectory) operationCallRequestFilename(operationId string, call int64) string { + return sanitizeOperationIdForFilename(operationId) + "_" + strconv.FormatInt(call, 10) + "_request" +} + +// operationCallResponseFilename returns the raw HTTP response file name for the +// given operation and call. +func (d *HTTPFileDirectory) operationCallResponseFilename(operationId string, call int64) string { + return sanitizeOperationIdForFilename(operationId) + "_" + strconv.FormatInt(call, 10) + "_response" +} + +func sanitizeOperationIdForFilename(operationId string) string { + operationId = strings.ReplaceAll(operationId, "{", "_") + operationId = strings.ReplaceAll(operationId, "}", "_") + operationId = strings.ReplaceAll(operationId, "/", "_") + operationId = strings.ReplaceAll(operationId, " ", "_") + return operationId +} diff --git a/tests/mockserver/internal/logging/http_logger.go b/tests/mockserver/internal/logging/http_logger.go new file mode 100644 index 00000000..fdd5d058 --- /dev/null +++ b/tests/mockserver/internal/logging/http_logger.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package logging + +import ( + "context" + "fmt" + "log/slog" + "net/http" + "net/http/httptest" + "net/http/httputil" +) + +// HTTPLoggerHandler wraps another [http.Handler] with logging output using the +// provided logger. +func HTTPLoggerHandler(logger *slog.Logger, next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + httpLogger := logger.WithGroup("http") + recorder := httptest.NewRecorder() + reqAttr := slog.Group( + "request", + slog.String("method", req.Method), + slog.String("url", req.URL.RequestURI()), + ) + + if !logger.Enabled(context.Background(), slog.LevelDebug) { + httpLogger.With(reqAttr).Info("received request") + next.ServeHTTP(recorder, req) + + resp := recorder.Result() + respAttr := slog.Group( + "response", + slog.String("status", resp.Status), + ) + + httpLogger.With(reqAttr).With(respAttr).Info("serving response") + + recorderToWriter(recorder, w) + + return + } + + dump, err := httputil.DumpRequest(req, true) + + if err != nil { + http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) + + return + } + + rawReqAttr := slog.Group( + "request", + slog.String("method", req.Method), + slog.String("url", req.URL.RequestURI()), + slog.String("raw", string(dump)), + ) + + httpLogger.With(rawReqAttr).Debug("received request") + + next.ServeHTTP(recorder, req) + + dump, err = httputil.DumpResponse(recorder.Result(), true) + + if err != nil { + http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) + + return + } + + rawRespAttr := slog.Group( + "response", + slog.String("raw", string(dump)), + ) + + // Intentionally use simpler request log attributes + httpLogger.With(reqAttr).With(rawRespAttr).Debug("serving response") + + recorderToWriter(recorder, w) + }) +} + +// recorderToWriter copies the recorded response back to the writer. +func recorderToWriter(recorder *httptest.ResponseRecorder, w http.ResponseWriter) { + for k, v := range recorder.Result().Header { + w.Header()[k] = v + } + + w.WriteHeader(recorder.Code) + _, _ = recorder.Body.WriteTo(w) +} diff --git a/tests/mockserver/internal/logging/levels.go b/tests/mockserver/internal/logging/levels.go new file mode 100644 index 00000000..d2a8e93c --- /dev/null +++ b/tests/mockserver/internal/logging/levels.go @@ -0,0 +1,55 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package logging + +import ( + "fmt" + "log/slog" + "strings" +) + +const ( + // Debug log level. + LevelDebug = "DEBUG" + + // Info log level. + LevelInfo = "INFO" + + // Warning log level. + LevelWarn = "WARN" + + // Error log level. + LevelError = "ERROR" + + // Default log level. + DefaultLevel = LevelInfo +) + +// Levels returns all supported levels. +func Levels() []string { + return []string{ + LevelDebug, + LevelInfo, + LevelWarn, + LevelError, + } +} + +func levelFromString(level string) (*slog.LevelVar, error) { + result := new(slog.LevelVar) + + switch strings.ToUpper(level) { + case "DEBUG": + result.Set(slog.LevelDebug) + case "INFO": + result.Set(slog.LevelInfo) + case "WARN": + result.Set(slog.LevelWarn) + case "ERROR": + result.Set(slog.LevelError) + default: + return nil, fmt.Errorf("unsupported log level (%s), supported levels: %s", level, strings.Join(Levels(), ", ")) + } + + return result, nil +} diff --git a/tests/mockserver/internal/logging/logger.go b/tests/mockserver/internal/logging/logger.go new file mode 100644 index 00000000..bfd6dc78 --- /dev/null +++ b/tests/mockserver/internal/logging/logger.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package logging + +import ( + "fmt" + "io" + "log/slog" +) + +func NewLogger(w io.Writer, formatStr string, levelStr string) (*slog.Logger, error) { + level, err := levelFromString(levelStr) + + if err != nil { + return nil, err + } + + format, err := formatFromString(formatStr) + + if err != nil { + return nil, err + } + + handlerOpts := &slog.HandlerOptions{ + Level: level, + } + + var handler slog.Handler + + switch format { + case FormatJSON: + handler = slog.NewJSONHandler(w, handlerOpts) + case FormatText: + handler = slog.NewTextHandler(w, handlerOpts) + default: + return nil, fmt.Errorf("unimplemented format: %s", format) + } + + return slog.New(handler), nil +} diff --git a/tests/mockserver/internal/logging/oas_operation.go b/tests/mockserver/internal/logging/oas_operation.go new file mode 100644 index 00000000..d4f2af7b --- /dev/null +++ b/tests/mockserver/internal/logging/oas_operation.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package logging + +import "net/http" + +// OASOperation contains a singular OAS operation. An operation can have one or +// more calls. +type OASOperation struct { + // Underlying HTTP calls for the operation. + calls []*OASOperationCall + + // Directory that contains HTTP request and response logs. + dir *HTTPFileDirectory + + // Operation identifier as defined in OAS. + id string + + // HTTP method for the operation, such as GET. + method string + + // URL path for the operation, such as /path. + path string + + // TODO: Add group +} + +// NewOASOperation creates a new OASOperation. +func NewOASOperation(dir *HTTPFileDirectory, operationId string, method string, path string) *OASOperation { + operationCalls := dir.OperationCallCount(operationId) + result := &OASOperation{ + calls: make([]*OASOperationCall, 0, operationCalls), + dir: dir, + id: operationId, + method: method, + path: path, + } + + for i := range operationCalls { + // Start at 1 for human consumption. + result.calls = append(result.calls, NewOASOperationCall(result, i+1)) + } + + return result +} + +// CallCount returns the number of calls to an operation. +func (o *OASOperation) CallCount() int64 { + return int64(len(o.calls)) +} + +// Id returns the operation identifier as defined in OAS. +func (o *OASOperation) Id() string { + return o.id +} + +// Method returns the HTTP method for the operation, such as GET. +func (o *OASOperation) Method() string { + return o.method +} + +// Path returns the URL path for the operation, such as /path. +func (o *OASOperation) Path() string { + return o.path +} + +// RawRequest returns the raw HTTP request contents as dumped by +// [httputil.DumpRequest]. +func (o *OASOperation) RawRequest(call int64) ([]byte, error) { + return o.dir.RawRequest(o.id, call) +} + +// RawResponse returns the raw HTTP response contents as dumped by +// [httputil.DumpResponse]. +func (o *OASOperation) RawResponse(call int64) ([]byte, error) { + return o.dir.RawResponse(o.id, call) +} + +// Request returns the parsed HTTP request contents. +func (o *OASOperation) Request(call int64) (*http.Request, error) { + return o.dir.Request(o.id, call) +} + +// Response returns the parsed HTTP response contents. +func (o *OASOperation) Response(call int64) (*http.Response, error) { + return o.dir.Response(o.id, call) +} diff --git a/tests/mockserver/internal/logging/oas_operation_call.go b/tests/mockserver/internal/logging/oas_operation_call.go new file mode 100644 index 00000000..beb05908 --- /dev/null +++ b/tests/mockserver/internal/logging/oas_operation_call.go @@ -0,0 +1,123 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package logging + +import ( + "bufio" + "bytes" + "net/http" +) + +// OASOperationCall contains a singular OAS operation HTTP call. +type OASOperationCall struct { + // The HTTP call number, as determined by the HTTP server. Starts at 1 and + // incremented. + call int64 + + // The associated OAS operation to this call. + operation *OASOperation + + // Parsed HTTP request contents. Cached on first use. + request *http.Request + + // Raw HTTP request contents. Cached on first use. + requestRaw []byte + + // Parsed HTTP response contents. Cached on first use. + response *http.Response + + // Raw HTTP response contents. Cached on first use. + responseRaw []byte + + // TODO: Add test identifier +} + +// NewOASOperationCall creates a new OASOperationCall. +func NewOASOperationCall(operation *OASOperation, call int64) *OASOperationCall { + return &OASOperationCall{ + call: call, + operation: operation, + } +} + +// RawRequest returns the raw HTTP request contents as dumped by +// [httputil.DumpRequest]. +func (c *OASOperationCall) RawRequest() ([]byte, error) { + if c.requestRaw != nil { + return c.requestRaw, nil + } + + requestRaw, err := c.operation.RawRequest(c.call) + + if err != nil { + return nil, err + } + + c.requestRaw = requestRaw + + return c.requestRaw, nil +} + +// RawResponse returns the raw HTTP response contents as dumped by +// [httputil.DumpResponse]. +func (c *OASOperationCall) RawResponse() ([]byte, error) { + if c.responseRaw != nil { + return c.responseRaw, nil + } + + responseRaw, err := c.operation.RawResponse(c.call) + + if err != nil { + return nil, err + } + + c.responseRaw = responseRaw + + return c.responseRaw, nil +} + +// Request returns the parsed HTTP request contents. +func (c *OASOperationCall) Request() (*http.Request, error) { + if c.request != nil { + return c.request, nil + } + + requestRaw, err := c.RawRequest() + + if err != nil { + return nil, err + } + + request, err := http.ReadRequest(bufio.NewReader(bytes.NewReader(requestRaw))) + + if err != nil { + return nil, err + } + + c.request = request + + return c.request, nil +} + +// Response returns the parsed HTTP response contents. +func (c *OASOperationCall) Response() (*http.Response, error) { + if c.response != nil { + return c.response, nil + } + + responseRaw, err := c.RawResponse() + + if err != nil { + return nil, err + } + + response, err := http.ReadResponse(bufio.NewReader(bytes.NewReader(responseRaw)), nil) + + if err != nil { + return nil, err + } + + c.response = response + + return c.response, nil +} diff --git a/tests/mockserver/internal/sdk/models/components/activity.go b/tests/mockserver/internal/sdk/models/components/activity.go new file mode 100644 index 00000000..495599c8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/activity.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Activity struct { + Events []ActivityEvent `json:"events"` +} + +func (o *Activity) GetEvents() []ActivityEvent { + if o == nil { + return []ActivityEvent{} + } + return o.Events +} diff --git a/tests/mockserver/internal/sdk/models/components/activityevent.go b/tests/mockserver/internal/sdk/models/components/activityevent.go new file mode 100644 index 00000000..d01ceec5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/activityevent.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// ActivityEventAction - The type of activity this represents. +type ActivityEventAction string + +const ( + ActivityEventActionView ActivityEventAction = "VIEW" + ActivityEventActionEdit ActivityEventAction = "EDIT" + ActivityEventActionSearch ActivityEventAction = "SEARCH" + ActivityEventActionComment ActivityEventAction = "COMMENT" + ActivityEventActionCrawl ActivityEventAction = "CRAWL" + ActivityEventActionHistoricalSearch ActivityEventAction = "HISTORICAL_SEARCH" + ActivityEventActionHistoricalView ActivityEventAction = "HISTORICAL_VIEW" +) + +func (e ActivityEventAction) ToPointer() *ActivityEventAction { + return &e +} +func (e *ActivityEventAction) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "VIEW": + fallthrough + case "EDIT": + fallthrough + case "SEARCH": + fallthrough + case "COMMENT": + fallthrough + case "CRAWL": + fallthrough + case "HISTORICAL_SEARCH": + fallthrough + case "HISTORICAL_VIEW": + *e = ActivityEventAction(v) + return nil + default: + return fmt.Errorf("invalid value for ActivityEventAction: %v", v) + } +} + +type ActivityEvent struct { + // Universally unique identifier of the event. To allow for reliable retransmission, only the earliest received event of a given UUID is considered valid by the server and subsequent are ignored. + ID *string `json:"id,omitempty"` + // The type of activity this represents. + Action ActivityEventAction `json:"action"` + Params *ActivityEventParams `json:"params,omitempty"` + // The ISO 8601 timestamp when the activity began. + Timestamp time.Time `json:"timestamp"` + // The URL of the activity. + URL string `json:"url"` +} + +func (a ActivityEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ActivityEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ActivityEvent) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *ActivityEvent) GetAction() ActivityEventAction { + if o == nil { + return ActivityEventAction("") + } + return o.Action +} + +func (o *ActivityEvent) GetParams() *ActivityEventParams { + if o == nil { + return nil + } + return o.Params +} + +func (o *ActivityEvent) GetTimestamp() time.Time { + if o == nil { + return time.Time{} + } + return o.Timestamp +} + +func (o *ActivityEvent) GetURL() string { + if o == nil { + return "" + } + return o.URL +} diff --git a/tests/mockserver/internal/sdk/models/components/activityeventparams.go b/tests/mockserver/internal/sdk/models/components/activityeventparams.go new file mode 100644 index 00000000..eae5f03e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/activityeventparams.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ActivityEventParams struct { + // The HTML content of the page body. + BodyContent *string `json:"bodyContent,omitempty"` + // The full datasource instance name inferred from the URL of the event + DatasourceInstance *string `json:"datasourceInstance,omitempty"` + // The datasource without the instance inferred from the URL of the event + Datasource *string `json:"datasource,omitempty"` + // The instance only name of the datasource instance, e.g. 1 for jira_1, inferred from the URL of the event + InstanceOnlyName *string `json:"instanceOnlyName,omitempty"` + // Length in seconds of the activity. For VIEWS, this represents the amount the page was visible in the foreground. + Duration *int64 `json:"duration,omitempty"` + // The user's search query associated with a SEARCH. + Query *string `json:"query,omitempty"` + // The referring URL of the VIEW or SEARCH. + Referrer *string `json:"referrer,omitempty"` + // The page title associated with the URL of the event + Title *string `json:"title,omitempty"` + // Indicates that the parameters are incomplete and more parameters may be sent with the same action+timestamp+URL in the future. This is used for sending the duration when a `VIEW` is finished. + Truncated *bool `json:"truncated,omitempty"` +} + +func (o *ActivityEventParams) GetBodyContent() *string { + if o == nil { + return nil + } + return o.BodyContent +} + +func (o *ActivityEventParams) GetDatasourceInstance() *string { + if o == nil { + return nil + } + return o.DatasourceInstance +} + +func (o *ActivityEventParams) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *ActivityEventParams) GetInstanceOnlyName() *string { + if o == nil { + return nil + } + return o.InstanceOnlyName +} + +func (o *ActivityEventParams) GetDuration() *int64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *ActivityEventParams) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +func (o *ActivityEventParams) GetReferrer() *string { + if o == nil { + return nil + } + return o.Referrer +} + +func (o *ActivityEventParams) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *ActivityEventParams) GetTruncated() *bool { + if o == nil { + return nil + } + return o.Truncated +} diff --git a/tests/mockserver/internal/sdk/models/components/addcollectionitemserror.go b/tests/mockserver/internal/sdk/models/components/addcollectionitemserror.go new file mode 100644 index 00000000..215308e8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/addcollectionitemserror.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type AddCollectionItemsErrorErrorType string + +const ( + AddCollectionItemsErrorErrorTypeExistingItem AddCollectionItemsErrorErrorType = "EXISTING_ITEM" +) + +func (e AddCollectionItemsErrorErrorType) ToPointer() *AddCollectionItemsErrorErrorType { + return &e +} +func (e *AddCollectionItemsErrorErrorType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "EXISTING_ITEM": + *e = AddCollectionItemsErrorErrorType(v) + return nil + default: + return fmt.Errorf("invalid value for AddCollectionItemsErrorErrorType: %v", v) + } +} + +type AddCollectionItemsError struct { + ErrorType *AddCollectionItemsErrorErrorType `json:"errorType,omitempty"` +} + +func (o *AddCollectionItemsError) GetErrorType() *AddCollectionItemsErrorErrorType { + if o == nil { + return nil + } + return o.ErrorType +} diff --git a/tests/mockserver/internal/sdk/models/components/addcollectionitemsrequest.go b/tests/mockserver/internal/sdk/models/components/addcollectionitemsrequest.go new file mode 100644 index 00000000..3a1ab6f6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/addcollectionitemsrequest.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AddCollectionItemsRequest struct { + // The ID of the Collection to add items to. + CollectionID float64 `json:"collectionId"` + // The CollectionItemDescriptors of the items being added. + AddedCollectionItemDescriptors []CollectionItemDescriptor `json:"addedCollectionItemDescriptors,omitempty"` +} + +func (o *AddCollectionItemsRequest) GetCollectionID() float64 { + if o == nil { + return 0.0 + } + return o.CollectionID +} + +func (o *AddCollectionItemsRequest) GetAddedCollectionItemDescriptors() []CollectionItemDescriptor { + if o == nil { + return nil + } + return o.AddedCollectionItemDescriptors +} diff --git a/tests/mockserver/internal/sdk/models/components/addcollectionitemsresponse.go b/tests/mockserver/internal/sdk/models/components/addcollectionitemsresponse.go new file mode 100644 index 00000000..dcb69503 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/addcollectionitemsresponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AddCollectionItemsResponse struct { + Collection *Collection `json:"collection,omitempty"` + Error *AddCollectionItemsError `json:"error,omitempty"` +} + +func (o *AddCollectionItemsResponse) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} + +func (o *AddCollectionItemsResponse) GetError() *AddCollectionItemsError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/additionalfielddefinition.go b/tests/mockserver/internal/sdk/models/components/additionalfielddefinition.go new file mode 100644 index 00000000..65166a2a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/additionalfielddefinition.go @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Value - Either a string or HypertextField. When OpenAPI Generator supports oneOf, we can semantically enforce this in the docs. +type Value struct { +} + +// AdditionalFieldDefinition - Additional information about the employee or team. +type AdditionalFieldDefinition struct { + // Key to reference this field, e.g. "languages". Note that the key should be all lowercase alphabetic characters with no numbers, spaces, hyphens or underscores. + Key *string `json:"key,omitempty"` + // List of type string or HypertextField. + // + // HypertextField is defined as + // ``` + // { + // anchor: string, // Anchor text for the hypertext field. + // hyperlink: string, // URL for the hypertext field. + // } + // ``` + // Example: ```{"anchor":"Glean","hyperlink":"https://glean.com"}``` + // + // When OpenAPI Generator supports oneOf, we will semantically enforce this in the docs. + // + // **Note**: If using the Python SDK to pass in a list of strings, the value may need to be a list of dictionaries. In that case, the key in that dictionary will be ignored. + // Example: ```"languages": [{"lang":"English","lang":"Spanish",...}]```. In this case, the key "lang" will be ignored and can even be passed in as an empty string. + // + Value []Value `json:"value,omitempty"` +} + +func (o *AdditionalFieldDefinition) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *AdditionalFieldDefinition) GetValue() []Value { + if o == nil { + return nil + } + return o.Value +} diff --git a/tests/mockserver/internal/sdk/models/components/agent.go b/tests/mockserver/internal/sdk/models/components/agent.go new file mode 100644 index 00000000..584c94ce --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agent.go @@ -0,0 +1,106 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" +) + +// AgentMetadata - The agent metadata. Currently not implemented. +type AgentMetadata struct { +} + +// AgentCapabilities - Describes features that the agent supports. example: { +// "ap.io.messages": true, +// "ap.io.streaming": true +// } +type AgentCapabilities struct { + // Whether the agent supports messages as an input. If true, you'll pass `messages` as an input when running the agent. + ApIoMessages *bool `json:"ap.io.messages,omitempty"` + // Whether the agent supports streaming output. If true, you you can stream agent ouput. All agents currently support streaming. + ApIoStreaming *bool `json:"ap.io.streaming,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (a AgentCapabilities) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AgentCapabilities) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AgentCapabilities) GetApIoMessages() *bool { + if o == nil { + return nil + } + return o.ApIoMessages +} + +func (o *AgentCapabilities) GetApIoStreaming() *bool { + if o == nil { + return nil + } + return o.ApIoStreaming +} + +func (o *AgentCapabilities) GetAdditionalProperties() map[string]any { + if o == nil { + return nil + } + return o.AdditionalProperties +} + +type Agent struct { + // The ID of the agent. + AgentID string `json:"agent_id"` + // The name of the agent + Name string `json:"name"` + // The description of the agent. + Description *string `json:"description,omitempty"` + // The agent metadata. Currently not implemented. + Metadata *AgentMetadata `json:"metadata,omitempty"` + // Describes features that the agent supports. example: { + // "ap.io.messages": true, + // "ap.io.streaming": true + // } + Capabilities AgentCapabilities `json:"capabilities"` +} + +func (o *Agent) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *Agent) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Agent) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *Agent) GetMetadata() *AgentMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Agent) GetCapabilities() AgentCapabilities { + if o == nil { + return AgentCapabilities{} + } + return o.Capabilities +} diff --git a/tests/mockserver/internal/sdk/models/components/agentconfig.go b/tests/mockserver/internal/sdk/models/components/agentconfig.go new file mode 100644 index 00000000..d1e17332 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agentconfig.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// AgentEnum - Name of the agent. +type AgentEnum string + +const ( + AgentEnumDefault AgentEnum = "DEFAULT" + AgentEnumGpt AgentEnum = "GPT" + AgentEnumUniversal AgentEnum = "UNIVERSAL" +) + +func (e AgentEnum) ToPointer() *AgentEnum { + return &e +} +func (e *AgentEnum) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DEFAULT": + fallthrough + case "GPT": + fallthrough + case "UNIVERSAL": + *e = AgentEnum(v) + return nil + default: + return fmt.Errorf("invalid value for AgentEnum: %v", v) + } +} + +// Mode - Top level modes to run GleanChat in. +type Mode string + +const ( + ModeDefault Mode = "DEFAULT" + ModeQuick Mode = "QUICK" +) + +func (e Mode) ToPointer() *Mode { + return &e +} +func (e *Mode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DEFAULT": + fallthrough + case "QUICK": + *e = Mode(v) + return nil + default: + return fmt.Errorf("invalid value for Mode: %v", v) + } +} + +// AgentConfig - Describes the agent that executes the request. +type AgentConfig struct { + // Name of the agent. + Agent *AgentEnum `json:"agent,omitempty"` + // Top level modes to run GleanChat in. + Mode *Mode `json:"mode,omitempty"` +} + +func (o *AgentConfig) GetAgent() *AgentEnum { + if o == nil { + return nil + } + return o.Agent +} + +func (o *AgentConfig) GetMode() *Mode { + if o == nil { + return nil + } + return o.Mode +} diff --git a/tests/mockserver/internal/sdk/models/components/agentexecutionstatus.go b/tests/mockserver/internal/sdk/models/components/agentexecutionstatus.go new file mode 100644 index 00000000..7a8ba840 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agentexecutionstatus.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// AgentExecutionStatus - The status of the run. One of 'error', 'success'. +type AgentExecutionStatus string + +const ( + AgentExecutionStatusError AgentExecutionStatus = "error" + AgentExecutionStatusSuccess AgentExecutionStatus = "success" +) + +func (e AgentExecutionStatus) ToPointer() *AgentExecutionStatus { + return &e +} +func (e *AgentExecutionStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "error": + fallthrough + case "success": + *e = AgentExecutionStatus(v) + return nil + default: + return fmt.Errorf("invalid value for AgentExecutionStatus: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/agentrun.go b/tests/mockserver/internal/sdk/models/components/agentrun.go new file mode 100644 index 00000000..23ab5120 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agentrun.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// AgentRun - Payload for creating a run. +type AgentRun struct { + // The ID of the agent to run. + AgentID string `json:"agent_id"` + // The input to the agent. + Input map[string]any `json:"input,omitempty"` + // The messages to pass an input to the agent. + Messages []Message `json:"messages,omitempty"` + // The metadata to pass to the agent. + Metadata map[string]any `json:"metadata,omitempty"` + // The status of the run. One of 'error', 'success'. + Status *AgentExecutionStatus `json:"status,omitempty"` +} + +func (o *AgentRun) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *AgentRun) GetInput() map[string]any { + if o == nil { + return nil + } + return o.Input +} + +func (o *AgentRun) GetMessages() []Message { + if o == nil { + return nil + } + return o.Messages +} + +func (o *AgentRun) GetMetadata() map[string]any { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *AgentRun) GetStatus() *AgentExecutionStatus { + if o == nil { + return nil + } + return o.Status +} diff --git a/tests/mockserver/internal/sdk/models/components/agentruncreate.go b/tests/mockserver/internal/sdk/models/components/agentruncreate.go new file mode 100644 index 00000000..c095a382 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agentruncreate.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// AgentRunCreate - Payload for creating a run. +type AgentRunCreate struct { + // The ID of the agent to run. + AgentID string `json:"agent_id"` + // The input to the agent. + Input map[string]any `json:"input,omitempty"` + // The messages to pass an input to the agent. + Messages []Message `json:"messages,omitempty"` + // The metadata to pass to the agent. + Metadata map[string]any `json:"metadata,omitempty"` +} + +func (o *AgentRunCreate) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *AgentRunCreate) GetInput() map[string]any { + if o == nil { + return nil + } + return o.Input +} + +func (o *AgentRunCreate) GetMessages() []Message { + if o == nil { + return nil + } + return o.Messages +} + +func (o *AgentRunCreate) GetMetadata() map[string]any { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/tests/mockserver/internal/sdk/models/components/agentrunwaitresponse.go b/tests/mockserver/internal/sdk/models/components/agentrunwaitresponse.go new file mode 100644 index 00000000..b5aa1e8e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agentrunwaitresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AgentRunWaitResponse struct { + Run *AgentRun `json:"run,omitempty"` + // The messages returned by the run. + Messages []Message `json:"messages,omitempty"` +} + +func (o *AgentRunWaitResponse) GetRun() *AgentRun { + if o == nil { + return nil + } + return o.Run +} + +func (o *AgentRunWaitResponse) GetMessages() []Message { + if o == nil { + return nil + } + return o.Messages +} diff --git a/tests/mockserver/internal/sdk/models/components/agentschemas.go b/tests/mockserver/internal/sdk/models/components/agentschemas.go new file mode 100644 index 00000000..4fe8d12d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/agentschemas.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// InputSchema - The schema for the agent input. In JSON Schema format. +type InputSchema struct { +} + +// OutputSchema - The schema for the agent output. In JSON Schema format. +type OutputSchema struct { +} + +// AgentSchemas - Defines the structure and properties of an agent. +type AgentSchemas struct { + // The ID of the agent. + AgentID string `json:"agent_id"` + // The schema for the agent input. In JSON Schema format. + InputSchema InputSchema `json:"input_schema"` + // The schema for the agent output. In JSON Schema format. + OutputSchema OutputSchema `json:"output_schema"` +} + +func (o *AgentSchemas) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *AgentSchemas) GetInputSchema() InputSchema { + if o == nil { + return InputSchema{} + } + return o.InputSchema +} + +func (o *AgentSchemas) GetOutputSchema() OutputSchema { + if o == nil { + return OutputSchema{} + } + return o.OutputSchema +} diff --git a/tests/mockserver/internal/sdk/models/components/aiappactioncounts.go b/tests/mockserver/internal/sdk/models/components/aiappactioncounts.go new file mode 100644 index 00000000..ac7cf152 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/aiappactioncounts.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" +) + +// AiAppActionCounts - Map from action to frequency. +type AiAppActionCounts struct { + // Total number of Slackbot responses, both proactive and reactive. + TotalSlackbotResponses *int64 `json:"totalSlackbotResponses,omitempty"` + // Total number of Slackbot responses shared publicly (upvoted). + TotalSlackbotResponsesShared *int64 `json:"totalSlackbotResponsesShared,omitempty"` + // Total number of Slackbot responses rejected as not helpful (downvoted). + TotalSlackbotResponsesNotHelpful *int64 `json:"totalSlackbotResponsesNotHelpful,omitempty"` + // Total number of Chat messages sent in requested period. + TotalChatMessages *int64 `json:"totalChatMessages,omitempty"` + // Total number of Chat messages which received upvotes by the user. + TotalUpvotes *int64 `json:"totalUpvotes,omitempty"` + // Total number of Chat messages which received downvotes by the user. + TotalDownvotes *int64 `json:"totalDownvotes,omitempty"` + AdditionalProperties map[string]int64 `additionalProperties:"true" json:"-"` +} + +func (a AiAppActionCounts) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AiAppActionCounts) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AiAppActionCounts) GetTotalSlackbotResponses() *int64 { + if o == nil { + return nil + } + return o.TotalSlackbotResponses +} + +func (o *AiAppActionCounts) GetTotalSlackbotResponsesShared() *int64 { + if o == nil { + return nil + } + return o.TotalSlackbotResponsesShared +} + +func (o *AiAppActionCounts) GetTotalSlackbotResponsesNotHelpful() *int64 { + if o == nil { + return nil + } + return o.TotalSlackbotResponsesNotHelpful +} + +func (o *AiAppActionCounts) GetTotalChatMessages() *int64 { + if o == nil { + return nil + } + return o.TotalChatMessages +} + +func (o *AiAppActionCounts) GetTotalUpvotes() *int64 { + if o == nil { + return nil + } + return o.TotalUpvotes +} + +func (o *AiAppActionCounts) GetTotalDownvotes() *int64 { + if o == nil { + return nil + } + return o.TotalDownvotes +} + +func (o *AiAppActionCounts) GetAdditionalProperties() map[string]int64 { + if o == nil { + return nil + } + return o.AdditionalProperties +} diff --git a/tests/mockserver/internal/sdk/models/components/aiappsinsightsresponse.go b/tests/mockserver/internal/sdk/models/components/aiappsinsightsresponse.go new file mode 100644 index 00000000..8de39cd4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/aiappsinsightsresponse.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AiAppsInsightsResponse struct { + // Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). + LastLogTimestamp *int64 `json:"lastLogTimestamp,omitempty"` + AiAppInsights []UserActivityInsight `json:"aiAppInsights,omitempty"` + // Total number of active users on the Ai App in the requested period. + TotalActiveUsers *int64 `json:"totalActiveUsers,omitempty"` + // Map from action to frequency. + ActionCounts *AiAppActionCounts `json:"actionCounts,omitempty"` + // list of departments applicable for users tab. + Departments []string `json:"departments,omitempty"` +} + +func (o *AiAppsInsightsResponse) GetLastLogTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastLogTimestamp +} + +func (o *AiAppsInsightsResponse) GetAiAppInsights() []UserActivityInsight { + if o == nil { + return nil + } + return o.AiAppInsights +} + +func (o *AiAppsInsightsResponse) GetTotalActiveUsers() *int64 { + if o == nil { + return nil + } + return o.TotalActiveUsers +} + +func (o *AiAppsInsightsResponse) GetActionCounts() *AiAppActionCounts { + if o == nil { + return nil + } + return o.ActionCounts +} + +func (o *AiAppsInsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} diff --git a/tests/mockserver/internal/sdk/models/components/aiinsightsresponse.go b/tests/mockserver/internal/sdk/models/components/aiinsightsresponse.go new file mode 100644 index 00000000..478529db --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/aiinsightsresponse.go @@ -0,0 +1,113 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AiInsightsResponse struct { + // Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). + LastLogTimestamp *int64 `json:"lastLogTimestamp,omitempty"` + AssistantInsights []UserActivityInsight `json:"assistantInsights,omitempty"` + // Total number of Active Assistant users (chat, summary, AIA) in requested period. + TotalActiveAssistantUsers *int64 `json:"totalActiveAssistantUsers,omitempty"` + // Total number of Chat messages sent in requested period. + TotalChatMessages *int64 `json:"totalChatMessages,omitempty"` + // Total number of AI Document Summarizations invoked in the requested period. + TotalAiSummarizations *int64 `json:"totalAiSummarizations,omitempty"` + // Total number of AI Answers generated in the requested period. + TotalAiAnswers *int64 `json:"totalAiAnswers,omitempty"` + // Total number of Chat messages which received upvotes by the user. + TotalUpvotes *int64 `json:"totalUpvotes,omitempty"` + // Total number of Chat messages which received downvotes by the user. + TotalDownvotes *int64 `json:"totalDownvotes,omitempty"` + // Total number of Gleanbot responses, both proactive and reactive. + TotalGleanbotResponses *int64 `json:"totalGleanbotResponses,omitempty"` + // Total number of Gleanbot responses shared publicly (upvoted). + TotalGleanbotResponsesShared *int64 `json:"totalGleanbotResponsesShared,omitempty"` + // Total number of Glean responses rejected as not helpful (downvoted). + TotalGleanbotResponsesNotHelpful *int64 `json:"totalGleanbotResponsesNotHelpful,omitempty"` + // list of departments applicable for users tab. + Departments []string `json:"departments,omitempty"` +} + +func (o *AiInsightsResponse) GetLastLogTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastLogTimestamp +} + +func (o *AiInsightsResponse) GetAssistantInsights() []UserActivityInsight { + if o == nil { + return nil + } + return o.AssistantInsights +} + +func (o *AiInsightsResponse) GetTotalActiveAssistantUsers() *int64 { + if o == nil { + return nil + } + return o.TotalActiveAssistantUsers +} + +func (o *AiInsightsResponse) GetTotalChatMessages() *int64 { + if o == nil { + return nil + } + return o.TotalChatMessages +} + +func (o *AiInsightsResponse) GetTotalAiSummarizations() *int64 { + if o == nil { + return nil + } + return o.TotalAiSummarizations +} + +func (o *AiInsightsResponse) GetTotalAiAnswers() *int64 { + if o == nil { + return nil + } + return o.TotalAiAnswers +} + +func (o *AiInsightsResponse) GetTotalUpvotes() *int64 { + if o == nil { + return nil + } + return o.TotalUpvotes +} + +func (o *AiInsightsResponse) GetTotalDownvotes() *int64 { + if o == nil { + return nil + } + return o.TotalDownvotes +} + +func (o *AiInsightsResponse) GetTotalGleanbotResponses() *int64 { + if o == nil { + return nil + } + return o.TotalGleanbotResponses +} + +func (o *AiInsightsResponse) GetTotalGleanbotResponsesShared() *int64 { + if o == nil { + return nil + } + return o.TotalGleanbotResponsesShared +} + +func (o *AiInsightsResponse) GetTotalGleanbotResponsesNotHelpful() *int64 { + if o == nil { + return nil + } + return o.TotalGleanbotResponsesNotHelpful +} + +func (o *AiInsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} diff --git a/tests/mockserver/internal/sdk/models/components/allowlistoptions.go b/tests/mockserver/internal/sdk/models/components/allowlistoptions.go new file mode 100644 index 00000000..cf238c9e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/allowlistoptions.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// AllowlistOptions - Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. +type AllowlistOptions struct { + // list of words and phrases to consider as whitelisted content + Terms []string `json:"terms,omitempty"` +} + +func (o *AllowlistOptions) GetTerms() []string { + if o == nil { + return nil + } + return o.Terms +} diff --git a/tests/mockserver/internal/sdk/models/components/announcement.go b/tests/mockserver/internal/sdk/models/components/announcement.go new file mode 100644 index 00000000..e9ccadcc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/announcement.go @@ -0,0 +1,307 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// AnnouncementChannel - This determines whether this is a Social Feed post or a regular announcement. +type AnnouncementChannel string + +const ( + AnnouncementChannelMain AnnouncementChannel = "MAIN" + AnnouncementChannelSocialFeed AnnouncementChannel = "SOCIAL_FEED" +) + +func (e AnnouncementChannel) ToPointer() *AnnouncementChannel { + return &e +} +func (e *AnnouncementChannel) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MAIN": + fallthrough + case "SOCIAL_FEED": + *e = AnnouncementChannel(v) + return nil + default: + return fmt.Errorf("invalid value for AnnouncementChannel: %v", v) + } +} + +// AnnouncementPostType - This determines whether this is an external-link post or a regular announcement post. TEXT - Regular announcement that can contain rich text. LINK - Announcement that is linked to an external site. +type AnnouncementPostType string + +const ( + AnnouncementPostTypeText AnnouncementPostType = "TEXT" + AnnouncementPostTypeLink AnnouncementPostType = "LINK" +) + +func (e AnnouncementPostType) ToPointer() *AnnouncementPostType { + return &e +} +func (e *AnnouncementPostType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + fallthrough + case "LINK": + *e = AnnouncementPostType(v) + return nil + default: + return fmt.Errorf("invalid value for AnnouncementPostType: %v", v) + } +} + +type AnnouncementViewerInfo struct { + // Whether the viewer has dismissed the announcement. + IsDismissed *bool `json:"isDismissed,omitempty"` + // Whether the viewer has read the announcement. + IsRead *bool `json:"isRead,omitempty"` +} + +func (o *AnnouncementViewerInfo) GetIsDismissed() *bool { + if o == nil { + return nil + } + return o.IsDismissed +} + +func (o *AnnouncementViewerInfo) GetIsRead() *bool { + if o == nil { + return nil + } + return o.IsRead +} + +type Announcement struct { + // The date and time at which the announcement becomes active. + StartTime *time.Time `json:"startTime,omitempty"` + // The date and time at which the announcement expires. + EndTime *time.Time `json:"endTime,omitempty"` + // The headline of the announcement. + Title *string `json:"title,omitempty"` + Body *StructuredText `json:"body,omitempty"` + // An emoji used to indicate the nature of the announcement. + Emoji *string `json:"emoji,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + Banner *Thumbnail `json:"banner,omitempty"` + // Filters which restrict who should see the announcement. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The Glean Document ID of the source document this Announcement was created from (e.g. Slack thread). + SourceDocumentID *string `json:"sourceDocumentId,omitempty"` + // Whether or not to hide an author attribution. + HideAttribution *bool `json:"hideAttribution,omitempty"` + // This determines whether this is a Social Feed post or a regular announcement. + Channel *AnnouncementChannel `json:"channel,omitempty"` + // This determines whether this is an external-link post or a regular announcement post. TEXT - Regular announcement that can contain rich text. LINK - Announcement that is linked to an external site. + PostType *AnnouncementPostType `json:"postType,omitempty"` + // Used by the Social Feed to pin posts to the front of the feed. + IsPrioritized *bool `json:"isPrioritized,omitempty"` + // URL for viewing the announcement. It will be set to document URL for announcements from other datasources e.g. simpplr. Can only be written when channel="SOCIAL_FEED". + ViewURL *string `json:"viewUrl,omitempty"` + // The opaque id of the associated draft. + DraftID *int64 `json:"draftId,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // The opaque id of the announcement. + ID *int64 `json:"id,omitempty"` + Author *Person `json:"author,omitempty"` + // Server Unix timestamp of the creation time (in seconds since epoch UTC). + CreateTimestamp *int64 `json:"createTimestamp,omitempty"` + // Server Unix timestamp of the last update time (in seconds since epoch UTC). + LastUpdateTimestamp *int64 `json:"lastUpdateTimestamp,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + ViewerInfo *AnnouncementViewerInfo `json:"viewerInfo,omitempty"` + SourceDocument *Document `json:"sourceDocument,omitempty"` + // Whether or not the announcement is published. + IsPublished *bool `json:"isPublished,omitempty"` +} + +func (a Announcement) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *Announcement) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Announcement) GetStartTime() *time.Time { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *Announcement) GetEndTime() *time.Time { + if o == nil { + return nil + } + return o.EndTime +} + +func (o *Announcement) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Announcement) GetBody() *StructuredText { + if o == nil { + return nil + } + return o.Body +} + +func (o *Announcement) GetEmoji() *string { + if o == nil { + return nil + } + return o.Emoji +} + +func (o *Announcement) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *Announcement) GetBanner() *Thumbnail { + if o == nil { + return nil + } + return o.Banner +} + +func (o *Announcement) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *Announcement) GetSourceDocumentID() *string { + if o == nil { + return nil + } + return o.SourceDocumentID +} + +func (o *Announcement) GetHideAttribution() *bool { + if o == nil { + return nil + } + return o.HideAttribution +} + +func (o *Announcement) GetChannel() *AnnouncementChannel { + if o == nil { + return nil + } + return o.Channel +} + +func (o *Announcement) GetPostType() *AnnouncementPostType { + if o == nil { + return nil + } + return o.PostType +} + +func (o *Announcement) GetIsPrioritized() *bool { + if o == nil { + return nil + } + return o.IsPrioritized +} + +func (o *Announcement) GetViewURL() *string { + if o == nil { + return nil + } + return o.ViewURL +} + +func (o *Announcement) GetDraftID() *int64 { + if o == nil { + return nil + } + return o.DraftID +} + +func (o *Announcement) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *Announcement) GetID() *int64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *Announcement) GetAuthor() *Person { + if o == nil { + return nil + } + return o.Author +} + +func (o *Announcement) GetCreateTimestamp() *int64 { + if o == nil { + return nil + } + return o.CreateTimestamp +} + +func (o *Announcement) GetLastUpdateTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastUpdateTimestamp +} + +func (o *Announcement) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *Announcement) GetViewerInfo() *AnnouncementViewerInfo { + if o == nil { + return nil + } + return o.ViewerInfo +} + +func (o *Announcement) GetSourceDocument() *Document { + if o == nil { + return nil + } + return o.SourceDocument +} + +func (o *Announcement) GetIsPublished() *bool { + if o == nil { + return nil + } + return o.IsPublished +} diff --git a/tests/mockserver/internal/sdk/models/components/anonymousevent.go b/tests/mockserver/internal/sdk/models/components/anonymousevent.go new file mode 100644 index 00000000..4aa5bb37 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/anonymousevent.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// AnonymousEventEventType - The nature of the event, for example "out of office". +type AnonymousEventEventType string + +const ( + AnonymousEventEventTypeDefault AnonymousEventEventType = "DEFAULT" + AnonymousEventEventTypeOutOfOffice AnonymousEventEventType = "OUT_OF_OFFICE" +) + +func (e AnonymousEventEventType) ToPointer() *AnonymousEventEventType { + return &e +} +func (e *AnonymousEventEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DEFAULT": + fallthrough + case "OUT_OF_OFFICE": + *e = AnonymousEventEventType(v) + return nil + default: + return fmt.Errorf("invalid value for AnonymousEventEventType: %v", v) + } +} + +// AnonymousEvent - A generic, light-weight calendar event. +type AnonymousEvent struct { + Time *TimeInterval `json:"time,omitempty"` + // The nature of the event, for example "out of office". + EventType *AnonymousEventEventType `json:"eventType,omitempty"` +} + +func (o *AnonymousEvent) GetTime() *TimeInterval { + if o == nil { + return nil + } + return o.Time +} + +func (o *AnonymousEvent) GetEventType() *AnonymousEventEventType { + if o == nil { + return nil + } + return o.EventType +} diff --git a/tests/mockserver/internal/sdk/models/components/answer.go b/tests/mockserver/internal/sdk/models/components/answer.go new file mode 100644 index 00000000..05fc2ed7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/answer.go @@ -0,0 +1,257 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +type AnswerSourceType string + +const ( + AnswerSourceTypeDocument AnswerSourceType = "DOCUMENT" + AnswerSourceTypeAssistant AnswerSourceType = "ASSISTANT" +) + +func (e AnswerSourceType) ToPointer() *AnswerSourceType { + return &e +} +func (e *AnswerSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DOCUMENT": + fallthrough + case "ASSISTANT": + *e = AnswerSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnswerSourceType: %v", v) + } +} + +type Answer struct { + // The opaque ID of the Answer. + ID int64 `json:"id"` + // Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. + DocID *string `json:"docId,omitempty"` + Question *string `json:"question,omitempty"` + // Additional ways of phrasing this question. + QuestionVariations []string `json:"questionVariations,omitempty"` + // The plain text answer to the question. + BodyText *string `json:"bodyText,omitempty"` + // The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + BoardID *int64 `json:"boardId,omitempty"` + // Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // A list of user roles for the answer added by the owner. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of user roles for the answer removed by the owner. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // A list of roles for this answer explicitly granted by an owner, editor, or admin. + Roles []UserRoleSpecification `json:"roles,omitempty"` + SourceDocumentSpec *DocumentSpecUnion `json:"sourceDocumentSpec,omitempty"` + SourceType *AnswerSourceType `json:"sourceType,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + CombinedAnswerText *StructuredText `json:"combinedAnswerText,omitempty"` + Likes *AnswerLikes `json:"likes,omitempty"` + Author *Person `json:"author,omitempty"` + // The time the answer was created in ISO format (ISO 8601). + CreateTime *time.Time `json:"createTime,omitempty"` + // The time the answer was last updated in ISO format (ISO 8601). + UpdateTime *time.Time `json:"updateTime,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + Verification *Verification `json:"verification,omitempty"` + Board *AnswerBoard `json:"board,omitempty"` + // The collections to which the answer belongs. + Collections []Collection `json:"collections,omitempty"` + // The document's document_category(.proto). + DocumentCategory *string `json:"documentCategory,omitempty"` + SourceDocument *Document `json:"sourceDocument,omitempty"` +} + +func (a Answer) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *Answer) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Answer) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *Answer) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} + +func (o *Answer) GetQuestion() *string { + if o == nil { + return nil + } + return o.Question +} + +func (o *Answer) GetQuestionVariations() []string { + if o == nil { + return nil + } + return o.QuestionVariations +} + +func (o *Answer) GetBodyText() *string { + if o == nil { + return nil + } + return o.BodyText +} + +func (o *Answer) GetBoardID() *int64 { + if o == nil { + return nil + } + return o.BoardID +} + +func (o *Answer) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *Answer) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *Answer) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *Answer) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} + +func (o *Answer) GetSourceDocumentSpec() *DocumentSpecUnion { + if o == nil { + return nil + } + return o.SourceDocumentSpec +} + +func (o *Answer) GetSourceType() *AnswerSourceType { + if o == nil { + return nil + } + return o.SourceType +} + +func (o *Answer) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *Answer) GetCombinedAnswerText() *StructuredText { + if o == nil { + return nil + } + return o.CombinedAnswerText +} + +func (o *Answer) GetLikes() *AnswerLikes { + if o == nil { + return nil + } + return o.Likes +} + +func (o *Answer) GetAuthor() *Person { + if o == nil { + return nil + } + return o.Author +} + +func (o *Answer) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *Answer) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *Answer) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *Answer) GetVerification() *Verification { + if o == nil { + return nil + } + return o.Verification +} + +func (o *Answer) GetBoard() *AnswerBoard { + if o == nil { + return nil + } + return o.Board +} + +func (o *Answer) GetCollections() []Collection { + if o == nil { + return nil + } + return o.Collections +} + +func (o *Answer) GetDocumentCategory() *string { + if o == nil { + return nil + } + return o.DocumentCategory +} + +func (o *Answer) GetSourceDocument() *Document { + if o == nil { + return nil + } + return o.SourceDocument +} diff --git a/tests/mockserver/internal/sdk/models/components/answerboard.go b/tests/mockserver/internal/sdk/models/components/answerboard.go new file mode 100644 index 00000000..a69d7740 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/answerboard.go @@ -0,0 +1,134 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type AnswerBoard struct { + // The unique name of the Collection. + Name string `json:"name"` + // A brief summary of the Collection's contents. + Description string `json:"description"` + // A list of added user roles for the Collection. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of removed user roles for the Collection. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // The unique ID of the Answer Board. + ID int64 `json:"id"` + CreateTime *time.Time `json:"createTime,omitempty"` + UpdateTime *time.Time `json:"updateTime,omitempty"` + Creator *Person `json:"creator,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + // The number of items currently in the Answer Board. Separated from the actual items so we can grab the count without items. + ItemCount *int64 `json:"itemCount,omitempty"` + // A list of user roles for the Answer Board. + Roles []UserRoleSpecification `json:"roles,omitempty"` +} + +func (a AnswerBoard) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnswerBoard) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AnswerBoard) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *AnswerBoard) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *AnswerBoard) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *AnswerBoard) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *AnswerBoard) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *AnswerBoard) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *AnswerBoard) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *AnswerBoard) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *AnswerBoard) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *AnswerBoard) GetCreator() *Person { + if o == nil { + return nil + } + return o.Creator +} + +func (o *AnswerBoard) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *AnswerBoard) GetItemCount() *int64 { + if o == nil { + return nil + } + return o.ItemCount +} + +func (o *AnswerBoard) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} diff --git a/tests/mockserver/internal/sdk/models/components/answercreationdata.go b/tests/mockserver/internal/sdk/models/components/answercreationdata.go new file mode 100644 index 00000000..4050d341 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/answercreationdata.go @@ -0,0 +1,143 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type AnswerCreationDataSourceType string + +const ( + AnswerCreationDataSourceTypeDocument AnswerCreationDataSourceType = "DOCUMENT" + AnswerCreationDataSourceTypeAssistant AnswerCreationDataSourceType = "ASSISTANT" +) + +func (e AnswerCreationDataSourceType) ToPointer() *AnswerCreationDataSourceType { + return &e +} +func (e *AnswerCreationDataSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DOCUMENT": + fallthrough + case "ASSISTANT": + *e = AnswerCreationDataSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnswerCreationDataSourceType: %v", v) + } +} + +type AnswerCreationData struct { + Question *string `json:"question,omitempty"` + // Additional ways of phrasing this question. + QuestionVariations []string `json:"questionVariations,omitempty"` + // The plain text answer to the question. + BodyText *string `json:"bodyText,omitempty"` + // The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + BoardID *int64 `json:"boardId,omitempty"` + // Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // A list of user roles for the answer added by the owner. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of user roles for the answer removed by the owner. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // A list of roles for this answer explicitly granted by an owner, editor, or admin. + Roles []UserRoleSpecification `json:"roles,omitempty"` + SourceDocumentSpec *DocumentSpecUnion `json:"sourceDocumentSpec,omitempty"` + SourceType *AnswerCreationDataSourceType `json:"sourceType,omitempty"` + // IDs of Collections to which a document is added. + AddedCollections []int64 `json:"addedCollections,omitempty"` + CombinedAnswerText *StructuredTextMutableProperties `json:"combinedAnswerText,omitempty"` +} + +func (o *AnswerCreationData) GetQuestion() *string { + if o == nil { + return nil + } + return o.Question +} + +func (o *AnswerCreationData) GetQuestionVariations() []string { + if o == nil { + return nil + } + return o.QuestionVariations +} + +func (o *AnswerCreationData) GetBodyText() *string { + if o == nil { + return nil + } + return o.BodyText +} + +func (o *AnswerCreationData) GetBoardID() *int64 { + if o == nil { + return nil + } + return o.BoardID +} + +func (o *AnswerCreationData) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *AnswerCreationData) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *AnswerCreationData) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *AnswerCreationData) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} + +func (o *AnswerCreationData) GetSourceDocumentSpec() *DocumentSpecUnion { + if o == nil { + return nil + } + return o.SourceDocumentSpec +} + +func (o *AnswerCreationData) GetSourceType() *AnswerCreationDataSourceType { + if o == nil { + return nil + } + return o.SourceType +} + +func (o *AnswerCreationData) GetAddedCollections() []int64 { + if o == nil { + return nil + } + return o.AddedCollections +} + +func (o *AnswerCreationData) GetCombinedAnswerText() *StructuredTextMutableProperties { + if o == nil { + return nil + } + return o.CombinedAnswerText +} diff --git a/tests/mockserver/internal/sdk/models/components/answerlike.go b/tests/mockserver/internal/sdk/models/components/answerlike.go new file mode 100644 index 00000000..8c643b1f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/answerlike.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type AnswerLike struct { + User *Person `json:"user,omitempty"` + // The time the user liked the answer in ISO format (ISO 8601). + CreateTime *time.Time `json:"createTime,omitempty"` +} + +func (a AnswerLike) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnswerLike) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AnswerLike) GetUser() *Person { + if o == nil { + return nil + } + return o.User +} + +func (o *AnswerLike) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} diff --git a/tests/mockserver/internal/sdk/models/components/answerlikes.go b/tests/mockserver/internal/sdk/models/components/answerlikes.go new file mode 100644 index 00000000..1341b507 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/answerlikes.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AnswerLikes struct { + LikedBy []AnswerLike `json:"likedBy"` + // Whether the user in context liked the answer. + LikedByUser bool `json:"likedByUser"` + // The total number of likes for the answer. + NumLikes int64 `json:"numLikes"` +} + +func (o *AnswerLikes) GetLikedBy() []AnswerLike { + if o == nil { + return []AnswerLike{} + } + return o.LikedBy +} + +func (o *AnswerLikes) GetLikedByUser() bool { + if o == nil { + return false + } + return o.LikedByUser +} + +func (o *AnswerLikes) GetNumLikes() int64 { + if o == nil { + return 0 + } + return o.NumLikes +} diff --git a/tests/mockserver/internal/sdk/models/components/answerresult.go b/tests/mockserver/internal/sdk/models/components/answerresult.go new file mode 100644 index 00000000..f5687a60 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/answerresult.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AnswerResult struct { + Answer Answer `json:"answer"` + // An opaque token that represents this particular Answer. To be used for `/feedback` reporting. + TrackingToken *string `json:"trackingToken,omitempty"` +} + +func (o *AnswerResult) GetAnswer() Answer { + if o == nil { + return Answer{} + } + return o.Answer +} + +func (o *AnswerResult) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} diff --git a/tests/mockserver/internal/sdk/models/components/appresult.go b/tests/mockserver/internal/sdk/models/components/appresult.go new file mode 100644 index 00000000..e19c2214 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/appresult.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AppResult struct { + // The app or other repository type this represents + Datasource string `json:"datasource"` + // The datasource-specific type of the document (e.g. for Jira issues, this is the issue type such as Bug or Feature Request). + DocType *string `json:"docType,omitempty"` + // Mimetype is used to differentiate between sub applications from a datasource (e.g. Sheets, Docs from Gdrive) + MimeType *string `json:"mimeType,omitempty"` + // If there is available icon URL. + IconURL *string `json:"iconUrl,omitempty"` +} + +func (o *AppResult) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *AppResult) GetDocType() *string { + if o == nil { + return nil + } + return o.DocType +} + +func (o *AppResult) GetMimeType() *string { + if o == nil { + return nil + } + return o.MimeType +} + +func (o *AppResult) GetIconURL() *string { + if o == nil { + return nil + } + return o.IconURL +} diff --git a/tests/mockserver/internal/sdk/models/components/authconfig.go b/tests/mockserver/internal/sdk/models/components/authconfig.go new file mode 100644 index 00000000..1cecca52 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/authconfig.go @@ -0,0 +1,217 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// AuthConfigType - The type of authentication being used. +// Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. +// 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. +// 'OAUTH_USER' uses individual user tokens for external API calls. +// 'DWD' refers to domain wide delegation. +type AuthConfigType string + +const ( + AuthConfigTypeNone AuthConfigType = "NONE" + AuthConfigTypeOauthUser AuthConfigType = "OAUTH_USER" + AuthConfigTypeOauthAdmin AuthConfigType = "OAUTH_ADMIN" + AuthConfigTypeAPIKey AuthConfigType = "API_KEY" + AuthConfigTypeBasicAuth AuthConfigType = "BASIC_AUTH" + AuthConfigTypeDwd AuthConfigType = "DWD" +) + +func (e AuthConfigType) ToPointer() *AuthConfigType { + return &e +} +func (e *AuthConfigType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NONE": + fallthrough + case "OAUTH_USER": + fallthrough + case "OAUTH_ADMIN": + fallthrough + case "API_KEY": + fallthrough + case "BASIC_AUTH": + fallthrough + case "DWD": + *e = AuthConfigType(v) + return nil + default: + return fmt.Errorf("invalid value for AuthConfigType: %v", v) + } +} + +// GrantType - The type of grant type being used. +type GrantType string + +const ( + GrantTypeAuthCode GrantType = "AUTH_CODE" + GrantTypeClientCredentials GrantType = "CLIENT_CREDENTIALS" +) + +func (e GrantType) ToPointer() *GrantType { + return &e +} +func (e *GrantType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "AUTH_CODE": + fallthrough + case "CLIENT_CREDENTIALS": + *e = GrantType(v) + return nil + default: + return fmt.Errorf("invalid value for GrantType: %v", v) + } +} + +// AuthConfigStatus - Auth status of the tool. +type AuthConfigStatus string + +const ( + AuthConfigStatusAwaitingAuth AuthConfigStatus = "AWAITING_AUTH" + AuthConfigStatusAuthorized AuthConfigStatus = "AUTHORIZED" +) + +func (e AuthConfigStatus) ToPointer() *AuthConfigStatus { + return &e +} +func (e *AuthConfigStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "AWAITING_AUTH": + fallthrough + case "AUTHORIZED": + *e = AuthConfigStatus(v) + return nil + default: + return fmt.Errorf("invalid value for AuthConfigStatus: %v", v) + } +} + +// AuthConfig - Config for tool's authentication method. +type AuthConfig struct { + // Whether or not this tool is hosted on-premise. + IsOnPrem *bool `json:"isOnPrem,omitempty"` + // Whether or not this uses central auth. + UsesCentralAuth *bool `json:"usesCentralAuth,omitempty"` + // The type of authentication being used. + // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. + // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. + // 'OAUTH_USER' uses individual user tokens for external API calls. + // 'DWD' refers to domain wide delegation. + // + Type *AuthConfigType `json:"type,omitempty"` + // The type of grant type being used. + GrantType *GrantType `json:"grantType,omitempty"` + // Auth status of the tool. + Status *AuthConfigStatus `json:"status,omitempty"` + // The URL where users will be directed to start the OAuth flow. + ClientURL *string `json:"client_url,omitempty"` + // A list of strings denoting the different scopes or access levels required by the tool. + Scopes []string `json:"scopes,omitempty"` + // A list of strings denoting the different audience which can access the tool. + Audiences []string `json:"audiences,omitempty"` + // The OAuth provider's endpoint, where access tokens are requested. + AuthorizationURL *string `json:"authorization_url,omitempty"` + // The time the tool was last authorized in ISO format (ISO 8601). + LastAuthorizedAt *time.Time `json:"lastAuthorizedAt,omitempty"` +} + +func (a AuthConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AuthConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AuthConfig) GetIsOnPrem() *bool { + if o == nil { + return nil + } + return o.IsOnPrem +} + +func (o *AuthConfig) GetUsesCentralAuth() *bool { + if o == nil { + return nil + } + return o.UsesCentralAuth +} + +func (o *AuthConfig) GetType() *AuthConfigType { + if o == nil { + return nil + } + return o.Type +} + +func (o *AuthConfig) GetGrantType() *GrantType { + if o == nil { + return nil + } + return o.GrantType +} + +func (o *AuthConfig) GetStatus() *AuthConfigStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *AuthConfig) GetClientURL() *string { + if o == nil { + return nil + } + return o.ClientURL +} + +func (o *AuthConfig) GetScopes() []string { + if o == nil { + return nil + } + return o.Scopes +} + +func (o *AuthConfig) GetAudiences() []string { + if o == nil { + return nil + } + return o.Audiences +} + +func (o *AuthConfig) GetAuthorizationURL() *string { + if o == nil { + return nil + } + return o.AuthorizationURL +} + +func (o *AuthConfig) GetLastAuthorizedAt() *time.Time { + if o == nil { + return nil + } + return o.LastAuthorizedAt +} diff --git a/tests/mockserver/internal/sdk/models/components/authtoken.go b/tests/mockserver/internal/sdk/models/components/authtoken.go new file mode 100644 index 00000000..a3945388 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/authtoken.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AuthToken struct { + AccessToken string `json:"accessToken"` + Datasource string `json:"datasource"` + Scope *string `json:"scope,omitempty"` + TokenType *string `json:"tokenType,omitempty"` + // Used by Google to indicate the index of the logged in user. Useful for generating hyperlinks that support multilogin. + AuthUser *string `json:"authUser,omitempty"` + // Unix timestamp when this token expires (in seconds since epoch UTC). + Expiration *int64 `json:"expiration,omitempty"` +} + +func (o *AuthToken) GetAccessToken() string { + if o == nil { + return "" + } + return o.AccessToken +} + +func (o *AuthToken) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *AuthToken) GetScope() *string { + if o == nil { + return nil + } + return o.Scope +} + +func (o *AuthToken) GetTokenType() *string { + if o == nil { + return nil + } + return o.TokenType +} + +func (o *AuthToken) GetAuthUser() *string { + if o == nil { + return nil + } + return o.AuthUser +} + +func (o *AuthToken) GetExpiration() *int64 { + if o == nil { + return nil + } + return o.Expiration +} diff --git a/tests/mockserver/internal/sdk/models/components/autocompleterequest.go b/tests/mockserver/internal/sdk/models/components/autocompleterequest.go new file mode 100644 index 00000000..98c22584 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/autocompleterequest.go @@ -0,0 +1,141 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type AutocompleteRequestResultType string + +const ( + AutocompleteRequestResultTypeAdditionalDocument AutocompleteRequestResultType = "ADDITIONAL_DOCUMENT" + AutocompleteRequestResultTypeApp AutocompleteRequestResultType = "APP" + AutocompleteRequestResultTypeBrowserHistory AutocompleteRequestResultType = "BROWSER_HISTORY" + AutocompleteRequestResultTypeDatasource AutocompleteRequestResultType = "DATASOURCE" + AutocompleteRequestResultTypeDocument AutocompleteRequestResultType = "DOCUMENT" + AutocompleteRequestResultTypeEntity AutocompleteRequestResultType = "ENTITY" + AutocompleteRequestResultTypeGolink AutocompleteRequestResultType = "GOLINK" + AutocompleteRequestResultTypeHistory AutocompleteRequestResultType = "HISTORY" + AutocompleteRequestResultTypeNewChat AutocompleteRequestResultType = "NEW_CHAT" + AutocompleteRequestResultTypeOperator AutocompleteRequestResultType = "OPERATOR" + AutocompleteRequestResultTypeOperatorValue AutocompleteRequestResultType = "OPERATOR_VALUE" + AutocompleteRequestResultTypeQuicklink AutocompleteRequestResultType = "QUICKLINK" + AutocompleteRequestResultTypeSuggestion AutocompleteRequestResultType = "SUGGESTION" +) + +func (e AutocompleteRequestResultType) ToPointer() *AutocompleteRequestResultType { + return &e +} +func (e *AutocompleteRequestResultType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ADDITIONAL_DOCUMENT": + fallthrough + case "APP": + fallthrough + case "BROWSER_HISTORY": + fallthrough + case "DATASOURCE": + fallthrough + case "DOCUMENT": + fallthrough + case "ENTITY": + fallthrough + case "GOLINK": + fallthrough + case "HISTORY": + fallthrough + case "NEW_CHAT": + fallthrough + case "OPERATOR": + fallthrough + case "OPERATOR_VALUE": + fallthrough + case "QUICKLINK": + fallthrough + case "SUGGESTION": + *e = AutocompleteRequestResultType(v) + return nil + default: + return fmt.Errorf("invalid value for AutocompleteRequestResultType: %v", v) + } +} + +type AutocompleteRequest struct { + TrackingToken *string `json:"trackingToken,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + // Partially typed query. + Query *string `json:"query,omitempty"` + // Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). Results are unfiltered if missing. + DatasourcesFilter []string `json:"datasourcesFilter,omitempty"` + // Filter to only return results relevant to the given datasource. + Datasource *string `json:"datasource,omitempty"` + // Filter to only return results of the given type(s). All types may be returned if omitted. + ResultTypes []AutocompleteRequestResultType `json:"resultTypes,omitempty"` + // Maximum number of results to be returned. If no value is provided, the backend will cap at 200. + // + ResultSize *int64 `json:"resultSize,omitempty"` + // Auth tokens which may be used for federated results. + AuthTokens []AuthToken `json:"authTokens,omitempty"` +} + +func (o *AutocompleteRequest) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *AutocompleteRequest) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *AutocompleteRequest) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +func (o *AutocompleteRequest) GetDatasourcesFilter() []string { + if o == nil { + return nil + } + return o.DatasourcesFilter +} + +func (o *AutocompleteRequest) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *AutocompleteRequest) GetResultTypes() []AutocompleteRequestResultType { + if o == nil { + return nil + } + return o.ResultTypes +} + +func (o *AutocompleteRequest) GetResultSize() *int64 { + if o == nil { + return nil + } + return o.ResultSize +} + +func (o *AutocompleteRequest) GetAuthTokens() []AuthToken { + if o == nil { + return nil + } + return o.AuthTokens +} diff --git a/tests/mockserver/internal/sdk/models/components/autocompleteresponse.go b/tests/mockserver/internal/sdk/models/components/autocompleteresponse.go new file mode 100644 index 00000000..7e2ca2ff --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/autocompleteresponse.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AutocompleteResponse struct { + // List of experiment ids for the corresponding request. + ExperimentIds []int64 `json:"experimentIds,omitempty"` + // An opaque token that represents this particular set of autocomplete results. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + Results []AutocompleteResult `json:"results,omitempty"` + // Subsections of the results list from which distinct sections should be created. + Groups []AutocompleteResultGroup `json:"groups,omitempty"` + GleanDataError *GleanDataError `json:"errorInfo,omitempty"` + // Time in milliseconds the backend took to respond to the request. + BackendTimeMillis *int64 `json:"backendTimeMillis,omitempty"` +} + +func (o *AutocompleteResponse) GetExperimentIds() []int64 { + if o == nil { + return nil + } + return o.ExperimentIds +} + +func (o *AutocompleteResponse) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *AutocompleteResponse) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *AutocompleteResponse) GetResults() []AutocompleteResult { + if o == nil { + return nil + } + return o.Results +} + +func (o *AutocompleteResponse) GetGroups() []AutocompleteResultGroup { + if o == nil { + return nil + } + return o.Groups +} + +func (o *AutocompleteResponse) GetGleanDataError() *GleanDataError { + if o == nil { + return nil + } + return o.GleanDataError +} + +func (o *AutocompleteResponse) GetBackendTimeMillis() *int64 { + if o == nil { + return nil + } + return o.BackendTimeMillis +} diff --git a/tests/mockserver/internal/sdk/models/components/autocompleteresult.go b/tests/mockserver/internal/sdk/models/components/autocompleteresult.go new file mode 100644 index 00000000..9dec806a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/autocompleteresult.go @@ -0,0 +1,164 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type AutocompleteResultResultType string + +const ( + AutocompleteResultResultTypeAdditionalDocument AutocompleteResultResultType = "ADDITIONAL_DOCUMENT" + AutocompleteResultResultTypeApp AutocompleteResultResultType = "APP" + AutocompleteResultResultTypeBrowserHistory AutocompleteResultResultType = "BROWSER_HISTORY" + AutocompleteResultResultTypeDatasource AutocompleteResultResultType = "DATASOURCE" + AutocompleteResultResultTypeDocument AutocompleteResultResultType = "DOCUMENT" + AutocompleteResultResultTypeEntity AutocompleteResultResultType = "ENTITY" + AutocompleteResultResultTypeGolink AutocompleteResultResultType = "GOLINK" + AutocompleteResultResultTypeHistory AutocompleteResultResultType = "HISTORY" + AutocompleteResultResultTypeNewChat AutocompleteResultResultType = "NEW_CHAT" + AutocompleteResultResultTypeOperator AutocompleteResultResultType = "OPERATOR" + AutocompleteResultResultTypeOperatorValue AutocompleteResultResultType = "OPERATOR_VALUE" + AutocompleteResultResultTypeQuicklink AutocompleteResultResultType = "QUICKLINK" + AutocompleteResultResultTypeSuggestion AutocompleteResultResultType = "SUGGESTION" +) + +func (e AutocompleteResultResultType) ToPointer() *AutocompleteResultResultType { + return &e +} +func (e *AutocompleteResultResultType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ADDITIONAL_DOCUMENT": + fallthrough + case "APP": + fallthrough + case "BROWSER_HISTORY": + fallthrough + case "DATASOURCE": + fallthrough + case "DOCUMENT": + fallthrough + case "ENTITY": + fallthrough + case "GOLINK": + fallthrough + case "HISTORY": + fallthrough + case "NEW_CHAT": + fallthrough + case "OPERATOR": + fallthrough + case "OPERATOR_VALUE": + fallthrough + case "QUICKLINK": + fallthrough + case "SUGGESTION": + *e = AutocompleteResultResultType(v) + return nil + default: + return fmt.Errorf("invalid value for AutocompleteResultResultType: %v", v) + } +} + +type AutocompleteResult struct { + Result string `json:"result"` + // A list of all possible keywords for given result. + Keywords []string `json:"keywords,omitempty"` + ResultType *AutocompleteResultResultType `json:"resultType,omitempty"` + // Higher indicates a more confident match. + Score *float64 `json:"score,omitempty"` + OperatorMetadata *OperatorMetadata `json:"operatorMetadata,omitempty"` + // An action for a specific datasource that will show up in autocomplete and app card, e.g. "Create new issue" for jira. + Quicklink *Quicklink `json:"quicklink,omitempty"` + Document *Document `json:"document,omitempty"` + URL *string `json:"url,omitempty"` + // A single object that can support any object in the work graph. Only a single object will be populated. + StructuredResult *StructuredResult `json:"structuredResult,omitempty"` + // A token to be passed in /feedback events associated with this autocomplete result. + TrackingToken *string `json:"trackingToken,omitempty"` + // Subsections of the result string to which some special formatting should be applied (eg. bold) + Ranges []TextRange `json:"ranges,omitempty"` +} + +func (o *AutocompleteResult) GetResult() string { + if o == nil { + return "" + } + return o.Result +} + +func (o *AutocompleteResult) GetKeywords() []string { + if o == nil { + return nil + } + return o.Keywords +} + +func (o *AutocompleteResult) GetResultType() *AutocompleteResultResultType { + if o == nil { + return nil + } + return o.ResultType +} + +func (o *AutocompleteResult) GetScore() *float64 { + if o == nil { + return nil + } + return o.Score +} + +func (o *AutocompleteResult) GetOperatorMetadata() *OperatorMetadata { + if o == nil { + return nil + } + return o.OperatorMetadata +} + +func (o *AutocompleteResult) GetQuicklink() *Quicklink { + if o == nil { + return nil + } + return o.Quicklink +} + +func (o *AutocompleteResult) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} + +func (o *AutocompleteResult) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *AutocompleteResult) GetStructuredResult() *StructuredResult { + if o == nil { + return nil + } + return o.StructuredResult +} + +func (o *AutocompleteResult) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *AutocompleteResult) GetRanges() []TextRange { + if o == nil { + return nil + } + return o.Ranges +} diff --git a/tests/mockserver/internal/sdk/models/components/autocompleteresultgroup.go b/tests/mockserver/internal/sdk/models/components/autocompleteresultgroup.go new file mode 100644 index 00000000..fbf4682f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/autocompleteresultgroup.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// AutocompleteResultGroup - A subsection of the results list from which distinct sections should be created. +type AutocompleteResultGroup struct { + // The inclusive start index of the range. + StartIndex *int64 `json:"startIndex,omitempty"` + // The exclusive end index of the range. + EndIndex *int64 `json:"endIndex,omitempty"` + // The title of the result group to be displayed. Empty means no title. + Title *string `json:"title,omitempty"` +} + +func (o *AutocompleteResultGroup) GetStartIndex() *int64 { + if o == nil { + return nil + } + return o.StartIndex +} + +func (o *AutocompleteResultGroup) GetEndIndex() *int64 { + if o == nil { + return nil + } + return o.EndIndex +} + +func (o *AutocompleteResultGroup) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} diff --git a/tests/mockserver/internal/sdk/models/components/badge.go b/tests/mockserver/internal/sdk/models/components/badge.go new file mode 100644 index 00000000..08fc19de --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/badge.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Badge - Displays a user's accomplishment or milestone +type Badge struct { + // An auto generated unique identifier. + Key *string `json:"key,omitempty"` + // The badge name displayed to users + DisplayName *string `json:"displayName,omitempty"` + // Defines how to render an icon + IconConfig *IconConfig `json:"iconConfig,omitempty"` + // The badge should be shown on the PersonAttribution + Pinned *bool `json:"pinned,omitempty"` +} + +func (o *Badge) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Badge) GetDisplayName() *string { + if o == nil { + return nil + } + return o.DisplayName +} + +func (o *Badge) GetIconConfig() *IconConfig { + if o == nil { + return nil + } + return o.IconConfig +} + +func (o *Badge) GetPinned() *bool { + if o == nil { + return nil + } + return o.Pinned +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkindexdocumentsrequest.go b/tests/mockserver/internal/sdk/models/components/bulkindexdocumentsrequest.go new file mode 100644 index 00000000..66aa01e5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkindexdocumentsrequest.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BulkIndexDocumentsRequest - Describes the request body of the /bulkindexdocuments API call +type BulkIndexDocumentsRequest struct { + // Unique id that must be used for this bulk upload instance + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // Datasource of the documents + Datasource string `json:"datasource"` + // Batch of documents for the datasource + Documents []DocumentDefinition `json:"documents"` + // True if older documents need to be force deleted after the upload completes. Defaults to older documents being deleted asynchronously. This must only be set when `isLastPage = true` + DisableStaleDocumentDeletionCheck *bool `json:"disableStaleDocumentDeletionCheck,omitempty"` +} + +func (o *BulkIndexDocumentsRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *BulkIndexDocumentsRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *BulkIndexDocumentsRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *BulkIndexDocumentsRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *BulkIndexDocumentsRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *BulkIndexDocumentsRequest) GetDocuments() []DocumentDefinition { + if o == nil { + return []DocumentDefinition{} + } + return o.Documents +} + +func (o *BulkIndexDocumentsRequest) GetDisableStaleDocumentDeletionCheck() *bool { + if o == nil { + return nil + } + return o.DisableStaleDocumentDeletionCheck +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkindexemployeesrequest.go b/tests/mockserver/internal/sdk/models/components/bulkindexemployeesrequest.go new file mode 100644 index 00000000..84b2d85a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkindexemployeesrequest.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BulkIndexEmployeesRequest - Describes the request body of the /bulkindexemployees API call +type BulkIndexEmployeesRequest struct { + // Unique id that must be used for this bulk upload instance + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // Batch of employee information + Employees []EmployeeInfoDefinition `json:"employees"` + // True if older employee data needs to be force deleted after the upload completes. Defaults to older data being deleted only if the percentage of data being deleted is less than 20%. This must only be set when `isLastPage = true` + DisableStaleDataDeletionCheck *bool `json:"disableStaleDataDeletionCheck,omitempty"` +} + +func (o *BulkIndexEmployeesRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *BulkIndexEmployeesRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *BulkIndexEmployeesRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *BulkIndexEmployeesRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *BulkIndexEmployeesRequest) GetEmployees() []EmployeeInfoDefinition { + if o == nil { + return []EmployeeInfoDefinition{} + } + return o.Employees +} + +func (o *BulkIndexEmployeesRequest) GetDisableStaleDataDeletionCheck() *bool { + if o == nil { + return nil + } + return o.DisableStaleDataDeletionCheck +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkindexgroupsrequest.go b/tests/mockserver/internal/sdk/models/components/bulkindexgroupsrequest.go new file mode 100644 index 00000000..b528cd39 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkindexgroupsrequest.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BulkIndexGroupsRequest - Describes the request body for the /bulkindexgroups API call +type BulkIndexGroupsRequest struct { + // Unique id that must be used for this instance of datasource groups upload + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // datasource of the groups + Datasource string `json:"datasource"` + // batch of groups for the datasource + Groups []DatasourceGroupDefinition `json:"groups"` + // True if older group data needs to be force deleted after the upload completes. Defaults to older data being deleted only if the percentage of data being deleted is less than a reasonable threshold. This must only be set when `isLastPage = true` + DisableStaleDataDeletionCheck *bool `json:"disableStaleDataDeletionCheck,omitempty"` +} + +func (o *BulkIndexGroupsRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *BulkIndexGroupsRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *BulkIndexGroupsRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *BulkIndexGroupsRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *BulkIndexGroupsRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *BulkIndexGroupsRequest) GetGroups() []DatasourceGroupDefinition { + if o == nil { + return []DatasourceGroupDefinition{} + } + return o.Groups +} + +func (o *BulkIndexGroupsRequest) GetDisableStaleDataDeletionCheck() *bool { + if o == nil { + return nil + } + return o.DisableStaleDataDeletionCheck +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkindexmembershipsrequest.go b/tests/mockserver/internal/sdk/models/components/bulkindexmembershipsrequest.go new file mode 100644 index 00000000..3132cb23 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkindexmembershipsrequest.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BulkIndexMembershipsRequest - Describes the request body for the /bulkindexmemberships API call +type BulkIndexMembershipsRequest struct { + // Unique id that must be used for this instance of datasource group memberships upload + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // datasource of the memberships + Datasource string `json:"datasource"` + // group who's memberships are specified + Group *string `json:"group,omitempty"` + // batch of memberships for the group + Memberships []DatasourceBulkMembershipDefinition `json:"memberships"` +} + +func (o *BulkIndexMembershipsRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *BulkIndexMembershipsRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *BulkIndexMembershipsRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *BulkIndexMembershipsRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *BulkIndexMembershipsRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *BulkIndexMembershipsRequest) GetGroup() *string { + if o == nil { + return nil + } + return o.Group +} + +func (o *BulkIndexMembershipsRequest) GetMemberships() []DatasourceBulkMembershipDefinition { + if o == nil { + return []DatasourceBulkMembershipDefinition{} + } + return o.Memberships +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkindexshortcutsrequest.go b/tests/mockserver/internal/sdk/models/components/bulkindexshortcutsrequest.go new file mode 100644 index 00000000..6a4ab205 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkindexshortcutsrequest.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BulkIndexShortcutsRequest - Describes the request body of the /bulkindexshortcuts API call +type BulkIndexShortcutsRequest struct { + // Unique id that must be used for this bulk upload instance + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // Batch of shortcuts information + Shortcuts []ExternalShortcut `json:"shortcuts"` +} + +func (o *BulkIndexShortcutsRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *BulkIndexShortcutsRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *BulkIndexShortcutsRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *BulkIndexShortcutsRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *BulkIndexShortcutsRequest) GetShortcuts() []ExternalShortcut { + if o == nil { + return []ExternalShortcut{} + } + return o.Shortcuts +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkindexteamsrequest.go b/tests/mockserver/internal/sdk/models/components/bulkindexteamsrequest.go new file mode 100644 index 00000000..0acb6475 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkindexteamsrequest.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BulkIndexTeamsRequest - Describes the request body of the /bulkindexteams API call +type BulkIndexTeamsRequest struct { + // Unique id that must be used for this bulk upload instance + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // Batch of team information + Teams []TeamInfoDefinition `json:"teams"` +} + +func (o *BulkIndexTeamsRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *BulkIndexTeamsRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *BulkIndexTeamsRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *BulkIndexTeamsRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *BulkIndexTeamsRequest) GetTeams() []TeamInfoDefinition { + if o == nil { + return []TeamInfoDefinition{} + } + return o.Teams +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkindexusersrequest.go b/tests/mockserver/internal/sdk/models/components/bulkindexusersrequest.go new file mode 100644 index 00000000..c94ddd90 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkindexusersrequest.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BulkIndexUsersRequest - Describes the request body for the /bulkindexusers API call +type BulkIndexUsersRequest struct { + // Unique id that must be used for this instance of datasource users upload + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // datasource of the users + Datasource string `json:"datasource"` + // batch of users for the datasource + Users []DatasourceUserDefinition `json:"users"` + // True if older user data needs to be force deleted after the upload completes. Defaults to older data being deleted only if the percentage of data being deleted is less than a reasonable threshold. This must only be set when `isLastPage = true` + DisableStaleDataDeletionCheck *bool `json:"disableStaleDataDeletionCheck,omitempty"` +} + +func (o *BulkIndexUsersRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *BulkIndexUsersRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *BulkIndexUsersRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *BulkIndexUsersRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *BulkIndexUsersRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *BulkIndexUsersRequest) GetUsers() []DatasourceUserDefinition { + if o == nil { + return []DatasourceUserDefinition{} + } + return o.Users +} + +func (o *BulkIndexUsersRequest) GetDisableStaleDataDeletionCheck() *bool { + if o == nil { + return nil + } + return o.DisableStaleDataDeletionCheck +} diff --git a/tests/mockserver/internal/sdk/models/components/bulkuploadhistoryevent.go b/tests/mockserver/internal/sdk/models/components/bulkuploadhistoryevent.go new file mode 100644 index 00000000..9f7711f3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/bulkuploadhistoryevent.go @@ -0,0 +1,123 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// BulkUploadHistoryEventStatus - The status of the upload, an enum of ACTIVE, SUCCESSFUL +type BulkUploadHistoryEventStatus string + +const ( + BulkUploadHistoryEventStatusActive BulkUploadHistoryEventStatus = "ACTIVE" + BulkUploadHistoryEventStatusSuccessful BulkUploadHistoryEventStatus = "SUCCESSFUL" +) + +func (e BulkUploadHistoryEventStatus) ToPointer() *BulkUploadHistoryEventStatus { + return &e +} +func (e *BulkUploadHistoryEventStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ACTIVE": + fallthrough + case "SUCCESSFUL": + *e = BulkUploadHistoryEventStatus(v) + return nil + default: + return fmt.Errorf("invalid value for BulkUploadHistoryEventStatus: %v", v) + } +} + +// ProcessingState - The current state of the upload, an enum of UNAVAILABLE, UPLOAD STARTED, UPLOAD IN PROGRESS, UPLOAD COMPLETED, DELETION PAUSED, INDEXING COMPLETED +type ProcessingState string + +const ( + ProcessingStateUnavailable ProcessingState = "UNAVAILABLE" + ProcessingStateUploadStarted ProcessingState = "UPLOAD STARTED" + ProcessingStateUploadInProgress ProcessingState = "UPLOAD IN PROGRESS" + ProcessingStateUploadCompleted ProcessingState = "UPLOAD COMPLETED" + ProcessingStateDeletionPaused ProcessingState = "DELETION PAUSED" + ProcessingStateIndexingCompleted ProcessingState = "INDEXING COMPLETED" +) + +func (e ProcessingState) ToPointer() *ProcessingState { + return &e +} +func (e *ProcessingState) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UNAVAILABLE": + fallthrough + case "UPLOAD STARTED": + fallthrough + case "UPLOAD IN PROGRESS": + fallthrough + case "UPLOAD COMPLETED": + fallthrough + case "DELETION PAUSED": + fallthrough + case "INDEXING COMPLETED": + *e = ProcessingState(v) + return nil + default: + return fmt.Errorf("invalid value for ProcessingState: %v", v) + } +} + +// BulkUploadHistoryEvent - Information about a successful bulk upload +type BulkUploadHistoryEvent struct { + // The unique ID of the upload + UploadID *string `json:"uploadId,omitempty"` + // The start time of the upload in ISO 8601 format + StartTime *string `json:"startTime,omitempty"` + // The end time of the upload in ISO 8601 format, 'NA' if the upload is still active + EndTime *string `json:"endTime,omitempty"` + // The status of the upload, an enum of ACTIVE, SUCCESSFUL + Status *BulkUploadHistoryEventStatus `json:"status,omitempty"` + // The current state of the upload, an enum of UNAVAILABLE, UPLOAD STARTED, UPLOAD IN PROGRESS, UPLOAD COMPLETED, DELETION PAUSED, INDEXING COMPLETED + ProcessingState *ProcessingState `json:"processingState,omitempty"` +} + +func (o *BulkUploadHistoryEvent) GetUploadID() *string { + if o == nil { + return nil + } + return o.UploadID +} + +func (o *BulkUploadHistoryEvent) GetStartTime() *string { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *BulkUploadHistoryEvent) GetEndTime() *string { + if o == nil { + return nil + } + return o.EndTime +} + +func (o *BulkUploadHistoryEvent) GetStatus() *BulkUploadHistoryEventStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *BulkUploadHistoryEvent) GetProcessingState() *ProcessingState { + if o == nil { + return nil + } + return o.ProcessingState +} diff --git a/tests/mockserver/internal/sdk/models/components/calendarattendee.go b/tests/mockserver/internal/sdk/models/components/calendarattendee.go new file mode 100644 index 00000000..01825957 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/calendarattendee.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type ResponseStatus string + +const ( + ResponseStatusAccepted ResponseStatus = "ACCEPTED" + ResponseStatusDeclined ResponseStatus = "DECLINED" + ResponseStatusNoResponse ResponseStatus = "NO_RESPONSE" + ResponseStatusTentative ResponseStatus = "TENTATIVE" +) + +func (e ResponseStatus) ToPointer() *ResponseStatus { + return &e +} +func (e *ResponseStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ACCEPTED": + fallthrough + case "DECLINED": + fallthrough + case "NO_RESPONSE": + fallthrough + case "TENTATIVE": + *e = ResponseStatus(v) + return nil + default: + return fmt.Errorf("invalid value for ResponseStatus: %v", v) + } +} + +type CalendarAttendee struct { + // Whether or not this attendee is an organizer. + IsOrganizer *bool `json:"isOrganizer,omitempty"` + // Whether or not this attendee is in a group. Needed temporarily at least to support both flat attendees and tree for compatibility. + IsInGroup *bool `json:"isInGroup,omitempty"` + Person Person `json:"person"` + // If this attendee is a group, represents the list of individual attendees in the group. + GroupAttendees []CalendarAttendee `json:"groupAttendees,omitempty"` + ResponseStatus *ResponseStatus `json:"responseStatus,omitempty"` +} + +func (o *CalendarAttendee) GetIsOrganizer() *bool { + if o == nil { + return nil + } + return o.IsOrganizer +} + +func (o *CalendarAttendee) GetIsInGroup() *bool { + if o == nil { + return nil + } + return o.IsInGroup +} + +func (o *CalendarAttendee) GetPerson() Person { + if o == nil { + return Person{} + } + return o.Person +} + +func (o *CalendarAttendee) GetGroupAttendees() []CalendarAttendee { + if o == nil { + return nil + } + return o.GroupAttendees +} + +func (o *CalendarAttendee) GetResponseStatus() *ResponseStatus { + if o == nil { + return nil + } + return o.ResponseStatus +} diff --git a/tests/mockserver/internal/sdk/models/components/calendarattendees.go b/tests/mockserver/internal/sdk/models/components/calendarattendees.go new file mode 100644 index 00000000..a0cfc7ad --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/calendarattendees.go @@ -0,0 +1,69 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CalendarAttendees struct { + // Full details of some of the attendees of this event + People []CalendarAttendee `json:"people,omitempty"` + // Whether the total count of the people returned is at the retrieval limit. + IsLimit *bool `json:"isLimit,omitempty"` + // Total number of attendees in this event. + Total *int64 `json:"total,omitempty"` + // Total number of attendees who have accepted this event. + NumAccepted *int64 `json:"numAccepted,omitempty"` + // Total number of attendees who have declined this event. + NumDeclined *int64 `json:"numDeclined,omitempty"` + // Total number of attendees who have not responded to this event. + NumNoResponse *int64 `json:"numNoResponse,omitempty"` + // Total number of attendees who have responded tentatively (i.e. responded maybe) to this event. + NumTentative *int64 `json:"numTentative,omitempty"` +} + +func (o *CalendarAttendees) GetPeople() []CalendarAttendee { + if o == nil { + return nil + } + return o.People +} + +func (o *CalendarAttendees) GetIsLimit() *bool { + if o == nil { + return nil + } + return o.IsLimit +} + +func (o *CalendarAttendees) GetTotal() *int64 { + if o == nil { + return nil + } + return o.Total +} + +func (o *CalendarAttendees) GetNumAccepted() *int64 { + if o == nil { + return nil + } + return o.NumAccepted +} + +func (o *CalendarAttendees) GetNumDeclined() *int64 { + if o == nil { + return nil + } + return o.NumDeclined +} + +func (o *CalendarAttendees) GetNumNoResponse() *int64 { + if o == nil { + return nil + } + return o.NumNoResponse +} + +func (o *CalendarAttendees) GetNumTentative() *int64 { + if o == nil { + return nil + } + return o.NumTentative +} diff --git a/tests/mockserver/internal/sdk/models/components/calendarevent.go b/tests/mockserver/internal/sdk/models/components/calendarevent.go new file mode 100644 index 00000000..33ac7433 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/calendarevent.go @@ -0,0 +1,151 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// CalendarEventEventType - The nature of the event, for example "out of office". +type CalendarEventEventType string + +const ( + CalendarEventEventTypeDefault CalendarEventEventType = "DEFAULT" + CalendarEventEventTypeOutOfOffice CalendarEventEventType = "OUT_OF_OFFICE" +) + +func (e CalendarEventEventType) ToPointer() *CalendarEventEventType { + return &e +} +func (e *CalendarEventEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DEFAULT": + fallthrough + case "OUT_OF_OFFICE": + *e = CalendarEventEventType(v) + return nil + default: + return fmt.Errorf("invalid value for CalendarEventEventType: %v", v) + } +} + +// CalendarEvent - A generic, light-weight calendar event. +type CalendarEvent struct { + Time *TimeInterval `json:"time,omitempty"` + // The nature of the event, for example "out of office". + EventType *CalendarEventEventType `json:"eventType,omitempty"` + // The calendar event id + ID string `json:"id"` + // A permalink for this calendar event + URL string `json:"url"` + Attendees *CalendarAttendees `json:"attendees,omitempty"` + // The location that this event is taking place at. + Location *string `json:"location,omitempty"` + ConferenceData *ConferenceData `json:"conferenceData,omitempty"` + // The HTML description of the event. + Description *string `json:"description,omitempty"` + // The app or other repository type from which the event was extracted + Datasource *string `json:"datasource,omitempty"` + // The event has a transcript associated with it enabling features like summarization + HasTranscript *bool `json:"hasTranscript,omitempty"` + // A link to the transcript of the event + TranscriptURL *string `json:"transcriptUrl,omitempty"` + Classifications []EventClassification `json:"classifications,omitempty"` + GeneratedAttachments []GeneratedAttachment `json:"generatedAttachments,omitempty"` +} + +func (o *CalendarEvent) GetTime() *TimeInterval { + if o == nil { + return nil + } + return o.Time +} + +func (o *CalendarEvent) GetEventType() *CalendarEventEventType { + if o == nil { + return nil + } + return o.EventType +} + +func (o *CalendarEvent) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *CalendarEvent) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +func (o *CalendarEvent) GetAttendees() *CalendarAttendees { + if o == nil { + return nil + } + return o.Attendees +} + +func (o *CalendarEvent) GetLocation() *string { + if o == nil { + return nil + } + return o.Location +} + +func (o *CalendarEvent) GetConferenceData() *ConferenceData { + if o == nil { + return nil + } + return o.ConferenceData +} + +func (o *CalendarEvent) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *CalendarEvent) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *CalendarEvent) GetHasTranscript() *bool { + if o == nil { + return nil + } + return o.HasTranscript +} + +func (o *CalendarEvent) GetTranscriptURL() *string { + if o == nil { + return nil + } + return o.TranscriptURL +} + +func (o *CalendarEvent) GetClassifications() []EventClassification { + if o == nil { + return nil + } + return o.Classifications +} + +func (o *CalendarEvent) GetGeneratedAttachments() []GeneratedAttachment { + if o == nil { + return nil + } + return o.GeneratedAttachments +} diff --git a/tests/mockserver/internal/sdk/models/components/canonicalizingregextype.go b/tests/mockserver/internal/sdk/models/components/canonicalizingregextype.go new file mode 100644 index 00000000..76692d38 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/canonicalizingregextype.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// CanonicalizingRegexType - Regular expression to apply to an arbitrary string to transform it into a canonical string. +type CanonicalizingRegexType struct { + // Regular expression to match to an arbitrary string. + MatchRegex *string `json:"matchRegex,omitempty"` + // Regular expression to transform into a canonical string. + RewriteRegex *string `json:"rewriteRegex,omitempty"` +} + +func (o *CanonicalizingRegexType) GetMatchRegex() *string { + if o == nil { + return nil + } + return o.MatchRegex +} + +func (o *CanonicalizingRegexType) GetRewriteRegex() *string { + if o == nil { + return nil + } + return o.RewriteRegex +} diff --git a/tests/mockserver/internal/sdk/models/components/channelinviteinfo.go b/tests/mockserver/internal/sdk/models/components/channelinviteinfo.go new file mode 100644 index 00000000..099ff0bb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/channelinviteinfo.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// ChannelInviteInfo - Information regarding the invite status of a person for a particular channel. +type ChannelInviteInfo struct { + Channel *CommunicationChannel `json:"channel,omitempty"` + // Bit that tracks if this invite was automatically sent or user-sent + IsAutoInvite *bool `json:"isAutoInvite,omitempty"` + Inviter *Person `json:"inviter,omitempty"` + // The time this person was invited in ISO format (ISO 8601). + InviteTime *time.Time `json:"inviteTime,omitempty"` + // The time this person was reminded in ISO format (ISO 8601) if a reminder was sent. + ReminderTime *time.Time `json:"reminderTime,omitempty"` +} + +func (c ChannelInviteInfo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ChannelInviteInfo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ChannelInviteInfo) GetChannel() *CommunicationChannel { + if o == nil { + return nil + } + return o.Channel +} + +func (o *ChannelInviteInfo) GetIsAutoInvite() *bool { + if o == nil { + return nil + } + return o.IsAutoInvite +} + +func (o *ChannelInviteInfo) GetInviter() *Person { + if o == nil { + return nil + } + return o.Inviter +} + +func (o *ChannelInviteInfo) GetInviteTime() *time.Time { + if o == nil { + return nil + } + return o.InviteTime +} + +func (o *ChannelInviteInfo) GetReminderTime() *time.Time { + if o == nil { + return nil + } + return o.ReminderTime +} diff --git a/tests/mockserver/internal/sdk/models/components/chat.go b/tests/mockserver/internal/sdk/models/components/chat.go new file mode 100644 index 00000000..316d4889 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chat.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Chat - A historical representation of a series of chat messages a user had with Glean Assistant. +type Chat struct { + // The opaque id of the Chat. + ID *string `json:"id,omitempty"` + // Server Unix timestamp of the creation time (in seconds since epoch UTC). + CreateTime *int64 `json:"createTime,omitempty"` + CreatedBy *Person `json:"createdBy,omitempty"` + // Server Unix timestamp of the update time (in seconds since epoch UTC). + UpdateTime *int64 `json:"updateTime,omitempty"` + // The name of the Chat. + Name *string `json:"name,omitempty"` + // The ID of the AI App that this Chat is associated to. + ApplicationID *string `json:"applicationId,omitempty"` + // The display name of the AI App that this Chat is associated to. + ApplicationName *string `json:"applicationName,omitempty"` + // Defines how to render an icon + Icon *IconConfig `json:"icon,omitempty"` + // The chat messages within a Chat. + Messages []ChatMessage `json:"messages,omitempty"` +} + +func (o *Chat) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Chat) GetCreateTime() *int64 { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *Chat) GetCreatedBy() *Person { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *Chat) GetUpdateTime() *int64 { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *Chat) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *Chat) GetApplicationID() *string { + if o == nil { + return nil + } + return o.ApplicationID +} + +func (o *Chat) GetApplicationName() *string { + if o == nil { + return nil + } + return o.ApplicationName +} + +func (o *Chat) GetIcon() *IconConfig { + if o == nil { + return nil + } + return o.Icon +} + +func (o *Chat) GetMessages() []ChatMessage { + if o == nil { + return nil + } + return o.Messages +} diff --git a/tests/mockserver/internal/sdk/models/components/chatfile.go b/tests/mockserver/internal/sdk/models/components/chatfile.go new file mode 100644 index 00000000..7ea76ec3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatfile.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ChatFile - Structure for file uploaded by a user for Chat. +type ChatFile struct { + // Unique identifier of the file. + ID *string `json:"id,omitempty"` + // Url of the file. + URL *string `json:"url,omitempty"` + // Name of the uploaded file. + Name *string `json:"name,omitempty"` + // Metadata of a file uploaded by a user for Chat. + Metadata *ChatFileMetadata `json:"metadata,omitempty"` +} + +func (o *ChatFile) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *ChatFile) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *ChatFile) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ChatFile) GetMetadata() *ChatFileMetadata { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/tests/mockserver/internal/sdk/models/components/chatfilefailurereason.go b/tests/mockserver/internal/sdk/models/components/chatfilefailurereason.go new file mode 100644 index 00000000..a5a23627 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatfilefailurereason.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ChatFileFailureReason - Reason for failed status. +type ChatFileFailureReason string + +const ( + ChatFileFailureReasonParseFailed ChatFileFailureReason = "PARSE_FAILED" + ChatFileFailureReasonAvScanFailed ChatFileFailureReason = "AV_SCAN_FAILED" + ChatFileFailureReasonFileTooSmall ChatFileFailureReason = "FILE_TOO_SMALL" + ChatFileFailureReasonFileTooLarge ChatFileFailureReason = "FILE_TOO_LARGE" + ChatFileFailureReasonFileExtensionUnsupported ChatFileFailureReason = "FILE_EXTENSION_UNSUPPORTED" + ChatFileFailureReasonFileMetadataValidationFail ChatFileFailureReason = "FILE_METADATA_VALIDATION_FAIL" + ChatFileFailureReasonFileProcessingTimedOut ChatFileFailureReason = "FILE_PROCESSING_TIMED_OUT" +) + +func (e ChatFileFailureReason) ToPointer() *ChatFileFailureReason { + return &e +} +func (e *ChatFileFailureReason) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PARSE_FAILED": + fallthrough + case "AV_SCAN_FAILED": + fallthrough + case "FILE_TOO_SMALL": + fallthrough + case "FILE_TOO_LARGE": + fallthrough + case "FILE_EXTENSION_UNSUPPORTED": + fallthrough + case "FILE_METADATA_VALIDATION_FAIL": + fallthrough + case "FILE_PROCESSING_TIMED_OUT": + *e = ChatFileFailureReason(v) + return nil + default: + return fmt.Errorf("invalid value for ChatFileFailureReason: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/chatfilemetadata.go b/tests/mockserver/internal/sdk/models/components/chatfilemetadata.go new file mode 100644 index 00000000..55c746ec --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatfilemetadata.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ChatFileMetadata - Metadata of a file uploaded by a user for Chat. +type ChatFileMetadata struct { + // Current status of the file. + Status *ChatFileStatus `json:"status,omitempty"` + // Upload time, in epoch seconds. + UploadTime *int64 `json:"uploadTime,omitempty"` + // Size of the processed file in bytes. + ProcessedSize *int64 `json:"processedSize,omitempty"` + // Reason for failed status. + FailureReason *ChatFileFailureReason `json:"failureReason,omitempty"` + // MIME type of the file. + MimeType *string `json:"mimeType,omitempty"` +} + +func (o *ChatFileMetadata) GetStatus() *ChatFileStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *ChatFileMetadata) GetUploadTime() *int64 { + if o == nil { + return nil + } + return o.UploadTime +} + +func (o *ChatFileMetadata) GetProcessedSize() *int64 { + if o == nil { + return nil + } + return o.ProcessedSize +} + +func (o *ChatFileMetadata) GetFailureReason() *ChatFileFailureReason { + if o == nil { + return nil + } + return o.FailureReason +} + +func (o *ChatFileMetadata) GetMimeType() *string { + if o == nil { + return nil + } + return o.MimeType +} diff --git a/tests/mockserver/internal/sdk/models/components/chatfilestatus.go b/tests/mockserver/internal/sdk/models/components/chatfilestatus.go new file mode 100644 index 00000000..7f192a89 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatfilestatus.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ChatFileStatus - Current status of the file. +type ChatFileStatus string + +const ( + ChatFileStatusProcessing ChatFileStatus = "PROCESSING" + ChatFileStatusProcessed ChatFileStatus = "PROCESSED" + ChatFileStatusFailed ChatFileStatus = "FAILED" + ChatFileStatusDeleted ChatFileStatus = "DELETED" +) + +func (e ChatFileStatus) ToPointer() *ChatFileStatus { + return &e +} +func (e *ChatFileStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PROCESSING": + fallthrough + case "PROCESSED": + fallthrough + case "FAILED": + fallthrough + case "DELETED": + *e = ChatFileStatus(v) + return nil + default: + return fmt.Errorf("invalid value for ChatFileStatus: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/chatmessage.go b/tests/mockserver/internal/sdk/models/components/chatmessage.go new file mode 100644 index 00000000..01c82979 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatmessage.go @@ -0,0 +1,186 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +type Author string + +const ( + AuthorUser Author = "USER" + AuthorGleanAi Author = "GLEAN_AI" +) + +func (e Author) ToPointer() *Author { + return &e +} +func (e *Author) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "USER": + fallthrough + case "GLEAN_AI": + *e = Author(v) + return nil + default: + return fmt.Errorf("invalid value for Author: %v", v) + } +} + +// MessageType - Semantically groups content of a certain type. It can be used for purposes such as differential UI treatment. USER authored messages should be of type CONTENT and do not need `messageType` specified. +type MessageType string + +const ( + MessageTypeUpdate MessageType = "UPDATE" + MessageTypeContent MessageType = "CONTENT" + MessageTypeContext MessageType = "CONTEXT" + MessageTypeDebug MessageType = "DEBUG" + MessageTypeDebugExternal MessageType = "DEBUG_EXTERNAL" + MessageTypeError MessageType = "ERROR" + MessageTypeHeading MessageType = "HEADING" + MessageTypeWarning MessageType = "WARNING" +) + +func (e MessageType) ToPointer() *MessageType { + return &e +} +func (e *MessageType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UPDATE": + fallthrough + case "CONTENT": + fallthrough + case "CONTEXT": + fallthrough + case "DEBUG": + fallthrough + case "DEBUG_EXTERNAL": + fallthrough + case "ERROR": + fallthrough + case "HEADING": + fallthrough + case "WARNING": + *e = MessageType(v) + return nil + default: + return fmt.Errorf("invalid value for MessageType: %v", v) + } +} + +// ChatMessage - A message that is rendered as one coherent unit with one given sender. +type ChatMessage struct { + // Describes the agent that executes the request. + AgentConfig *AgentConfig `json:"agentConfig,omitempty"` + Author *Author `default:"USER" json:"author"` + // A list of Citations that were used to generate the response. + Citations []ChatMessageCitation `json:"citations,omitempty"` + // IDs of files uploaded in the message that are referenced to generate the answer. + UploadedFileIds []string `json:"uploadedFileIds,omitempty"` + // A list of rich data used to represent the response or formulate a request. These are linearly stitched together to support richer data formats beyond simple text. + Fragments []ChatMessageFragment `json:"fragments,omitempty"` + // Response timestamp of the message. + Ts *string `json:"ts,omitempty"` + // A unique server-side generated ID used to identify a message, automatically populated for any USER authored messages. + MessageID *string `json:"messageId,omitempty"` + // Opaque tracking token generated server-side. + MessageTrackingToken *string `json:"messageTrackingToken,omitempty"` + // Semantically groups content of a certain type. It can be used for purposes such as differential UI treatment. USER authored messages should be of type CONTENT and do not need `messageType` specified. + MessageType *MessageType `default:"CONTENT" json:"messageType"` + // Signals there are additional response fragments incoming. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + HasMoreFragments *bool `json:"hasMoreFragments,omitempty"` +} + +func (c ChatMessage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ChatMessage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ChatMessage) GetAgentConfig() *AgentConfig { + if o == nil { + return nil + } + return o.AgentConfig +} + +func (o *ChatMessage) GetAuthor() *Author { + if o == nil { + return nil + } + return o.Author +} + +func (o *ChatMessage) GetCitations() []ChatMessageCitation { + if o == nil { + return nil + } + return o.Citations +} + +func (o *ChatMessage) GetUploadedFileIds() []string { + if o == nil { + return nil + } + return o.UploadedFileIds +} + +func (o *ChatMessage) GetFragments() []ChatMessageFragment { + if o == nil { + return nil + } + return o.Fragments +} + +func (o *ChatMessage) GetTs() *string { + if o == nil { + return nil + } + return o.Ts +} + +func (o *ChatMessage) GetMessageID() *string { + if o == nil { + return nil + } + return o.MessageID +} + +func (o *ChatMessage) GetMessageTrackingToken() *string { + if o == nil { + return nil + } + return o.MessageTrackingToken +} + +func (o *ChatMessage) GetMessageType() *MessageType { + if o == nil { + return nil + } + return o.MessageType +} + +func (o *ChatMessage) GetHasMoreFragments() *bool { + if o == nil { + return nil + } + return o.HasMoreFragments +} diff --git a/tests/mockserver/internal/sdk/models/components/chatmessagecitation.go b/tests/mockserver/internal/sdk/models/components/chatmessagecitation.go new file mode 100644 index 00000000..fd3e6a32 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatmessagecitation.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ChatMessageCitation - Information about the source for a ChatMessage. +type ChatMessageCitation struct { + // An opaque token that represents this particular result in this particular ChatMessage. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` + SourceDocument *Document `json:"sourceDocument,omitempty"` + // Structure for file uploaded by a user for Chat. + SourceFile *ChatFile `json:"sourceFile,omitempty"` + SourcePerson *Person `json:"sourcePerson,omitempty"` + // Each reference range and its corresponding snippets + ReferenceRanges []ReferenceRange `json:"referenceRanges,omitempty"` +} + +func (o *ChatMessageCitation) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *ChatMessageCitation) GetSourceDocument() *Document { + if o == nil { + return nil + } + return o.SourceDocument +} + +func (o *ChatMessageCitation) GetSourceFile() *ChatFile { + if o == nil { + return nil + } + return o.SourceFile +} + +func (o *ChatMessageCitation) GetSourcePerson() *Person { + if o == nil { + return nil + } + return o.SourcePerson +} + +func (o *ChatMessageCitation) GetReferenceRanges() []ReferenceRange { + if o == nil { + return nil + } + return o.ReferenceRanges +} diff --git a/tests/mockserver/internal/sdk/models/components/chatmessagefragment.go b/tests/mockserver/internal/sdk/models/components/chatmessagefragment.go new file mode 100644 index 00000000..e164fc2d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatmessagefragment.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ChatMessageFragment - Represents a part of a ChatMessage that originates from a single action/tool. It is designed to support rich data formats beyond simple text, allowing for a more dynamic and interactive chat experience. Each fragment can include various types of content, such as text, search queries, action information, and more. Also, each ChatMessageFragment should only have one of structuredResults, querySuggestion, writeAction, followupAction, or file. +type ChatMessageFragment struct { + // An array of entities in the work graph retrieved via a data request. + StructuredResults []StructuredResult `json:"structuredResults,omitempty"` + // An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` + Text *string `json:"text,omitempty"` + QuerySuggestion *QuerySuggestion `json:"querySuggestion,omitempty"` + // Structure for file uploaded by a user for Chat. + File *ChatFile `json:"file,omitempty"` + Action *ToolInfo `json:"action,omitempty"` +} + +func (o *ChatMessageFragment) GetStructuredResults() []StructuredResult { + if o == nil { + return nil + } + return o.StructuredResults +} + +func (o *ChatMessageFragment) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *ChatMessageFragment) GetText() *string { + if o == nil { + return nil + } + return o.Text +} + +func (o *ChatMessageFragment) GetQuerySuggestion() *QuerySuggestion { + if o == nil { + return nil + } + return o.QuerySuggestion +} + +func (o *ChatMessageFragment) GetFile() *ChatFile { + if o == nil { + return nil + } + return o.File +} + +func (o *ChatMessageFragment) GetAction() *ToolInfo { + if o == nil { + return nil + } + return o.Action +} diff --git a/tests/mockserver/internal/sdk/models/components/chatmetadata.go b/tests/mockserver/internal/sdk/models/components/chatmetadata.go new file mode 100644 index 00000000..b2b298bf --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatmetadata.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ChatMetadata - Metadata of a Chat a user had with Glean Assistant. This contains no actual conversational content. +type ChatMetadata struct { + // The opaque id of the Chat. + ID *string `json:"id,omitempty"` + // Server Unix timestamp of the creation time (in seconds since epoch UTC). + CreateTime *int64 `json:"createTime,omitempty"` + CreatedBy *Person `json:"createdBy,omitempty"` + // Server Unix timestamp of the update time (in seconds since epoch UTC). + UpdateTime *int64 `json:"updateTime,omitempty"` + // The name of the Chat. + Name *string `json:"name,omitempty"` + // The ID of the AI App that this Chat is associated to. + ApplicationID *string `json:"applicationId,omitempty"` + // The display name of the AI App that this Chat is associated to. + ApplicationName *string `json:"applicationName,omitempty"` + // Defines how to render an icon + Icon *IconConfig `json:"icon,omitempty"` +} + +func (o *ChatMetadata) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *ChatMetadata) GetCreateTime() *int64 { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *ChatMetadata) GetCreatedBy() *Person { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *ChatMetadata) GetUpdateTime() *int64 { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *ChatMetadata) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ChatMetadata) GetApplicationID() *string { + if o == nil { + return nil + } + return o.ApplicationID +} + +func (o *ChatMetadata) GetApplicationName() *string { + if o == nil { + return nil + } + return o.ApplicationName +} + +func (o *ChatMetadata) GetIcon() *IconConfig { + if o == nil { + return nil + } + return o.Icon +} diff --git a/tests/mockserver/internal/sdk/models/components/chatmetadataresult.go b/tests/mockserver/internal/sdk/models/components/chatmetadataresult.go new file mode 100644 index 00000000..74a43305 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatmetadataresult.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ChatMetadataResult struct { + // Metadata of a Chat a user had with Glean Assistant. This contains no actual conversational content. + Chat *ChatMetadata `json:"chat,omitempty"` + // An opaque token that represents this particular Chat. To be used for `/feedback` reporting. + TrackingToken *string `json:"trackingToken,omitempty"` +} + +func (o *ChatMetadataResult) GetChat() *ChatMetadata { + if o == nil { + return nil + } + return o.Chat +} + +func (o *ChatMetadataResult) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} diff --git a/tests/mockserver/internal/sdk/models/components/chatrequest.go b/tests/mockserver/internal/sdk/models/components/chatrequest.go new file mode 100644 index 00000000..28474404 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatrequest.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ChatRequest struct { + // Save the current interaction as a Chat for the user to access and potentially continue later. + SaveChat *bool `json:"saveChat,omitempty"` + // The id of the Chat that context should be retrieved from and messages added to. An empty id starts a new Chat, and the Chat is saved if saveChat is true. + ChatID *string `json:"chatId,omitempty"` + // A list of chat messages, from most recent to least recent. It can be assumed that the first chat message in the list is the user's most recent query. + Messages []ChatMessage `json:"messages"` + // Describes the agent that executes the request. + AgentConfig *AgentConfig `json:"agentConfig,omitempty"` + Inclusions *ChatRestrictionFilters `json:"inclusions,omitempty"` + Exclusions *ChatRestrictionFilters `json:"exclusions,omitempty"` + // Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + TimeoutMillis *int64 `json:"timeoutMillis,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + // The ID of the application this request originates from, used to determine the configuration of underlying chat processes. This should correspond to the ID set during admin setup. If not specified, the default chat experience will be used. + ApplicationID *string `json:"applicationId,omitempty"` + // The ID of the Agent that should process this chat request. Only Agents with trigger set to 'User chat message' are invokable through this API. If not specified, the default chat experience will be used. + AgentID *string `json:"agentId,omitempty"` + // If set, response lines will be streamed one-by-one as they become available. Each will be a ChatResponse, formatted as JSON, and separated by a new line. If false, the entire response will be returned at once. Note that if this is set and the model being used does not support streaming, the model's response will not be streamed, but other messages from the endpoint still will be. + Stream *bool `json:"stream,omitempty"` +} + +func (o *ChatRequest) GetSaveChat() *bool { + if o == nil { + return nil + } + return o.SaveChat +} + +func (o *ChatRequest) GetChatID() *string { + if o == nil { + return nil + } + return o.ChatID +} + +func (o *ChatRequest) GetMessages() []ChatMessage { + if o == nil { + return []ChatMessage{} + } + return o.Messages +} + +func (o *ChatRequest) GetAgentConfig() *AgentConfig { + if o == nil { + return nil + } + return o.AgentConfig +} + +func (o *ChatRequest) GetInclusions() *ChatRestrictionFilters { + if o == nil { + return nil + } + return o.Inclusions +} + +func (o *ChatRequest) GetExclusions() *ChatRestrictionFilters { + if o == nil { + return nil + } + return o.Exclusions +} + +func (o *ChatRequest) GetTimeoutMillis() *int64 { + if o == nil { + return nil + } + return o.TimeoutMillis +} + +func (o *ChatRequest) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *ChatRequest) GetApplicationID() *string { + if o == nil { + return nil + } + return o.ApplicationID +} + +func (o *ChatRequest) GetAgentID() *string { + if o == nil { + return nil + } + return o.AgentID +} + +func (o *ChatRequest) GetStream() *bool { + if o == nil { + return nil + } + return o.Stream +} diff --git a/tests/mockserver/internal/sdk/models/components/chatresponse.go b/tests/mockserver/internal/sdk/models/components/chatresponse.go new file mode 100644 index 00000000..a6f51d28 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatresponse.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ChatResponse - A single response from the /chat backend. +type ChatResponse struct { + Messages []ChatMessage `json:"messages,omitempty"` + // The id of the associated Chat the messages belong to, if one exists. + ChatID *string `json:"chatId,omitempty"` + // Follow-up prompts for the user to potentially use + FollowUpPrompts []string `json:"followUpPrompts,omitempty"` + // Time in milliseconds the backend took to respond to the request. + BackendTimeMillis *int64 `json:"backendTimeMillis,omitempty"` + // A token that is used to track the session. + ChatSessionTrackingToken *string `json:"chatSessionTrackingToken,omitempty"` +} + +func (o *ChatResponse) GetMessages() []ChatMessage { + if o == nil { + return nil + } + return o.Messages +} + +func (o *ChatResponse) GetChatID() *string { + if o == nil { + return nil + } + return o.ChatID +} + +func (o *ChatResponse) GetFollowUpPrompts() []string { + if o == nil { + return nil + } + return o.FollowUpPrompts +} + +func (o *ChatResponse) GetBackendTimeMillis() *int64 { + if o == nil { + return nil + } + return o.BackendTimeMillis +} + +func (o *ChatResponse) GetChatSessionTrackingToken() *string { + if o == nil { + return nil + } + return o.ChatSessionTrackingToken +} diff --git a/tests/mockserver/internal/sdk/models/components/chatrestrictionfilters.go b/tests/mockserver/internal/sdk/models/components/chatrestrictionfilters.go new file mode 100644 index 00000000..0be4fc51 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatrestrictionfilters.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ChatRestrictionFilters struct { + // Specifications for containers that should be used as part of the restriction (include/exclude). Memberships are recursively defined for a subset of datasources (currently: SharePoint, OneDrive, Google Drive, and Confluence). Please contact the Glean team to enable this for more datasources. Recursive memberships do not apply for Collections. + ContainerSpecs []DocumentSpecUnion `json:"containerSpecs,omitempty"` + DocumentSpecs []DocumentSpecUnion `json:"documentSpecs,omitempty"` + DatasourceInstances []string `json:"datasourceInstances,omitempty"` +} + +func (o *ChatRestrictionFilters) GetContainerSpecs() []DocumentSpecUnion { + if o == nil { + return nil + } + return o.ContainerSpecs +} + +func (o *ChatRestrictionFilters) GetDocumentSpecs() []DocumentSpecUnion { + if o == nil { + return nil + } + return o.DocumentSpecs +} + +func (o *ChatRestrictionFilters) GetDatasourceInstances() []string { + if o == nil { + return nil + } + return o.DatasourceInstances +} diff --git a/tests/mockserver/internal/sdk/models/components/chatresult.go b/tests/mockserver/internal/sdk/models/components/chatresult.go new file mode 100644 index 00000000..ca043f8a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatresult.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ChatResult struct { + // A historical representation of a series of chat messages a user had with Glean Assistant. + Chat *Chat `json:"chat,omitempty"` + // An opaque token that represents this particular Chat. To be used for `/feedback` reporting. + TrackingToken *string `json:"trackingToken,omitempty"` +} + +func (o *ChatResult) GetChat() *Chat { + if o == nil { + return nil + } + return o.Chat +} + +func (o *ChatResult) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} diff --git a/tests/mockserver/internal/sdk/models/components/chatzerostatesuggestionoptions.go b/tests/mockserver/internal/sdk/models/components/chatzerostatesuggestionoptions.go new file mode 100644 index 00000000..9c7c788a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/chatzerostatesuggestionoptions.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ChatZeroStateSuggestionOptions struct { + // The Chat Application ID this feed request should be scoped to. Empty means there is no Chat Application ID.. + ApplicationID *string `json:"applicationId,omitempty"` +} + +func (o *ChatZeroStateSuggestionOptions) GetApplicationID() *string { + if o == nil { + return nil + } + return o.ApplicationID +} diff --git a/tests/mockserver/internal/sdk/models/components/checkdocumentaccessrequest.go b/tests/mockserver/internal/sdk/models/components/checkdocumentaccessrequest.go new file mode 100644 index 00000000..29131d83 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/checkdocumentaccessrequest.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// CheckDocumentAccessRequest - Describes the request body of the /checkdocumentaccess API call +type CheckDocumentAccessRequest struct { + // Datasource of document to check access for. + Datasource string `json:"datasource"` + // Object type of document to check access for. + ObjectType string `json:"objectType"` + // Glean Document ID to check access for. + DocID string `json:"docId"` + // Email of user to check access for. + UserEmail string `json:"userEmail"` +} + +func (o *CheckDocumentAccessRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *CheckDocumentAccessRequest) GetObjectType() string { + if o == nil { + return "" + } + return o.ObjectType +} + +func (o *CheckDocumentAccessRequest) GetDocID() string { + if o == nil { + return "" + } + return o.DocID +} + +func (o *CheckDocumentAccessRequest) GetUserEmail() string { + if o == nil { + return "" + } + return o.UserEmail +} diff --git a/tests/mockserver/internal/sdk/models/components/checkdocumentaccessresponse.go b/tests/mockserver/internal/sdk/models/components/checkdocumentaccessresponse.go new file mode 100644 index 00000000..26a4aa74 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/checkdocumentaccessresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// CheckDocumentAccessResponse - Describes the response body of the /checkdocumentaccess API call +type CheckDocumentAccessResponse struct { + // If true, user has access to document for search + HasAccess *bool `json:"hasAccess,omitempty"` +} + +func (o *CheckDocumentAccessResponse) GetHasAccess() *bool { + if o == nil { + return nil + } + return o.HasAccess +} diff --git a/tests/mockserver/internal/sdk/models/components/clustergroup.go b/tests/mockserver/internal/sdk/models/components/clustergroup.go new file mode 100644 index 00000000..d25ab42d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/clustergroup.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ClusterGroup struct { + // A list of results that should be displayed as associated with this result. + ClusteredResults []SearchResult `json:"clusteredResults,omitempty"` + // The reason for inclusion of clusteredResults. + ClusterType *ClusterTypeEnum `json:"clusterType,omitempty"` + // The default number of results to display before truncating and showing a "see more" link + VisibleCountHint int64 `json:"visibleCountHint"` +} + +func (o *ClusterGroup) GetClusteredResults() []SearchResult { + if o == nil { + return nil + } + return o.ClusteredResults +} + +func (o *ClusterGroup) GetClusterType() *ClusterTypeEnum { + if o == nil { + return nil + } + return o.ClusterType +} + +func (o *ClusterGroup) GetVisibleCountHint() int64 { + if o == nil { + return 0 + } + return o.VisibleCountHint +} diff --git a/tests/mockserver/internal/sdk/models/components/clustertypeenum.go b/tests/mockserver/internal/sdk/models/components/clustertypeenum.go new file mode 100644 index 00000000..de30c732 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/clustertypeenum.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ClusterTypeEnum - The reason for inclusion of clusteredResults. +type ClusterTypeEnum string + +const ( + ClusterTypeEnumSimilar ClusterTypeEnum = "SIMILAR" + ClusterTypeEnumFreshness ClusterTypeEnum = "FRESHNESS" + ClusterTypeEnumTitle ClusterTypeEnum = "TITLE" + ClusterTypeEnumContent ClusterTypeEnum = "CONTENT" + ClusterTypeEnumNone ClusterTypeEnum = "NONE" + ClusterTypeEnumThreadReply ClusterTypeEnum = "THREAD_REPLY" + ClusterTypeEnumThreadRoot ClusterTypeEnum = "THREAD_ROOT" + ClusterTypeEnumPrefix ClusterTypeEnum = "PREFIX" + ClusterTypeEnumSuffix ClusterTypeEnum = "SUFFIX" +) + +func (e ClusterTypeEnum) ToPointer() *ClusterTypeEnum { + return &e +} +func (e *ClusterTypeEnum) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "SIMILAR": + fallthrough + case "FRESHNESS": + fallthrough + case "TITLE": + fallthrough + case "CONTENT": + fallthrough + case "NONE": + fallthrough + case "THREAD_REPLY": + fallthrough + case "THREAD_ROOT": + fallthrough + case "PREFIX": + fallthrough + case "SUFFIX": + *e = ClusterTypeEnum(v) + return nil + default: + return fmt.Errorf("invalid value for ClusterTypeEnum: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/code.go b/tests/mockserver/internal/sdk/models/components/code.go new file mode 100644 index 00000000..724015e1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/code.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Code struct { + RepoName *string `json:"repoName,omitempty"` + FileName *string `json:"fileName,omitempty"` + FileURL *string `json:"fileUrl,omitempty"` + Lines []CodeLine `json:"lines,omitempty"` + // Last file match for a repo + IsLastMatch *bool `json:"isLastMatch,omitempty"` +} + +func (o *Code) GetRepoName() *string { + if o == nil { + return nil + } + return o.RepoName +} + +func (o *Code) GetFileName() *string { + if o == nil { + return nil + } + return o.FileName +} + +func (o *Code) GetFileURL() *string { + if o == nil { + return nil + } + return o.FileURL +} + +func (o *Code) GetLines() []CodeLine { + if o == nil { + return nil + } + return o.Lines +} + +func (o *Code) GetIsLastMatch() *bool { + if o == nil { + return nil + } + return o.IsLastMatch +} diff --git a/tests/mockserver/internal/sdk/models/components/codeline.go b/tests/mockserver/internal/sdk/models/components/codeline.go new file mode 100644 index 00000000..a0646fda --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/codeline.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CodeLine struct { + LineNumber *int64 `json:"lineNumber,omitempty"` + Content *string `json:"content,omitempty"` + // Index ranges depicting matched sections of the line + Ranges []TextRange `json:"ranges,omitempty"` +} + +func (o *CodeLine) GetLineNumber() *int64 { + if o == nil { + return nil + } + return o.LineNumber +} + +func (o *CodeLine) GetContent() *string { + if o == nil { + return nil + } + return o.Content +} + +func (o *CodeLine) GetRanges() []TextRange { + if o == nil { + return nil + } + return o.Ranges +} diff --git a/tests/mockserver/internal/sdk/models/components/collection.go b/tests/mockserver/internal/sdk/models/components/collection.go new file mode 100644 index 00000000..9740ad80 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collection.go @@ -0,0 +1,222 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type Collection struct { + // The unique name of the Collection. + Name string `json:"name"` + // A brief summary of the Collection's contents. + Description string `json:"description"` + // A list of added user roles for the Collection. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of removed user roles for the Collection. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The emoji icon of this Collection. + Icon *string `json:"icon,omitempty"` + // Indicates whether edits are allowed for everyone or only admins. + AdminLocked *bool `json:"adminLocked,omitempty"` + // The parent of this Collection, or 0 if it's a top-level Collection. + ParentID *int64 `json:"parentId,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + // The datasource type this Collection can hold. + AllowedDatasource *string `json:"allowedDatasource,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // The unique ID of the Collection. + ID int64 `json:"id"` + CreateTime *time.Time `json:"createTime,omitempty"` + UpdateTime *time.Time `json:"updateTime,omitempty"` + Creator *Person `json:"creator,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + // The number of items currently in the Collection. Separated from the actual items so we can grab the count without items. + ItemCount *int64 `json:"itemCount,omitempty"` + // The number of children Collections. Separated from the actual children so we can grab the count without children. + ChildCount *int64 `json:"childCount,omitempty"` + // The items in this Collection. + Items []CollectionItem `json:"items,omitempty"` + PinMetadata *CollectionPinnedMetadata `json:"pinMetadata,omitempty"` + // The names of the shortcuts (Go Links) that point to this Collection. + Shortcuts []string `json:"shortcuts,omitempty"` + // The children Collections of this Collection. + Children []Collection `json:"children,omitempty"` + // A list of user roles for the Collection. + Roles []UserRoleSpecification `json:"roles,omitempty"` +} + +func (c Collection) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *Collection) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Collection) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Collection) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *Collection) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *Collection) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *Collection) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *Collection) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *Collection) GetAdminLocked() *bool { + if o == nil { + return nil + } + return o.AdminLocked +} + +func (o *Collection) GetParentID() *int64 { + if o == nil { + return nil + } + return o.ParentID +} + +func (o *Collection) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *Collection) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} + +func (o *Collection) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *Collection) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *Collection) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *Collection) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *Collection) GetCreator() *Person { + if o == nil { + return nil + } + return o.Creator +} + +func (o *Collection) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *Collection) GetItemCount() *int64 { + if o == nil { + return nil + } + return o.ItemCount +} + +func (o *Collection) GetChildCount() *int64 { + if o == nil { + return nil + } + return o.ChildCount +} + +func (o *Collection) GetItems() []CollectionItem { + if o == nil { + return nil + } + return o.Items +} + +func (o *Collection) GetPinMetadata() *CollectionPinnedMetadata { + if o == nil { + return nil + } + return o.PinMetadata +} + +func (o *Collection) GetShortcuts() []string { + if o == nil { + return nil + } + return o.Shortcuts +} + +func (o *Collection) GetChildren() []Collection { + if o == nil { + return nil + } + return o.Children +} + +func (o *Collection) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionerror.go b/tests/mockserver/internal/sdk/models/components/collectionerror.go new file mode 100644 index 00000000..79eef1da --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionerror.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type CollectionErrorErrorCode string + +const ( + CollectionErrorErrorCodeNameExists CollectionErrorErrorCode = "NAME_EXISTS" + CollectionErrorErrorCodeNotFound CollectionErrorErrorCode = "NOT_FOUND" + CollectionErrorErrorCodeCollectionPinned CollectionErrorErrorCode = "COLLECTION_PINNED" + CollectionErrorErrorCodeConcurrentHierarchyEdit CollectionErrorErrorCode = "CONCURRENT_HIERARCHY_EDIT" + CollectionErrorErrorCodeHeightViolation CollectionErrorErrorCode = "HEIGHT_VIOLATION" + CollectionErrorErrorCodeWidthViolation CollectionErrorErrorCode = "WIDTH_VIOLATION" + CollectionErrorErrorCodeNoPermissions CollectionErrorErrorCode = "NO_PERMISSIONS" +) + +func (e CollectionErrorErrorCode) ToPointer() *CollectionErrorErrorCode { + return &e +} +func (e *CollectionErrorErrorCode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NAME_EXISTS": + fallthrough + case "NOT_FOUND": + fallthrough + case "COLLECTION_PINNED": + fallthrough + case "CONCURRENT_HIERARCHY_EDIT": + fallthrough + case "HEIGHT_VIOLATION": + fallthrough + case "WIDTH_VIOLATION": + fallthrough + case "NO_PERMISSIONS": + *e = CollectionErrorErrorCode(v) + return nil + default: + return fmt.Errorf("invalid value for CollectionErrorErrorCode: %v", v) + } +} + +type CollectionError struct { + ErrorCode CollectionErrorErrorCode `json:"errorCode"` +} + +func (o *CollectionError) GetErrorCode() CollectionErrorErrorCode { + if o == nil { + return CollectionErrorErrorCode("") + } + return o.ErrorCode +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionitem.go b/tests/mockserver/internal/sdk/models/components/collectionitem.go new file mode 100644 index 00000000..63403db8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionitem.go @@ -0,0 +1,168 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +type CollectionItemItemType string + +const ( + CollectionItemItemTypeDocument CollectionItemItemType = "DOCUMENT" + CollectionItemItemTypeText CollectionItemItemType = "TEXT" + CollectionItemItemTypeURL CollectionItemItemType = "URL" + CollectionItemItemTypeCollection CollectionItemItemType = "COLLECTION" +) + +func (e CollectionItemItemType) ToPointer() *CollectionItemItemType { + return &e +} +func (e *CollectionItemItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DOCUMENT": + fallthrough + case "TEXT": + fallthrough + case "URL": + fallthrough + case "COLLECTION": + *e = CollectionItemItemType(v) + return nil + default: + return fmt.Errorf("invalid value for CollectionItemItemType: %v", v) + } +} + +type CollectionItem struct { + // The optional name of the Collection item. + Name *string `json:"name,omitempty"` + // A helpful description of why this CollectionItem is in the Collection that it's in. + Description *string `json:"description,omitempty"` + // The emoji icon for this CollectionItem. Only used for Text type items. + Icon *string `json:"icon,omitempty"` + // The Collection ID of the Collection that this CollectionItem belongs in. + CollectionID int64 `json:"collectionId"` + // If this CollectionItem is indexed, the Glean Document ID of that document. + DocumentID *string `json:"documentId,omitempty"` + // The URL of this CollectionItem. + URL *string `json:"url,omitempty"` + // Unique identifier for the item within the Collection it belongs to. + ItemID *string `json:"itemId,omitempty"` + CreatedBy *Person `json:"createdBy,omitempty"` + // Unix timestamp for when the item was first added (in seconds since epoch UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + Document *Document `json:"document,omitempty"` + Shortcut *Shortcut `json:"shortcut,omitempty"` + Collection *Collection `json:"collection,omitempty"` + ItemType CollectionItemItemType `json:"itemType"` +} + +func (c CollectionItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CollectionItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CollectionItem) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *CollectionItem) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *CollectionItem) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *CollectionItem) GetCollectionID() int64 { + if o == nil { + return 0 + } + return o.CollectionID +} + +func (o *CollectionItem) GetDocumentID() *string { + if o == nil { + return nil + } + return o.DocumentID +} + +func (o *CollectionItem) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *CollectionItem) GetItemID() *string { + if o == nil { + return nil + } + return o.ItemID +} + +func (o *CollectionItem) GetCreatedBy() *Person { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *CollectionItem) GetCreatedAt() *time.Time { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *CollectionItem) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} + +func (o *CollectionItem) GetShortcut() *Shortcut { + if o == nil { + return nil + } + return o.Shortcut +} + +func (o *CollectionItem) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} + +func (o *CollectionItem) GetItemType() CollectionItemItemType { + if o == nil { + return CollectionItemItemType("") + } + return o.ItemType +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionitemdescriptor.go b/tests/mockserver/internal/sdk/models/components/collectionitemdescriptor.go new file mode 100644 index 00000000..c52451d3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionitemdescriptor.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type CollectionItemDescriptorItemType string + +const ( + CollectionItemDescriptorItemTypeDocument CollectionItemDescriptorItemType = "DOCUMENT" + CollectionItemDescriptorItemTypeText CollectionItemDescriptorItemType = "TEXT" + CollectionItemDescriptorItemTypeURL CollectionItemDescriptorItemType = "URL" +) + +func (e CollectionItemDescriptorItemType) ToPointer() *CollectionItemDescriptorItemType { + return &e +} +func (e *CollectionItemDescriptorItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DOCUMENT": + fallthrough + case "TEXT": + fallthrough + case "URL": + *e = CollectionItemDescriptorItemType(v) + return nil + default: + return fmt.Errorf("invalid value for CollectionItemDescriptorItemType: %v", v) + } +} + +type CollectionItemDescriptor struct { + // The optional name of the Collection item. + Name *string `json:"name,omitempty"` + // A helpful description of why this CollectionItem is in the Collection that it's in. + Description *string `json:"description,omitempty"` + // The emoji icon for this CollectionItem. Only used for Text type items. + Icon *string `json:"icon,omitempty"` + // The URL of the item being added. + URL *string `json:"url,omitempty"` + // The Glean Document ID of the item being added if it's an indexed document. + DocumentID *string `json:"documentId,omitempty"` + // The (optional) ItemId of the next CollectionItem in sequence. If omitted, will be added to the end of the Collection + NewNextItemID *string `json:"newNextItemId,omitempty"` + ItemType *CollectionItemDescriptorItemType `json:"itemType,omitempty"` +} + +func (o *CollectionItemDescriptor) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *CollectionItemDescriptor) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *CollectionItemDescriptor) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *CollectionItemDescriptor) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *CollectionItemDescriptor) GetDocumentID() *string { + if o == nil { + return nil + } + return o.DocumentID +} + +func (o *CollectionItemDescriptor) GetNewNextItemID() *string { + if o == nil { + return nil + } + return o.NewNextItemID +} + +func (o *CollectionItemDescriptor) GetItemType() *CollectionItemDescriptorItemType { + if o == nil { + return nil + } + return o.ItemType +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionpinmetadata.go b/tests/mockserver/internal/sdk/models/components/collectionpinmetadata.go new file mode 100644 index 00000000..5c03cbf9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionpinmetadata.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CollectionPinMetadata struct { + // The ID of the Collection. + ID int64 `json:"id"` + Target CollectionPinTarget `json:"target"` +} + +func (o *CollectionPinMetadata) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *CollectionPinMetadata) GetTarget() CollectionPinTarget { + if o == nil { + return CollectionPinTarget{} + } + return o.Target +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionpinnablecategories.go b/tests/mockserver/internal/sdk/models/components/collectionpinnablecategories.go new file mode 100644 index 00000000..8679fde6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionpinnablecategories.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// CollectionPinnableCategories - Categories a Collection can be pinned to. +type CollectionPinnableCategories string + +const ( + CollectionPinnableCategoriesCompanyResource CollectionPinnableCategories = "COMPANY_RESOURCE" + CollectionPinnableCategoriesDepartmentResource CollectionPinnableCategories = "DEPARTMENT_RESOURCE" + CollectionPinnableCategoriesTeamResource CollectionPinnableCategories = "TEAM_RESOURCE" +) + +func (e CollectionPinnableCategories) ToPointer() *CollectionPinnableCategories { + return &e +} +func (e *CollectionPinnableCategories) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "COMPANY_RESOURCE": + fallthrough + case "DEPARTMENT_RESOURCE": + fallthrough + case "TEAM_RESOURCE": + *e = CollectionPinnableCategories(v) + return nil + default: + return fmt.Errorf("invalid value for CollectionPinnableCategories: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionpinnabletargets.go b/tests/mockserver/internal/sdk/models/components/collectionpinnabletargets.go new file mode 100644 index 00000000..fdcec773 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionpinnabletargets.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// CollectionPinnableTargets - What targets can a Collection be pinned to. +type CollectionPinnableTargets string + +const ( + CollectionPinnableTargetsResourceCard CollectionPinnableTargets = "RESOURCE_CARD" + CollectionPinnableTargetsTeamProfilePage CollectionPinnableTargets = "TEAM_PROFILE_PAGE" +) + +func (e CollectionPinnableTargets) ToPointer() *CollectionPinnableTargets { + return &e +} +func (e *CollectionPinnableTargets) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "RESOURCE_CARD": + fallthrough + case "TEAM_PROFILE_PAGE": + *e = CollectionPinnableTargets(v) + return nil + default: + return fmt.Errorf("invalid value for CollectionPinnableTargets: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionpinnedmetadata.go b/tests/mockserver/internal/sdk/models/components/collectionpinnedmetadata.go new file mode 100644 index 00000000..540bda90 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionpinnedmetadata.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CollectionPinnedMetadata struct { + // List of targets this Collection is pinned to. + ExistingPins []CollectionPinTarget `json:"existingPins,omitempty"` + // List of targets this Collection can be pinned to, excluding the targets this Collection is already pinned to. We also include Collection ID already is pinned to each eligible target, which will be 0 if the target has no pinned Collection. + EligiblePins []CollectionPinMetadata `json:"eligiblePins,omitempty"` +} + +func (o *CollectionPinnedMetadata) GetExistingPins() []CollectionPinTarget { + if o == nil { + return nil + } + return o.ExistingPins +} + +func (o *CollectionPinnedMetadata) GetEligiblePins() []CollectionPinMetadata { + if o == nil { + return nil + } + return o.EligiblePins +} diff --git a/tests/mockserver/internal/sdk/models/components/collectionpintarget.go b/tests/mockserver/internal/sdk/models/components/collectionpintarget.go new file mode 100644 index 00000000..dc05e1a2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/collectionpintarget.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CollectionPinTarget struct { + // Categories a Collection can be pinned to. + Category CollectionPinnableCategories `json:"category"` + // Optional. If category supports values, then the additional value for the category e.g. department name for DEPARTMENT_RESOURCE, team name/id for TEAM_RESOURCE and so on. + Value *string `json:"value,omitempty"` + // What targets can a Collection be pinned to. + Target *CollectionPinnableTargets `json:"target,omitempty"` +} + +func (o *CollectionPinTarget) GetCategory() CollectionPinnableCategories { + if o == nil { + return CollectionPinnableCategories("") + } + return o.Category +} + +func (o *CollectionPinTarget) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} + +func (o *CollectionPinTarget) GetTarget() *CollectionPinnableTargets { + if o == nil { + return nil + } + return o.Target +} diff --git a/tests/mockserver/internal/sdk/models/components/commentdefinition.go b/tests/mockserver/internal/sdk/models/components/commentdefinition.go new file mode 100644 index 00000000..ecdc8f11 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/commentdefinition.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// CommentDefinition - Describes a comment on a document +type CommentDefinition struct { + // The document specific id for the comment. This field is case insensitive and should not be more than 200 characters in length. + ID string `json:"id"` + // Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. + Author *UserReferenceDefinition `json:"author,omitempty"` + // Describes text content or base64 encoded binary content + Content *ContentDefinition `json:"content,omitempty"` + // The creation time, in epoch seconds. + CreatedAt *int64 `json:"createdAt,omitempty"` + // The last updated time, in epoch seconds. + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. + UpdatedBy *UserReferenceDefinition `json:"updatedBy,omitempty"` +} + +func (o *CommentDefinition) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *CommentDefinition) GetAuthor() *UserReferenceDefinition { + if o == nil { + return nil + } + return o.Author +} + +func (o *CommentDefinition) GetContent() *ContentDefinition { + if o == nil { + return nil + } + return o.Content +} + +func (o *CommentDefinition) GetCreatedAt() *int64 { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *CommentDefinition) GetUpdatedAt() *int64 { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *CommentDefinition) GetUpdatedBy() *UserReferenceDefinition { + if o == nil { + return nil + } + return o.UpdatedBy +} diff --git a/tests/mockserver/internal/sdk/models/components/communicationchannel.go b/tests/mockserver/internal/sdk/models/components/communicationchannel.go new file mode 100644 index 00000000..63f9dfdb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/communicationchannel.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type CommunicationChannel string + +const ( + CommunicationChannelCommunicationChannelEmail CommunicationChannel = "COMMUNICATION_CHANNEL_EMAIL" + CommunicationChannelCommunicationChannelSlack CommunicationChannel = "COMMUNICATION_CHANNEL_SLACK" +) + +func (e CommunicationChannel) ToPointer() *CommunicationChannel { + return &e +} +func (e *CommunicationChannel) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "COMMUNICATION_CHANNEL_EMAIL": + fallthrough + case "COMMUNICATION_CHANNEL_SLACK": + *e = CommunicationChannel(v) + return nil + default: + return fmt.Errorf("invalid value for CommunicationChannel: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/company.go b/tests/mockserver/internal/sdk/models/components/company.go new file mode 100644 index 00000000..046ab6cb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/company.go @@ -0,0 +1,139 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" +) + +type Company struct { + // User-friendly display name. + Name string `json:"name"` + // Link to internal company company profile. + ProfileURL *string `json:"profileUrl,omitempty"` + // Link to company's associated websites. + WebsiteUrls []string `json:"websiteUrls,omitempty"` + // The URL of the company's logo. Public, Glean-authenticated and Base64 encoded data URLs are all valid (but not third-party-authenticated URLs). + LogoURL *string `json:"logoUrl,omitempty"` + // User facing string representing the company's location. + Location *string `json:"location,omitempty"` + // Phone number as a number string. + Phone *string `json:"phone,omitempty"` + // Fax number as a number string. + Fax *string `json:"fax,omitempty"` + // User facing string representing the company's industry. + Industry *string `json:"industry,omitempty"` + // Average company's annual revenue for reference. + AnnualRevenue *float64 `json:"annualRevenue,omitempty"` + // Average company's number of employees for reference. + NumberOfEmployees *int64 `json:"numberOfEmployees,omitempty"` + // Company's stock symbol if company is public. + StockSymbol *string `json:"stockSymbol,omitempty"` + // The date when the company was founded. + FoundedDate *types.Date `json:"foundedDate,omitempty"` + // User facing description of company. + About *string `json:"about,omitempty"` +} + +func (c Company) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *Company) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Company) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Company) GetProfileURL() *string { + if o == nil { + return nil + } + return o.ProfileURL +} + +func (o *Company) GetWebsiteUrls() []string { + if o == nil { + return nil + } + return o.WebsiteUrls +} + +func (o *Company) GetLogoURL() *string { + if o == nil { + return nil + } + return o.LogoURL +} + +func (o *Company) GetLocation() *string { + if o == nil { + return nil + } + return o.Location +} + +func (o *Company) GetPhone() *string { + if o == nil { + return nil + } + return o.Phone +} + +func (o *Company) GetFax() *string { + if o == nil { + return nil + } + return o.Fax +} + +func (o *Company) GetIndustry() *string { + if o == nil { + return nil + } + return o.Industry +} + +func (o *Company) GetAnnualRevenue() *float64 { + if o == nil { + return nil + } + return o.AnnualRevenue +} + +func (o *Company) GetNumberOfEmployees() *int64 { + if o == nil { + return nil + } + return o.NumberOfEmployees +} + +func (o *Company) GetStockSymbol() *string { + if o == nil { + return nil + } + return o.StockSymbol +} + +func (o *Company) GetFoundedDate() *types.Date { + if o == nil { + return nil + } + return o.FoundedDate +} + +func (o *Company) GetAbout() *string { + if o == nil { + return nil + } + return o.About +} diff --git a/tests/mockserver/internal/sdk/models/components/conferencedata.go b/tests/mockserver/internal/sdk/models/components/conferencedata.go new file mode 100644 index 00000000..04b08de5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/conferencedata.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type Provider string + +const ( + ProviderZoom Provider = "ZOOM" + ProviderHangouts Provider = "HANGOUTS" +) + +func (e Provider) ToPointer() *Provider { + return &e +} +func (e *Provider) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ZOOM": + fallthrough + case "HANGOUTS": + *e = Provider(v) + return nil + default: + return fmt.Errorf("invalid value for Provider: %v", v) + } +} + +type ConferenceDataSource string + +const ( + ConferenceDataSourceNativeConference ConferenceDataSource = "NATIVE_CONFERENCE" + ConferenceDataSourceLocation ConferenceDataSource = "LOCATION" + ConferenceDataSourceDescription ConferenceDataSource = "DESCRIPTION" +) + +func (e ConferenceDataSource) ToPointer() *ConferenceDataSource { + return &e +} +func (e *ConferenceDataSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NATIVE_CONFERENCE": + fallthrough + case "LOCATION": + fallthrough + case "DESCRIPTION": + *e = ConferenceDataSource(v) + return nil + default: + return fmt.Errorf("invalid value for ConferenceDataSource: %v", v) + } +} + +type ConferenceData struct { + Provider Provider `json:"provider"` + // A permalink for the conference. + URI string `json:"uri"` + Source *ConferenceDataSource `json:"source,omitempty"` +} + +func (o *ConferenceData) GetProvider() Provider { + if o == nil { + return Provider("") + } + return o.Provider +} + +func (o *ConferenceData) GetURI() string { + if o == nil { + return "" + } + return o.URI +} + +func (o *ConferenceData) GetSource() *ConferenceDataSource { + if o == nil { + return nil + } + return o.Source +} diff --git a/tests/mockserver/internal/sdk/models/components/connectortype.go b/tests/mockserver/internal/sdk/models/components/connectortype.go new file mode 100644 index 00000000..fcf165bb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/connectortype.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ConnectorType - The source from which document content was pulled, e.g. an API crawl or browser history +type ConnectorType string + +const ( + ConnectorTypeAPICrawl ConnectorType = "API_CRAWL" + ConnectorTypeBrowserCrawl ConnectorType = "BROWSER_CRAWL" + ConnectorTypeBrowserHistory ConnectorType = "BROWSER_HISTORY" + ConnectorTypeBuiltin ConnectorType = "BUILTIN" + ConnectorTypeFederatedSearch ConnectorType = "FEDERATED_SEARCH" + ConnectorTypePushAPI ConnectorType = "PUSH_API" + ConnectorTypeWebCrawl ConnectorType = "WEB_CRAWL" + ConnectorTypeNativeHistory ConnectorType = "NATIVE_HISTORY" +) + +func (e ConnectorType) ToPointer() *ConnectorType { + return &e +} +func (e *ConnectorType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "API_CRAWL": + fallthrough + case "BROWSER_CRAWL": + fallthrough + case "BROWSER_HISTORY": + fallthrough + case "BUILTIN": + fallthrough + case "FEDERATED_SEARCH": + fallthrough + case "PUSH_API": + fallthrough + case "WEB_CRAWL": + fallthrough + case "NATIVE_HISTORY": + *e = ConnectorType(v) + return nil + default: + return fmt.Errorf("invalid value for ConnectorType: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/contentdefinition.go b/tests/mockserver/internal/sdk/models/components/contentdefinition.go new file mode 100644 index 00000000..7be15567 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/contentdefinition.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ContentDefinition - Describes text content or base64 encoded binary content +type ContentDefinition struct { + MimeType string `json:"mimeType"` + // text content. Only one of textContent or binary content can be specified + TextContent *string `json:"textContent,omitempty"` + // base64 encoded binary content. Only one of textContent or binary content can be specified + BinaryContent *string `json:"binaryContent,omitempty"` +} + +func (o *ContentDefinition) GetMimeType() string { + if o == nil { + return "" + } + return o.MimeType +} + +func (o *ContentDefinition) GetTextContent() *string { + if o == nil { + return nil + } + return o.TextContent +} + +func (o *ContentDefinition) GetBinaryContent() *string { + if o == nil { + return nil + } + return o.BinaryContent +} diff --git a/tests/mockserver/internal/sdk/models/components/contentinsightsresponse.go b/tests/mockserver/internal/sdk/models/components/contentinsightsresponse.go new file mode 100644 index 00000000..e417efa7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/contentinsightsresponse.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ContentInsightsResponse struct { + // Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). + LastLogTimestamp *int64 `json:"lastLogTimestamp,omitempty"` + // Insights for documents. + DocumentInsights []DocumentInsight `json:"documentInsights,omitempty"` + // list of departments applicable for contents tab. + Departments []string `json:"departments,omitempty"` + // Min threshold in size of departments while populating results, otherwise 0. + MinDepartmentSizeThreshold *int64 `json:"minDepartmentSizeThreshold,omitempty"` + // Minimum number of visitors to a document required to be included in insights. + MinVisitorThreshold *int64 `json:"minVisitorThreshold,omitempty"` +} + +func (o *ContentInsightsResponse) GetLastLogTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastLogTimestamp +} + +func (o *ContentInsightsResponse) GetDocumentInsights() []DocumentInsight { + if o == nil { + return nil + } + return o.DocumentInsights +} + +func (o *ContentInsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} + +func (o *ContentInsightsResponse) GetMinDepartmentSizeThreshold() *int64 { + if o == nil { + return nil + } + return o.MinDepartmentSizeThreshold +} + +func (o *ContentInsightsResponse) GetMinVisitorThreshold() *int64 { + if o == nil { + return nil + } + return o.MinVisitorThreshold +} diff --git a/tests/mockserver/internal/sdk/models/components/contenttype.go b/tests/mockserver/internal/sdk/models/components/contenttype.go new file mode 100644 index 00000000..6740b4e6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/contenttype.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type ContentType string + +const ( + ContentTypeText ContentType = "text" +) + +func (e ContentType) ToPointer() *ContentType { + return &e +} +func (e *ContentType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "text": + *e = ContentType(v) + return nil + default: + return fmt.Errorf("invalid value for ContentType: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/countinfo.go b/tests/mockserver/internal/sdk/models/components/countinfo.go new file mode 100644 index 00000000..69513d56 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/countinfo.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CountInfo struct { + // The counter value + Count int64 `json:"count"` + Period *Period `json:"period,omitempty"` + // The unit of organization over which we did the count aggregation, e.g. org (department) or company + Org *string `json:"org,omitempty"` +} + +func (o *CountInfo) GetCount() int64 { + if o == nil { + return 0 + } + return o.Count +} + +func (o *CountInfo) GetPeriod() *Period { + if o == nil { + return nil + } + return o.Period +} + +func (o *CountInfo) GetOrg() *string { + if o == nil { + return nil + } + return o.Org +} diff --git a/tests/mockserver/internal/sdk/models/components/createannouncementrequest.go b/tests/mockserver/internal/sdk/models/components/createannouncementrequest.go new file mode 100644 index 00000000..0b4ba354 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createannouncementrequest.go @@ -0,0 +1,201 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// CreateAnnouncementRequestChannel - This determines whether this is a Social Feed post or a regular announcement. +type CreateAnnouncementRequestChannel string + +const ( + CreateAnnouncementRequestChannelMain CreateAnnouncementRequestChannel = "MAIN" + CreateAnnouncementRequestChannelSocialFeed CreateAnnouncementRequestChannel = "SOCIAL_FEED" +) + +func (e CreateAnnouncementRequestChannel) ToPointer() *CreateAnnouncementRequestChannel { + return &e +} +func (e *CreateAnnouncementRequestChannel) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MAIN": + fallthrough + case "SOCIAL_FEED": + *e = CreateAnnouncementRequestChannel(v) + return nil + default: + return fmt.Errorf("invalid value for CreateAnnouncementRequestChannel: %v", v) + } +} + +// CreateAnnouncementRequestPostType - This determines whether this is an external-link post or a regular announcement post. TEXT - Regular announcement that can contain rich text. LINK - Announcement that is linked to an external site. +type CreateAnnouncementRequestPostType string + +const ( + CreateAnnouncementRequestPostTypeText CreateAnnouncementRequestPostType = "TEXT" + CreateAnnouncementRequestPostTypeLink CreateAnnouncementRequestPostType = "LINK" +) + +func (e CreateAnnouncementRequestPostType) ToPointer() *CreateAnnouncementRequestPostType { + return &e +} +func (e *CreateAnnouncementRequestPostType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + fallthrough + case "LINK": + *e = CreateAnnouncementRequestPostType(v) + return nil + default: + return fmt.Errorf("invalid value for CreateAnnouncementRequestPostType: %v", v) + } +} + +type CreateAnnouncementRequest struct { + // The date and time at which the announcement becomes active. + StartTime time.Time `json:"startTime"` + // The date and time at which the announcement expires. + EndTime time.Time `json:"endTime"` + // The headline of the announcement. + Title string `json:"title"` + Body *StructuredText `json:"body,omitempty"` + // An emoji used to indicate the nature of the announcement. + Emoji *string `json:"emoji,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + Banner *Thumbnail `json:"banner,omitempty"` + // Filters which restrict who should see the announcement. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The Glean Document ID of the source document this Announcement was created from (e.g. Slack thread). + SourceDocumentID *string `json:"sourceDocumentId,omitempty"` + // Whether or not to hide an author attribution. + HideAttribution *bool `json:"hideAttribution,omitempty"` + // This determines whether this is a Social Feed post or a regular announcement. + Channel *CreateAnnouncementRequestChannel `json:"channel,omitempty"` + // This determines whether this is an external-link post or a regular announcement post. TEXT - Regular announcement that can contain rich text. LINK - Announcement that is linked to an external site. + PostType *CreateAnnouncementRequestPostType `json:"postType,omitempty"` + // Used by the Social Feed to pin posts to the front of the feed. + IsPrioritized *bool `json:"isPrioritized,omitempty"` + // URL for viewing the announcement. It will be set to document URL for announcements from other datasources e.g. simpplr. Can only be written when channel="SOCIAL_FEED". + ViewURL *string `json:"viewUrl,omitempty"` +} + +func (c CreateAnnouncementRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateAnnouncementRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateAnnouncementRequest) GetStartTime() time.Time { + if o == nil { + return time.Time{} + } + return o.StartTime +} + +func (o *CreateAnnouncementRequest) GetEndTime() time.Time { + if o == nil { + return time.Time{} + } + return o.EndTime +} + +func (o *CreateAnnouncementRequest) GetTitle() string { + if o == nil { + return "" + } + return o.Title +} + +func (o *CreateAnnouncementRequest) GetBody() *StructuredText { + if o == nil { + return nil + } + return o.Body +} + +func (o *CreateAnnouncementRequest) GetEmoji() *string { + if o == nil { + return nil + } + return o.Emoji +} + +func (o *CreateAnnouncementRequest) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *CreateAnnouncementRequest) GetBanner() *Thumbnail { + if o == nil { + return nil + } + return o.Banner +} + +func (o *CreateAnnouncementRequest) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *CreateAnnouncementRequest) GetSourceDocumentID() *string { + if o == nil { + return nil + } + return o.SourceDocumentID +} + +func (o *CreateAnnouncementRequest) GetHideAttribution() *bool { + if o == nil { + return nil + } + return o.HideAttribution +} + +func (o *CreateAnnouncementRequest) GetChannel() *CreateAnnouncementRequestChannel { + if o == nil { + return nil + } + return o.Channel +} + +func (o *CreateAnnouncementRequest) GetPostType() *CreateAnnouncementRequestPostType { + if o == nil { + return nil + } + return o.PostType +} + +func (o *CreateAnnouncementRequest) GetIsPrioritized() *bool { + if o == nil { + return nil + } + return o.IsPrioritized +} + +func (o *CreateAnnouncementRequest) GetViewURL() *string { + if o == nil { + return nil + } + return o.ViewURL +} diff --git a/tests/mockserver/internal/sdk/models/components/createanswerrequest.go b/tests/mockserver/internal/sdk/models/components/createanswerrequest.go new file mode 100644 index 00000000..e15c5837 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createanswerrequest.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateAnswerRequest struct { + Data AnswerCreationData `json:"data"` +} + +func (o *CreateAnswerRequest) GetData() AnswerCreationData { + if o == nil { + return AnswerCreationData{} + } + return o.Data +} diff --git a/tests/mockserver/internal/sdk/models/components/createauthtokenresponse.go b/tests/mockserver/internal/sdk/models/components/createauthtokenresponse.go new file mode 100644 index 00000000..eaf8d515 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createauthtokenresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateAuthTokenResponse struct { + // An authentication token that can be passed to any endpoint via Bearer Authentication + Token string `json:"token"` + // Unix timestamp for when this token expires (in seconds since epoch UTC). + ExpirationTime int64 `json:"expirationTime"` +} + +func (o *CreateAuthTokenResponse) GetToken() string { + if o == nil { + return "" + } + return o.Token +} + +func (o *CreateAuthTokenResponse) GetExpirationTime() int64 { + if o == nil { + return 0 + } + return o.ExpirationTime +} diff --git a/tests/mockserver/internal/sdk/models/components/createcollectionrequest.go b/tests/mockserver/internal/sdk/models/components/createcollectionrequest.go new file mode 100644 index 00000000..0c58401f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createcollectionrequest.go @@ -0,0 +1,104 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateCollectionRequest struct { + // The unique name of the Collection. + Name string `json:"name"` + // A brief summary of the Collection's contents. + Description *string `json:"description,omitempty"` + // A list of added user roles for the Collection. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of removed user roles for the Collection. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The emoji icon of this Collection. + Icon *string `json:"icon,omitempty"` + // Indicates whether edits are allowed for everyone or only admins. + AdminLocked *bool `json:"adminLocked,omitempty"` + // The parent of this Collection, or 0 if it's a top-level Collection. + ParentID *int64 `json:"parentId,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + // The datasource type this Collection can hold. + AllowedDatasource *string `json:"allowedDatasource,omitempty"` + // The (optional) ItemId of the next CollectionItem in sequence. If omitted, will be added to the end of the Collection. Only used if parentId is specified. + NewNextItemID *string `json:"newNextItemId,omitempty"` +} + +func (o *CreateCollectionRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *CreateCollectionRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *CreateCollectionRequest) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *CreateCollectionRequest) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *CreateCollectionRequest) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *CreateCollectionRequest) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *CreateCollectionRequest) GetAdminLocked() *bool { + if o == nil { + return nil + } + return o.AdminLocked +} + +func (o *CreateCollectionRequest) GetParentID() *int64 { + if o == nil { + return nil + } + return o.ParentID +} + +func (o *CreateCollectionRequest) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *CreateCollectionRequest) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} + +func (o *CreateCollectionRequest) GetNewNextItemID() *string { + if o == nil { + return nil + } + return o.NewNextItemID +} diff --git a/tests/mockserver/internal/sdk/models/components/createcollectionresponse.go b/tests/mockserver/internal/sdk/models/components/createcollectionresponse.go new file mode 100644 index 00000000..17efbef4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createcollectionresponse.go @@ -0,0 +1,289 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +type CreateCollectionResponseErrorCode string + +const ( + CreateCollectionResponseErrorCodeNameExists CreateCollectionResponseErrorCode = "NAME_EXISTS" + CreateCollectionResponseErrorCodeNotFound CreateCollectionResponseErrorCode = "NOT_FOUND" + CreateCollectionResponseErrorCodeCollectionPinned CreateCollectionResponseErrorCode = "COLLECTION_PINNED" + CreateCollectionResponseErrorCodeConcurrentHierarchyEdit CreateCollectionResponseErrorCode = "CONCURRENT_HIERARCHY_EDIT" + CreateCollectionResponseErrorCodeHeightViolation CreateCollectionResponseErrorCode = "HEIGHT_VIOLATION" + CreateCollectionResponseErrorCodeWidthViolation CreateCollectionResponseErrorCode = "WIDTH_VIOLATION" + CreateCollectionResponseErrorCodeNoPermissions CreateCollectionResponseErrorCode = "NO_PERMISSIONS" +) + +func (e CreateCollectionResponseErrorCode) ToPointer() *CreateCollectionResponseErrorCode { + return &e +} +func (e *CreateCollectionResponseErrorCode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NAME_EXISTS": + fallthrough + case "NOT_FOUND": + fallthrough + case "COLLECTION_PINNED": + fallthrough + case "CONCURRENT_HIERARCHY_EDIT": + fallthrough + case "HEIGHT_VIOLATION": + fallthrough + case "WIDTH_VIOLATION": + fallthrough + case "NO_PERMISSIONS": + *e = CreateCollectionResponseErrorCode(v) + return nil + default: + return fmt.Errorf("invalid value for CreateCollectionResponseErrorCode: %v", v) + } +} + +type CreateCollectionResponse struct { + // The unique name of the Collection. + Name string `json:"name"` + // A brief summary of the Collection's contents. + Description string `json:"description"` + // A list of added user roles for the Collection. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of removed user roles for the Collection. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The emoji icon of this Collection. + Icon *string `json:"icon,omitempty"` + // Indicates whether edits are allowed for everyone or only admins. + AdminLocked *bool `json:"adminLocked,omitempty"` + // The parent of this Collection, or 0 if it's a top-level Collection. + ParentID *int64 `json:"parentId,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + // The datasource type this Collection can hold. + AllowedDatasource *string `json:"allowedDatasource,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // The unique ID of the Collection. + ID int64 `json:"id"` + CreateTime *time.Time `json:"createTime,omitempty"` + UpdateTime *time.Time `json:"updateTime,omitempty"` + Creator *Person `json:"creator,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + // The number of items currently in the Collection. Separated from the actual items so we can grab the count without items. + ItemCount *int64 `json:"itemCount,omitempty"` + // The number of children Collections. Separated from the actual children so we can grab the count without children. + ChildCount *int64 `json:"childCount,omitempty"` + // The items in this Collection. + Items []CollectionItem `json:"items,omitempty"` + PinMetadata *CollectionPinnedMetadata `json:"pinMetadata,omitempty"` + // The names of the shortcuts (Go Links) that point to this Collection. + Shortcuts []string `json:"shortcuts,omitempty"` + // The children Collections of this Collection. + Children []Collection `json:"children,omitempty"` + // A list of user roles for the Collection. + Roles []UserRoleSpecification `json:"roles,omitempty"` + ErrorCode CreateCollectionResponseErrorCode `json:"errorCode"` + Collection *Collection `json:"collection,omitempty"` + Error *CollectionError `json:"error,omitempty"` +} + +func (c CreateCollectionResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateCollectionResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateCollectionResponse) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *CreateCollectionResponse) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *CreateCollectionResponse) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *CreateCollectionResponse) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *CreateCollectionResponse) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *CreateCollectionResponse) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *CreateCollectionResponse) GetAdminLocked() *bool { + if o == nil { + return nil + } + return o.AdminLocked +} + +func (o *CreateCollectionResponse) GetParentID() *int64 { + if o == nil { + return nil + } + return o.ParentID +} + +func (o *CreateCollectionResponse) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *CreateCollectionResponse) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} + +func (o *CreateCollectionResponse) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *CreateCollectionResponse) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *CreateCollectionResponse) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *CreateCollectionResponse) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *CreateCollectionResponse) GetCreator() *Person { + if o == nil { + return nil + } + return o.Creator +} + +func (o *CreateCollectionResponse) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *CreateCollectionResponse) GetItemCount() *int64 { + if o == nil { + return nil + } + return o.ItemCount +} + +func (o *CreateCollectionResponse) GetChildCount() *int64 { + if o == nil { + return nil + } + return o.ChildCount +} + +func (o *CreateCollectionResponse) GetItems() []CollectionItem { + if o == nil { + return nil + } + return o.Items +} + +func (o *CreateCollectionResponse) GetPinMetadata() *CollectionPinnedMetadata { + if o == nil { + return nil + } + return o.PinMetadata +} + +func (o *CreateCollectionResponse) GetShortcuts() []string { + if o == nil { + return nil + } + return o.Shortcuts +} + +func (o *CreateCollectionResponse) GetChildren() []Collection { + if o == nil { + return nil + } + return o.Children +} + +func (o *CreateCollectionResponse) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} + +func (o *CreateCollectionResponse) GetErrorCode() CreateCollectionResponseErrorCode { + if o == nil { + return CreateCollectionResponseErrorCode("") + } + return o.ErrorCode +} + +func (o *CreateCollectionResponse) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} + +func (o *CreateCollectionResponse) GetError() *CollectionError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/createdlpreportrequest.go b/tests/mockserver/internal/sdk/models/components/createdlpreportrequest.go new file mode 100644 index 00000000..099d075e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createdlpreportrequest.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateDlpReportRequest struct { + // Name of the policy being created. + Name *string `json:"name,omitempty"` + // Detailed configuration of what documents and sensitive content will be scanned. + Config *DlpConfig `json:"config,omitempty"` + // Interval between scans. DAILY is deprecated. + Frequency *DlpFrequency `json:"frequency,omitempty"` + // Controls whether the policy should hide documents with violations. + AutoHideDocs *bool `json:"autoHideDocs,omitempty"` +} + +func (o *CreateDlpReportRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *CreateDlpReportRequest) GetConfig() *DlpConfig { + if o == nil { + return nil + } + return o.Config +} + +func (o *CreateDlpReportRequest) GetFrequency() *DlpFrequency { + if o == nil { + return nil + } + return o.Frequency +} + +func (o *CreateDlpReportRequest) GetAutoHideDocs() *bool { + if o == nil { + return nil + } + return o.AutoHideDocs +} diff --git a/tests/mockserver/internal/sdk/models/components/createdlpreportresponse.go b/tests/mockserver/internal/sdk/models/components/createdlpreportresponse.go new file mode 100644 index 00000000..9c9030bd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createdlpreportresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateDlpReportResponse struct { + // Full policy information that will be used for scans. + Report *DlpReport `json:"report,omitempty"` +} + +func (o *CreateDlpReportResponse) GetReport() *DlpReport { + if o == nil { + return nil + } + return o.Report +} diff --git a/tests/mockserver/internal/sdk/models/components/createshortcutrequest.go b/tests/mockserver/internal/sdk/models/components/createshortcutrequest.go new file mode 100644 index 00000000..f2502a18 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createshortcutrequest.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateShortcutRequest struct { + Data ShortcutMutableProperties `json:"data"` +} + +func (o *CreateShortcutRequest) GetData() ShortcutMutableProperties { + if o == nil { + return ShortcutMutableProperties{} + } + return o.Data +} diff --git a/tests/mockserver/internal/sdk/models/components/createshortcutresponse.go b/tests/mockserver/internal/sdk/models/components/createshortcutresponse.go new file mode 100644 index 00000000..df363e8a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/createshortcutresponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateShortcutResponse struct { + Shortcut *Shortcut `json:"shortcut,omitempty"` + Error *ShortcutError `json:"error,omitempty"` +} + +func (o *CreateShortcutResponse) GetShortcut() *Shortcut { + if o == nil { + return nil + } + return o.Shortcut +} + +func (o *CreateShortcutResponse) GetError() *ShortcutError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/customdatasourceconfig.go b/tests/mockserver/internal/sdk/models/components/customdatasourceconfig.go new file mode 100644 index 00000000..3214d4ac --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customdatasourceconfig.go @@ -0,0 +1,415 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +// DatasourceCategory - The type of this datasource. It is an important signal for relevance and must be specified and cannot be UNCATEGORIZED. Please refer to [this](https://developers.glean.com/docs/indexing_api_datasource_category/) for more details. +type DatasourceCategory string + +const ( + DatasourceCategoryUncategorized DatasourceCategory = "UNCATEGORIZED" + DatasourceCategoryTickets DatasourceCategory = "TICKETS" + DatasourceCategoryCrm DatasourceCategory = "CRM" + DatasourceCategoryPublishedContent DatasourceCategory = "PUBLISHED_CONTENT" + DatasourceCategoryCollaborativeContent DatasourceCategory = "COLLABORATIVE_CONTENT" + DatasourceCategoryQuestionAnswer DatasourceCategory = "QUESTION_ANSWER" + DatasourceCategoryMessaging DatasourceCategory = "MESSAGING" + DatasourceCategoryCodeRepository DatasourceCategory = "CODE_REPOSITORY" + DatasourceCategoryChangeManagement DatasourceCategory = "CHANGE_MANAGEMENT" + DatasourceCategoryPeople DatasourceCategory = "PEOPLE" + DatasourceCategoryEmail DatasourceCategory = "EMAIL" + DatasourceCategorySso DatasourceCategory = "SSO" + DatasourceCategoryAts DatasourceCategory = "ATS" + DatasourceCategoryKnowledgeHub DatasourceCategory = "KNOWLEDGE_HUB" + DatasourceCategoryExternalShortcut DatasourceCategory = "EXTERNAL_SHORTCUT" + DatasourceCategoryEntity DatasourceCategory = "ENTITY" + DatasourceCategoryCalendar DatasourceCategory = "CALENDAR" +) + +func (e DatasourceCategory) ToPointer() *DatasourceCategory { + return &e +} +func (e *DatasourceCategory) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UNCATEGORIZED": + fallthrough + case "TICKETS": + fallthrough + case "CRM": + fallthrough + case "PUBLISHED_CONTENT": + fallthrough + case "COLLABORATIVE_CONTENT": + fallthrough + case "QUESTION_ANSWER": + fallthrough + case "MESSAGING": + fallthrough + case "CODE_REPOSITORY": + fallthrough + case "CHANGE_MANAGEMENT": + fallthrough + case "PEOPLE": + fallthrough + case "EMAIL": + fallthrough + case "SSO": + fallthrough + case "ATS": + fallthrough + case "KNOWLEDGE_HUB": + fallthrough + case "EXTERNAL_SHORTCUT": + fallthrough + case "ENTITY": + fallthrough + case "CALENDAR": + *e = DatasourceCategory(v) + return nil + default: + return fmt.Errorf("invalid value for DatasourceCategory: %v", v) + } +} + +type HideBuiltInFacet string + +const ( + HideBuiltInFacetType HideBuiltInFacet = "TYPE" + HideBuiltInFacetTag HideBuiltInFacet = "TAG" + HideBuiltInFacetAuthor HideBuiltInFacet = "AUTHOR" + HideBuiltInFacetOwner HideBuiltInFacet = "OWNER" +) + +func (e HideBuiltInFacet) ToPointer() *HideBuiltInFacet { + return &e +} +func (e *HideBuiltInFacet) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TYPE": + fallthrough + case "TAG": + fallthrough + case "AUTHOR": + fallthrough + case "OWNER": + *e = HideBuiltInFacet(v) + return nil + default: + return fmt.Errorf("invalid value for HideBuiltInFacet: %v", v) + } +} + +// CustomDatasourceConfigConnectorType - The source from which document content was pulled, e.g. an API crawl or browser history +type CustomDatasourceConfigConnectorType string + +const ( + CustomDatasourceConfigConnectorTypeAPICrawl CustomDatasourceConfigConnectorType = "API_CRAWL" + CustomDatasourceConfigConnectorTypeBrowserCrawl CustomDatasourceConfigConnectorType = "BROWSER_CRAWL" + CustomDatasourceConfigConnectorTypeBrowserHistory CustomDatasourceConfigConnectorType = "BROWSER_HISTORY" + CustomDatasourceConfigConnectorTypeBuiltin CustomDatasourceConfigConnectorType = "BUILTIN" + CustomDatasourceConfigConnectorTypeFederatedSearch CustomDatasourceConfigConnectorType = "FEDERATED_SEARCH" + CustomDatasourceConfigConnectorTypePushAPI CustomDatasourceConfigConnectorType = "PUSH_API" + CustomDatasourceConfigConnectorTypeWebCrawl CustomDatasourceConfigConnectorType = "WEB_CRAWL" + CustomDatasourceConfigConnectorTypeNativeHistory CustomDatasourceConfigConnectorType = "NATIVE_HISTORY" +) + +func (e CustomDatasourceConfigConnectorType) ToPointer() *CustomDatasourceConfigConnectorType { + return &e +} +func (e *CustomDatasourceConfigConnectorType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "API_CRAWL": + fallthrough + case "BROWSER_CRAWL": + fallthrough + case "BROWSER_HISTORY": + fallthrough + case "BUILTIN": + fallthrough + case "FEDERATED_SEARCH": + fallthrough + case "PUSH_API": + fallthrough + case "WEB_CRAWL": + fallthrough + case "NATIVE_HISTORY": + *e = CustomDatasourceConfigConnectorType(v) + return nil + default: + return fmt.Errorf("invalid value for CustomDatasourceConfigConnectorType: %v", v) + } +} + +// CustomDatasourceConfig - Structure describing config properties of a custom datasource +type CustomDatasourceConfig struct { + // Unique identifier of datasource instance to which this config applies. + Name string `json:"name"` + // The user-friendly instance label to display. If omitted, falls back to the title-cased `name`. + DisplayName *string `json:"displayName,omitempty"` + // The type of this datasource. It is an important signal for relevance and must be specified and cannot be UNCATEGORIZED. Please refer to [this](https://developers.glean.com/docs/indexing_api_datasource_category/) for more details. + DatasourceCategory *DatasourceCategory `default:"UNCATEGORIZED" json:"datasourceCategory"` + // Regular expression that matches URLs of documents of the datasource instance. The behavior for multiple matches is non-deterministic. **Note: `urlRegex` is a required field for non-entity datasources, but not required if the datasource is used to push custom entities (ie. datasources where isEntityDatasource is false). Please add a regex as specific as possible to this datasource instance.** + URLRegex *string `json:"urlRegex,omitempty"` + // The URL to an image to be displayed as an icon for this datasource instance. Must have a transparency mask. SVG are recommended over PNG. Public, scio-authenticated and Base64 encoded data URLs are all valid (but not third-party-authenticated URLs). + IconURL *string `json:"iconUrl,omitempty"` + // The list of top-level `objectType`s for the datasource. + ObjectDefinitions []ObjectDefinition `json:"objectDefinitions,omitempty"` + // Example text for what to search for in this datasource + SuggestionText *string `json:"suggestionText,omitempty"` + // The URL of the landing page for this datasource instance. Should point to the most useful page for users, not the company marketing page. + HomeURL *string `json:"homeUrl,omitempty"` + // This only applies to WEB_CRAWL and BROWSER_CRAWL datasources. Defines the seed URLs for crawling. + CrawlerSeedUrls []string `json:"crawlerSeedUrls,omitempty"` + // The URL to an image to be displayed as an icon for this datasource instance in dark mode. Must have a transparency mask. SVG are recommended over PNG. Public, scio-authenticated and Base64 encoded data URLs are all valid (but not third-party-authenticated URLs). + IconDarkURL *string `json:"iconDarkUrl,omitempty"` + // List of built-in facet types that should be hidden for the datasource. + HideBuiltInFacets []HideBuiltInFacet `json:"hideBuiltInFacets,omitempty"` + // A list of regular expressions to apply to an arbitrary URL to transform it into a canonical URL for this datasource instance. Regexes are to be applied in the order specified in this list. + CanonicalizingURLRegex []CanonicalizingRegexType `json:"canonicalizingURLRegex,omitempty"` + // A list of regular expressions to apply to an arbitrary title to transform it into a title that will be displayed in the search results + CanonicalizingTitleRegex []CanonicalizingRegexType `json:"canonicalizingTitleRegex,omitempty"` + // A regex that identifies titles that should not be indexed + RedlistTitleRegex *string `json:"redlistTitleRegex,omitempty"` + ConnectorType *CustomDatasourceConfigConnectorType `json:"connectorType,omitempty"` + // List of actions for this datasource instance that will show up in autocomplete and app card, e.g. "Create new issue" for jira + Quicklinks []Quicklink `json:"quicklinks,omitempty"` + // The name of a render config to use for displaying results from this datasource. Any well known datasource name may be used to render the same as that source, e.g. `web` or `gdrive`. Please refer to [this](https://developers.glean.com/docs/rendering_search_results/) for more details + RenderConfigPreset *string `json:"renderConfigPreset,omitempty"` + // Aliases that can be used as `app` operator-values. + Aliases []string `json:"aliases,omitempty"` + // Whether or not this datasource is hosted on-premise. + IsOnPrem *bool `json:"isOnPrem,omitempty"` + // True if browser activity is able to report the correct URL for VIEW events. Set this to true if the URLs reported by Chrome are constant throughout each page load. Set this to false if the page has Javascript that modifies the URL during or after the load. + TrustURLRegexForViewActivity *bool `default:"true" json:"trustUrlRegexForViewActivity"` + // If true, a utm_source query param will be added to outbound links to this datasource within Glean. + IncludeUtmSource *bool `json:"includeUtmSource,omitempty"` + // If true, the fragment part of the URL will be stripped when converting to a canonical url. + StripFragmentInCanonicalURL *bool `default:"true" json:"stripFragmentInCanonicalUrl"` + // If the datasource uses another datasource for identity info, then the name of the datasource. The identity datasource must exist already. + IdentityDatasourceName *string `json:"identityDatasourceName,omitempty"` + // If the datasource uses a specific product access group, then the name of that group. + ProductAccessGroup *string `json:"productAccessGroup,omitempty"` + // whether email is used to reference users in document ACLs and in group memberships. + IsUserReferencedByEmail *bool `json:"isUserReferencedByEmail,omitempty"` + // True if this datasource is used to push custom entities. + IsEntityDatasource *bool `default:"false" json:"isEntityDatasource"` + // True if this datasource will be used for testing purpose only. Documents from such a datasource wouldn't have any effect on search rankings. + IsTestDatasource *bool `default:"false" json:"isTestDatasource"` +} + +func (c CustomDatasourceConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CustomDatasourceConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CustomDatasourceConfig) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *CustomDatasourceConfig) GetDisplayName() *string { + if o == nil { + return nil + } + return o.DisplayName +} + +func (o *CustomDatasourceConfig) GetDatasourceCategory() *DatasourceCategory { + if o == nil { + return nil + } + return o.DatasourceCategory +} + +func (o *CustomDatasourceConfig) GetURLRegex() *string { + if o == nil { + return nil + } + return o.URLRegex +} + +func (o *CustomDatasourceConfig) GetIconURL() *string { + if o == nil { + return nil + } + return o.IconURL +} + +func (o *CustomDatasourceConfig) GetObjectDefinitions() []ObjectDefinition { + if o == nil { + return nil + } + return o.ObjectDefinitions +} + +func (o *CustomDatasourceConfig) GetSuggestionText() *string { + if o == nil { + return nil + } + return o.SuggestionText +} + +func (o *CustomDatasourceConfig) GetHomeURL() *string { + if o == nil { + return nil + } + return o.HomeURL +} + +func (o *CustomDatasourceConfig) GetCrawlerSeedUrls() []string { + if o == nil { + return nil + } + return o.CrawlerSeedUrls +} + +func (o *CustomDatasourceConfig) GetIconDarkURL() *string { + if o == nil { + return nil + } + return o.IconDarkURL +} + +func (o *CustomDatasourceConfig) GetHideBuiltInFacets() []HideBuiltInFacet { + if o == nil { + return nil + } + return o.HideBuiltInFacets +} + +func (o *CustomDatasourceConfig) GetCanonicalizingURLRegex() []CanonicalizingRegexType { + if o == nil { + return nil + } + return o.CanonicalizingURLRegex +} + +func (o *CustomDatasourceConfig) GetCanonicalizingTitleRegex() []CanonicalizingRegexType { + if o == nil { + return nil + } + return o.CanonicalizingTitleRegex +} + +func (o *CustomDatasourceConfig) GetRedlistTitleRegex() *string { + if o == nil { + return nil + } + return o.RedlistTitleRegex +} + +func (o *CustomDatasourceConfig) GetConnectorType() *CustomDatasourceConfigConnectorType { + if o == nil { + return nil + } + return o.ConnectorType +} + +func (o *CustomDatasourceConfig) GetQuicklinks() []Quicklink { + if o == nil { + return nil + } + return o.Quicklinks +} + +func (o *CustomDatasourceConfig) GetRenderConfigPreset() *string { + if o == nil { + return nil + } + return o.RenderConfigPreset +} + +func (o *CustomDatasourceConfig) GetAliases() []string { + if o == nil { + return nil + } + return o.Aliases +} + +func (o *CustomDatasourceConfig) GetIsOnPrem() *bool { + if o == nil { + return nil + } + return o.IsOnPrem +} + +func (o *CustomDatasourceConfig) GetTrustURLRegexForViewActivity() *bool { + if o == nil { + return nil + } + return o.TrustURLRegexForViewActivity +} + +func (o *CustomDatasourceConfig) GetIncludeUtmSource() *bool { + if o == nil { + return nil + } + return o.IncludeUtmSource +} + +func (o *CustomDatasourceConfig) GetStripFragmentInCanonicalURL() *bool { + if o == nil { + return nil + } + return o.StripFragmentInCanonicalURL +} + +func (o *CustomDatasourceConfig) GetIdentityDatasourceName() *string { + if o == nil { + return nil + } + return o.IdentityDatasourceName +} + +func (o *CustomDatasourceConfig) GetProductAccessGroup() *string { + if o == nil { + return nil + } + return o.ProductAccessGroup +} + +func (o *CustomDatasourceConfig) GetIsUserReferencedByEmail() *bool { + if o == nil { + return nil + } + return o.IsUserReferencedByEmail +} + +func (o *CustomDatasourceConfig) GetIsEntityDatasource() *bool { + if o == nil { + return nil + } + return o.IsEntityDatasource +} + +func (o *CustomDatasourceConfig) GetIsTestDatasource() *bool { + if o == nil { + return nil + } + return o.IsTestDatasource +} diff --git a/tests/mockserver/internal/sdk/models/components/customdatavalue.go b/tests/mockserver/internal/sdk/models/components/customdatavalue.go new file mode 100644 index 00000000..caf1db00 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customdatavalue.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CustomDataValue struct { + DisplayLabel *string `json:"displayLabel,omitempty"` + StringValue *string `json:"stringValue,omitempty"` + // list of strings for multi-value properties + StringListValue []string `json:"stringListValue,omitempty"` + NumberValue *float64 `json:"numberValue,omitempty"` + BooleanValue *bool `json:"booleanValue,omitempty"` +} + +func (o *CustomDataValue) GetDisplayLabel() *string { + if o == nil { + return nil + } + return o.DisplayLabel +} + +func (o *CustomDataValue) GetStringValue() *string { + if o == nil { + return nil + } + return o.StringValue +} + +func (o *CustomDataValue) GetStringListValue() []string { + if o == nil { + return nil + } + return o.StringListValue +} + +func (o *CustomDataValue) GetNumberValue() *float64 { + if o == nil { + return nil + } + return o.NumberValue +} + +func (o *CustomDataValue) GetBooleanValue() *bool { + if o == nil { + return nil + } + return o.BooleanValue +} diff --git a/tests/mockserver/internal/sdk/models/components/customentity.go b/tests/mockserver/internal/sdk/models/components/customentity.go new file mode 100644 index 00000000..5335d758 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customentity.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CustomEntity struct { + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // Unique identifier. + ID *string `json:"id,omitempty"` + // Title or name of the custom entity. + Title *string `json:"title,omitempty"` + // The datasource the custom entity is from. + Datasource *string `json:"datasource,omitempty"` + // The type of the entity. Interpretation is specific to each datasource + ObjectType *string `json:"objectType,omitempty"` + Metadata *CustomEntityMetadata `json:"metadata,omitempty"` + // A list of user roles for the custom entity explicitly granted by the owner. + Roles []UserRoleSpecification `json:"roles,omitempty"` +} + +func (o *CustomEntity) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *CustomEntity) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *CustomEntity) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *CustomEntity) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *CustomEntity) GetObjectType() *string { + if o == nil { + return nil + } + return o.ObjectType +} + +func (o *CustomEntity) GetMetadata() *CustomEntityMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *CustomEntity) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} diff --git a/tests/mockserver/internal/sdk/models/components/customentitymetadata.go b/tests/mockserver/internal/sdk/models/components/customentitymetadata.go new file mode 100644 index 00000000..0425d0df --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customentitymetadata.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CustomEntityMetadata struct { + // Custom fields specific to individual datasources + CustomData map[string]CustomDataValue `json:"customData,omitempty"` +} + +func (o *CustomEntityMetadata) GetCustomData() map[string]CustomDataValue { + if o == nil { + return nil + } + return o.CustomData +} diff --git a/tests/mockserver/internal/sdk/models/components/customer.go b/tests/mockserver/internal/sdk/models/components/customer.go new file mode 100644 index 00000000..970097f4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customer.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" +) + +type Customer struct { + // Unique identifier. + ID string `json:"id"` + // Link to company's associated website domains. + Domains []string `json:"domains,omitempty"` + Company Company `json:"company"` + // A map of {string, int} pairs representing counts of each document type associated with this customer. + DocumentCounts map[string]int64 `json:"documentCounts,omitempty"` + // A list of POC for company. + Poc []Person `json:"poc,omitempty"` + Metadata *CustomerMetadata `json:"metadata,omitempty"` + // A list of Customers. + MergedCustomers []Customer `json:"mergedCustomers,omitempty"` + // The date when the interaction with customer started. + StartDate *types.Date `json:"startDate,omitempty"` + // Average contract annual revenue with that customer. + ContractAnnualRevenue *float64 `json:"contractAnnualRevenue,omitempty"` + // User facing (potentially generated) notes about company. + Notes *string `json:"notes,omitempty"` +} + +func (c Customer) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *Customer) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Customer) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Customer) GetDomains() []string { + if o == nil { + return nil + } + return o.Domains +} + +func (o *Customer) GetCompany() Company { + if o == nil { + return Company{} + } + return o.Company +} + +func (o *Customer) GetDocumentCounts() map[string]int64 { + if o == nil { + return nil + } + return o.DocumentCounts +} + +func (o *Customer) GetPoc() []Person { + if o == nil { + return nil + } + return o.Poc +} + +func (o *Customer) GetMetadata() *CustomerMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Customer) GetMergedCustomers() []Customer { + if o == nil { + return nil + } + return o.MergedCustomers +} + +func (o *Customer) GetStartDate() *types.Date { + if o == nil { + return nil + } + return o.StartDate +} + +func (o *Customer) GetContractAnnualRevenue() *float64 { + if o == nil { + return nil + } + return o.ContractAnnualRevenue +} + +func (o *Customer) GetNotes() *string { + if o == nil { + return nil + } + return o.Notes +} diff --git a/tests/mockserver/internal/sdk/models/components/customermetadata.go b/tests/mockserver/internal/sdk/models/components/customermetadata.go new file mode 100644 index 00000000..4353ed64 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customermetadata.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CustomerMetadata struct { + // The user visible id of the salesforce customer account. + DatasourceID *string `json:"datasourceId,omitempty"` + // Custom fields specific to individual datasources + CustomData map[string]CustomDataValue `json:"customData,omitempty"` +} + +func (o *CustomerMetadata) GetDatasourceID() *string { + if o == nil { + return nil + } + return o.DatasourceID +} + +func (o *CustomerMetadata) GetCustomData() map[string]CustomDataValue { + if o == nil { + return nil + } + return o.CustomData +} diff --git a/tests/mockserver/internal/sdk/models/components/customfielddata.go b/tests/mockserver/internal/sdk/models/components/customfielddata.go new file mode 100644 index 00000000..465208a5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customfielddata.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" +) + +type CustomFieldData struct { + // A user-facing label for this field. + Label string `json:"label"` + Values []CustomFieldValue `json:"values"` + // Determines whether the client should display this custom field + Displayable *bool `default:"true" json:"displayable"` +} + +func (c CustomFieldData) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CustomFieldData) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CustomFieldData) GetLabel() string { + if o == nil { + return "" + } + return o.Label +} + +func (o *CustomFieldData) GetValues() []CustomFieldValue { + if o == nil { + return []CustomFieldValue{} + } + return o.Values +} + +func (o *CustomFieldData) GetDisplayable() *bool { + if o == nil { + return nil + } + return o.Displayable +} diff --git a/tests/mockserver/internal/sdk/models/components/customfieldvalue.go b/tests/mockserver/internal/sdk/models/components/customfieldvalue.go new file mode 100644 index 00000000..425834c1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customfieldvalue.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "errors" + "fmt" + "mockserver/internal/sdk/utils" +) + +type CustomFieldValueType string + +const ( + CustomFieldValueTypeCustomFieldValueStr CustomFieldValueType = "CustomFieldValueStr" + CustomFieldValueTypeCustomFieldValueHyperlink CustomFieldValueType = "CustomFieldValueHyperlink" + CustomFieldValueTypeCustomFieldValuePerson CustomFieldValueType = "CustomFieldValuePerson" +) + +type CustomFieldValue struct { + CustomFieldValueStr *CustomFieldValueStr `queryParam:"inline"` + CustomFieldValueHyperlink *CustomFieldValueHyperlink `queryParam:"inline"` + CustomFieldValuePerson *CustomFieldValuePerson `queryParam:"inline"` + + Type CustomFieldValueType +} + +func CreateCustomFieldValueCustomFieldValueStr(customFieldValueStr CustomFieldValueStr) CustomFieldValue { + typ := CustomFieldValueTypeCustomFieldValueStr + + return CustomFieldValue{ + CustomFieldValueStr: &customFieldValueStr, + Type: typ, + } +} + +func CreateCustomFieldValueCustomFieldValueHyperlink(customFieldValueHyperlink CustomFieldValueHyperlink) CustomFieldValue { + typ := CustomFieldValueTypeCustomFieldValueHyperlink + + return CustomFieldValue{ + CustomFieldValueHyperlink: &customFieldValueHyperlink, + Type: typ, + } +} + +func CreateCustomFieldValueCustomFieldValuePerson(customFieldValuePerson CustomFieldValuePerson) CustomFieldValue { + typ := CustomFieldValueTypeCustomFieldValuePerson + + return CustomFieldValue{ + CustomFieldValuePerson: &customFieldValuePerson, + Type: typ, + } +} + +func (u *CustomFieldValue) UnmarshalJSON(data []byte) error { + + var customFieldValueStr CustomFieldValueStr = CustomFieldValueStr{} + if err := utils.UnmarshalJSON(data, &customFieldValueStr, "", true, true); err == nil { + u.CustomFieldValueStr = &customFieldValueStr + u.Type = CustomFieldValueTypeCustomFieldValueStr + return nil + } + + var customFieldValuePerson CustomFieldValuePerson = CustomFieldValuePerson{} + if err := utils.UnmarshalJSON(data, &customFieldValuePerson, "", true, true); err == nil { + u.CustomFieldValuePerson = &customFieldValuePerson + u.Type = CustomFieldValueTypeCustomFieldValuePerson + return nil + } + + var customFieldValueHyperlink CustomFieldValueHyperlink = CustomFieldValueHyperlink{} + if err := utils.UnmarshalJSON(data, &customFieldValueHyperlink, "", true, true); err == nil { + u.CustomFieldValueHyperlink = &customFieldValueHyperlink + u.Type = CustomFieldValueTypeCustomFieldValueHyperlink + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CustomFieldValue", string(data)) +} + +func (u CustomFieldValue) MarshalJSON() ([]byte, error) { + if u.CustomFieldValueStr != nil { + return utils.MarshalJSON(u.CustomFieldValueStr, "", true) + } + + if u.CustomFieldValueHyperlink != nil { + return utils.MarshalJSON(u.CustomFieldValueHyperlink, "", true) + } + + if u.CustomFieldValuePerson != nil { + return utils.MarshalJSON(u.CustomFieldValuePerson, "", true) + } + + return nil, errors.New("could not marshal union type CustomFieldValue: all fields are null") +} diff --git a/tests/mockserver/internal/sdk/models/components/customfieldvaluehyperlink.go b/tests/mockserver/internal/sdk/models/components/customfieldvaluehyperlink.go new file mode 100644 index 00000000..1fb0ff1e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customfieldvaluehyperlink.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CustomFieldValueHyperlink struct { + // Anchor text for hyperlink. + URLAnchor *string `json:"urlAnchor,omitempty"` + // Link for this URL. + URLLink *string `json:"urlLink,omitempty"` +} + +func (o *CustomFieldValueHyperlink) GetURLAnchor() *string { + if o == nil { + return nil + } + return o.URLAnchor +} + +func (o *CustomFieldValueHyperlink) GetURLLink() *string { + if o == nil { + return nil + } + return o.URLLink +} diff --git a/tests/mockserver/internal/sdk/models/components/customfieldvalueperson.go b/tests/mockserver/internal/sdk/models/components/customfieldvalueperson.go new file mode 100644 index 00000000..ce5cb139 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customfieldvalueperson.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CustomFieldValuePerson struct { + Person *Person `json:"person,omitempty"` +} + +func (o *CustomFieldValuePerson) GetPerson() *Person { + if o == nil { + return nil + } + return o.Person +} diff --git a/tests/mockserver/internal/sdk/models/components/customfieldvaluestr.go b/tests/mockserver/internal/sdk/models/components/customfieldvaluestr.go new file mode 100644 index 00000000..b05cc925 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customfieldvaluestr.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CustomFieldValueStr struct { + // Text field for string value. + StrText *string `json:"strText,omitempty"` +} + +func (o *CustomFieldValueStr) GetStrText() *string { + if o == nil { + return nil + } + return o.StrText +} diff --git a/tests/mockserver/internal/sdk/models/components/customproperty.go b/tests/mockserver/internal/sdk/models/components/customproperty.go new file mode 100644 index 00000000..8b4884e4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/customproperty.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// CustomProperty - Describes the custom properties of the object. +type CustomProperty struct { + Name *string `json:"name,omitempty"` + // Must either be a string or an array of strings. An integer, boolean, etc. is not valid. When OpenAPI Generator supports `oneOf`, we can semantically enforce this. + Value any `json:"value,omitempty"` +} + +func (o *CustomProperty) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *CustomProperty) GetValue() any { + if o == nil { + return nil + } + return o.Value +} diff --git a/tests/mockserver/internal/sdk/models/components/datasourcebulkmembershipdefinition.go b/tests/mockserver/internal/sdk/models/components/datasourcebulkmembershipdefinition.go new file mode 100644 index 00000000..e7ccc6fd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/datasourcebulkmembershipdefinition.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DatasourceBulkMembershipDefinition - describes the membership row of a group in the bulk uploaded. Only one of memberUserId and memberGroupName can be specified. +type DatasourceBulkMembershipDefinition struct { + // If the member is a user, then the email or datasource id for the user + MemberUserID *string `json:"memberUserId,omitempty"` + // If the member is a group, then the name of the member group + MemberGroupName *string `json:"memberGroupName,omitempty"` +} + +func (o *DatasourceBulkMembershipDefinition) GetMemberUserID() *string { + if o == nil { + return nil + } + return o.MemberUserID +} + +func (o *DatasourceBulkMembershipDefinition) GetMemberGroupName() *string { + if o == nil { + return nil + } + return o.MemberGroupName +} diff --git a/tests/mockserver/internal/sdk/models/components/datasourcegroupdefinition.go b/tests/mockserver/internal/sdk/models/components/datasourcegroupdefinition.go new file mode 100644 index 00000000..cb959e6e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/datasourcegroupdefinition.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DatasourceGroupDefinition - describes a group in the datasource +type DatasourceGroupDefinition struct { + // name of the group. Should be unique among all groups for the datasource, and cannot have spaces. + Name string `json:"name"` +} + +func (o *DatasourceGroupDefinition) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/tests/mockserver/internal/sdk/models/components/datasourcemembershipdefinition.go b/tests/mockserver/internal/sdk/models/components/datasourcemembershipdefinition.go new file mode 100644 index 00000000..9965fe61 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/datasourcemembershipdefinition.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DatasourceMembershipDefinition - describes the membership row of a group. Only one of memberUserId and memberGroupName can be specified. +type DatasourceMembershipDefinition struct { + // The group for which the membership is specified + GroupName string `json:"groupName"` + // If the member is a user, then the email or datasource id for the user + MemberUserID *string `json:"memberUserId,omitempty"` + // If the member is a group, then the name of the member group + MemberGroupName *string `json:"memberGroupName,omitempty"` +} + +func (o *DatasourceMembershipDefinition) GetGroupName() string { + if o == nil { + return "" + } + return o.GroupName +} + +func (o *DatasourceMembershipDefinition) GetMemberUserID() *string { + if o == nil { + return nil + } + return o.MemberUserID +} + +func (o *DatasourceMembershipDefinition) GetMemberGroupName() *string { + if o == nil { + return nil + } + return o.MemberGroupName +} diff --git a/tests/mockserver/internal/sdk/models/components/datasourceobjecttypedocumentcountentry.go b/tests/mockserver/internal/sdk/models/components/datasourceobjecttypedocumentcountentry.go new file mode 100644 index 00000000..19bdf977 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/datasourceobjecttypedocumentcountentry.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DatasourceObjectTypeDocumentCountEntry struct { + // The object type of the document + ObjectType *string `json:"objectType,omitempty"` + // The number of documents of the corresponding objectType + Count *int64 `json:"count,omitempty"` +} + +func (o *DatasourceObjectTypeDocumentCountEntry) GetObjectType() *string { + if o == nil { + return nil + } + return o.ObjectType +} + +func (o *DatasourceObjectTypeDocumentCountEntry) GetCount() *int64 { + if o == nil { + return nil + } + return o.Count +} diff --git a/tests/mockserver/internal/sdk/models/components/datasourceprofile.go b/tests/mockserver/internal/sdk/models/components/datasourceprofile.go new file mode 100644 index 00000000..e3e5c141 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/datasourceprofile.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DatasourceProfile struct { + // The datasource the profile is of. + Datasource string `json:"datasource"` + // The display name of the entity in the given datasource. + Handle string `json:"handle"` + // URL to view the entity's profile. + URL *string `json:"url,omitempty"` + // A deep link, if available, into the datasource's native application for the entity's platform (i.e. slack://...). + NativeAppURL *string `json:"nativeAppUrl,omitempty"` + // For internal use only. True iff the data source profile was manually added by a user from within Glean (aka not from the original data source) + IsUserGenerated *bool `json:"isUserGenerated,omitempty"` +} + +func (o *DatasourceProfile) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *DatasourceProfile) GetHandle() string { + if o == nil { + return "" + } + return o.Handle +} + +func (o *DatasourceProfile) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *DatasourceProfile) GetNativeAppURL() *string { + if o == nil { + return nil + } + return o.NativeAppURL +} + +func (o *DatasourceProfile) GetIsUserGenerated() *bool { + if o == nil { + return nil + } + return o.IsUserGenerated +} diff --git a/tests/mockserver/internal/sdk/models/components/datasourceuserdefinition.go b/tests/mockserver/internal/sdk/models/components/datasourceuserdefinition.go new file mode 100644 index 00000000..d1431db7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/datasourceuserdefinition.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DatasourceUserDefinition - describes a user in the datasource +type DatasourceUserDefinition struct { + Email string `json:"email"` + // To be supplied if the user id in the datasource is not the email + UserID *string `json:"userId,omitempty"` + Name string `json:"name"` + // set to false if the user is a former employee or a bot + IsActive *bool `json:"isActive,omitempty"` +} + +func (o *DatasourceUserDefinition) GetEmail() string { + if o == nil { + return "" + } + return o.Email +} + +func (o *DatasourceUserDefinition) GetUserID() *string { + if o == nil { + return nil + } + return o.UserID +} + +func (o *DatasourceUserDefinition) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *DatasourceUserDefinition) GetIsActive() *bool { + if o == nil { + return nil + } + return o.IsActive +} diff --git a/tests/mockserver/internal/sdk/models/components/debugdatasourcestatusidentityresponsecomponent.go b/tests/mockserver/internal/sdk/models/components/debugdatasourcestatusidentityresponsecomponent.go new file mode 100644 index 00000000..1eeda8b6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debugdatasourcestatusidentityresponsecomponent.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DebugDatasourceStatusIdentityResponseComponentCounts struct { + // The number of users/groups/memberships uploaded + Uploaded *int64 `json:"uploaded,omitempty"` +} + +func (o *DebugDatasourceStatusIdentityResponseComponentCounts) GetUploaded() *int64 { + if o == nil { + return nil + } + return o.Uploaded +} + +type DebugDatasourceStatusIdentityResponseComponent struct { + // Information about active and recent successful uploads for the datasource + BulkUploadHistory []BulkUploadHistoryEvent `json:"bulkUploadHistory,omitempty"` + Counts *DebugDatasourceStatusIdentityResponseComponentCounts `json:"counts,omitempty"` +} + +func (o *DebugDatasourceStatusIdentityResponseComponent) GetBulkUploadHistory() []BulkUploadHistoryEvent { + if o == nil { + return nil + } + return o.BulkUploadHistory +} + +func (o *DebugDatasourceStatusIdentityResponseComponent) GetCounts() *DebugDatasourceStatusIdentityResponseComponentCounts { + if o == nil { + return nil + } + return o.Counts +} diff --git a/tests/mockserver/internal/sdk/models/components/debugdatasourcestatusresponse.go b/tests/mockserver/internal/sdk/models/components/debugdatasourcestatusresponse.go new file mode 100644 index 00000000..fe777e9b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debugdatasourcestatusresponse.go @@ -0,0 +1,153 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type DebugDatasourceStatusResponseCounts struct { + // A list of object types and corresponding upload counts + Uploaded []DatasourceObjectTypeDocumentCountEntry `json:"uploaded,omitempty"` + // The number of documents indexed, grouped by objectType + Indexed []DatasourceObjectTypeDocumentCountEntry `json:"indexed,omitempty"` +} + +func (o *DebugDatasourceStatusResponseCounts) GetUploaded() []DatasourceObjectTypeDocumentCountEntry { + if o == nil { + return nil + } + return o.Uploaded +} + +func (o *DebugDatasourceStatusResponseCounts) GetIndexed() []DatasourceObjectTypeDocumentCountEntry { + if o == nil { + return nil + } + return o.Indexed +} + +type Documents struct { + // Information about active and recent successful uploads for the datasource + BulkUploadHistory []BulkUploadHistoryEvent `json:"bulkUploadHistory,omitempty"` + Counts *DebugDatasourceStatusResponseCounts `json:"counts,omitempty"` + // Information about processing history for the datasource + ProcessingHistory []ProcessingHistoryEvent `json:"processingHistory,omitempty"` +} + +func (o *Documents) GetBulkUploadHistory() []BulkUploadHistoryEvent { + if o == nil { + return nil + } + return o.BulkUploadHistory +} + +func (o *Documents) GetCounts() *DebugDatasourceStatusResponseCounts { + if o == nil { + return nil + } + return o.Counts +} + +func (o *Documents) GetProcessingHistory() []ProcessingHistoryEvent { + if o == nil { + return nil + } + return o.ProcessingHistory +} + +type Identity struct { + // Information about processing history for the datasource + ProcessingHistory []ProcessingHistoryEvent `json:"processingHistory,omitempty"` + Users *DebugDatasourceStatusIdentityResponseComponent `json:"users,omitempty"` + Groups *DebugDatasourceStatusIdentityResponseComponent `json:"groups,omitempty"` + Memberships *DebugDatasourceStatusIdentityResponseComponent `json:"memberships,omitempty"` +} + +func (o *Identity) GetProcessingHistory() []ProcessingHistoryEvent { + if o == nil { + return nil + } + return o.ProcessingHistory +} + +func (o *Identity) GetUsers() *DebugDatasourceStatusIdentityResponseComponent { + if o == nil { + return nil + } + return o.Users +} + +func (o *Identity) GetGroups() *DebugDatasourceStatusIdentityResponseComponent { + if o == nil { + return nil + } + return o.Groups +} + +func (o *Identity) GetMemberships() *DebugDatasourceStatusIdentityResponseComponent { + if o == nil { + return nil + } + return o.Memberships +} + +// DatasourceVisibility - The visibility of the datasource, an enum of VISIBLE_TO_ALL, VISIBLE_TO_TEST_GROUP, NOT_VISIBLE +type DatasourceVisibility string + +const ( + DatasourceVisibilityEnabledForAll DatasourceVisibility = "ENABLED_FOR_ALL" + DatasourceVisibilityEnabledForTestGroup DatasourceVisibility = "ENABLED_FOR_TEST_GROUP" + DatasourceVisibilityNotEnabled DatasourceVisibility = "NOT_ENABLED" +) + +func (e DatasourceVisibility) ToPointer() *DatasourceVisibility { + return &e +} +func (e *DatasourceVisibility) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ENABLED_FOR_ALL": + fallthrough + case "ENABLED_FOR_TEST_GROUP": + fallthrough + case "NOT_ENABLED": + *e = DatasourceVisibility(v) + return nil + default: + return fmt.Errorf("invalid value for DatasourceVisibility: %v", v) + } +} + +// DebugDatasourceStatusResponse - Describes the response body of the /debug/{datasource}/status API call +type DebugDatasourceStatusResponse struct { + Documents *Documents `json:"documents,omitempty"` + Identity *Identity `json:"identity,omitempty"` + // The visibility of the datasource, an enum of VISIBLE_TO_ALL, VISIBLE_TO_TEST_GROUP, NOT_VISIBLE + DatasourceVisibility *DatasourceVisibility `json:"datasourceVisibility,omitempty"` +} + +func (o *DebugDatasourceStatusResponse) GetDocuments() *Documents { + if o == nil { + return nil + } + return o.Documents +} + +func (o *DebugDatasourceStatusResponse) GetIdentity() *Identity { + if o == nil { + return nil + } + return o.Identity +} + +func (o *DebugDatasourceStatusResponse) GetDatasourceVisibility() *DatasourceVisibility { + if o == nil { + return nil + } + return o.DatasourceVisibility +} diff --git a/tests/mockserver/internal/sdk/models/components/debugdocumentrequest.go b/tests/mockserver/internal/sdk/models/components/debugdocumentrequest.go new file mode 100644 index 00000000..2ccad29a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debugdocumentrequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DebugDocumentRequest - Describes the request body of the /debug/{datasource}/document API call. +type DebugDocumentRequest struct { + // Object type of the document to get the status for. + ObjectType string `json:"objectType"` + // Glean Document ID within the datasource to get the status for. + DocID string `json:"docId"` +} + +func (o *DebugDocumentRequest) GetObjectType() string { + if o == nil { + return "" + } + return o.ObjectType +} + +func (o *DebugDocumentRequest) GetDocID() string { + if o == nil { + return "" + } + return o.DocID +} diff --git a/tests/mockserver/internal/sdk/models/components/debugdocumentresponse.go b/tests/mockserver/internal/sdk/models/components/debugdocumentresponse.go new file mode 100644 index 00000000..12fcd5cd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debugdocumentresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DebugDocumentResponse - Describes the response body of the /debug/{datasource}/document API call +type DebugDocumentResponse struct { + // Describes the document status response body + Status *DocumentStatusResponse `json:"status,omitempty"` + // describes the access control details of the document + UploadedPermissions *DocumentPermissionsDefinition `json:"uploadedPermissions,omitempty"` +} + +func (o *DebugDocumentResponse) GetStatus() *DocumentStatusResponse { + if o == nil { + return nil + } + return o.Status +} + +func (o *DebugDocumentResponse) GetUploadedPermissions() *DocumentPermissionsDefinition { + if o == nil { + return nil + } + return o.UploadedPermissions +} diff --git a/tests/mockserver/internal/sdk/models/components/debugdocumentsrequest.go b/tests/mockserver/internal/sdk/models/components/debugdocumentsrequest.go new file mode 100644 index 00000000..545ba853 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debugdocumentsrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DebugDocumentsRequest - Describes the request body of the /debug/{datasource}/documents API call. +type DebugDocumentsRequest struct { + // Documents to fetch debug information for + DebugDocuments []DebugDocumentRequest `json:"debugDocuments"` +} + +func (o *DebugDocumentsRequest) GetDebugDocuments() []DebugDocumentRequest { + if o == nil { + return []DebugDocumentRequest{} + } + return o.DebugDocuments +} diff --git a/tests/mockserver/internal/sdk/models/components/debugdocumentsresponse.go b/tests/mockserver/internal/sdk/models/components/debugdocumentsresponse.go new file mode 100644 index 00000000..b813fdd3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debugdocumentsresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DebugDocumentsResponse - Describes the response body of a single document in the /debug/{datasource}/documents API call +type DebugDocumentsResponse struct { + // List of document ids/urls and their debug information + DocumentStatuses []DebugDocumentsResponseItem `json:"documentStatuses,omitempty"` +} + +func (o *DebugDocumentsResponse) GetDocumentStatuses() []DebugDocumentsResponseItem { + if o == nil { + return nil + } + return o.DocumentStatuses +} diff --git a/tests/mockserver/internal/sdk/models/components/debugdocumentsresponseitem.go b/tests/mockserver/internal/sdk/models/components/debugdocumentsresponseitem.go new file mode 100644 index 00000000..47e26f94 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debugdocumentsresponseitem.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DebugDocumentsResponseItem - Describes the response body of a single document in the /debug/{datasource}/documents API call +type DebugDocumentsResponseItem struct { + // Id of the document + DocID *string `json:"docId,omitempty"` + // objectType of the document + ObjectType *string `json:"objectType,omitempty"` + // Describes the response body of the /debug/{datasource}/document API call + DebugInfo *DebugDocumentResponse `json:"debugInfo,omitempty"` +} + +func (o *DebugDocumentsResponseItem) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} + +func (o *DebugDocumentsResponseItem) GetObjectType() *string { + if o == nil { + return nil + } + return o.ObjectType +} + +func (o *DebugDocumentsResponseItem) GetDebugInfo() *DebugDocumentResponse { + if o == nil { + return nil + } + return o.DebugInfo +} diff --git a/tests/mockserver/internal/sdk/models/components/debuguserrequest.go b/tests/mockserver/internal/sdk/models/components/debuguserrequest.go new file mode 100644 index 00000000..fe3f914a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debuguserrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DebugUserRequest - Describes the request body of the /debug/{datasource}/user API call +type DebugUserRequest struct { + // Email ID of the user to get the status for + Email string `json:"email"` +} + +func (o *DebugUserRequest) GetEmail() string { + if o == nil { + return "" + } + return o.Email +} diff --git a/tests/mockserver/internal/sdk/models/components/debuguserresponse.go b/tests/mockserver/internal/sdk/models/components/debuguserresponse.go new file mode 100644 index 00000000..3f6cca7c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/debuguserresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DebugUserResponse - Describes the response body of the /debug/{datasource}/user API call +type DebugUserResponse struct { + // Describes the user status response body + Status *UserStatusResponse `json:"status,omitempty"` + // List of groups the user is a member of, as uploaded via permissions API. + UploadedGroups []DatasourceGroupDefinition `json:"uploadedGroups,omitempty"` +} + +func (o *DebugUserResponse) GetStatus() *UserStatusResponse { + if o == nil { + return nil + } + return o.Status +} + +func (o *DebugUserResponse) GetUploadedGroups() []DatasourceGroupDefinition { + if o == nil { + return nil + } + return o.UploadedGroups +} diff --git a/tests/mockserver/internal/sdk/models/components/deleteannouncementrequest.go b/tests/mockserver/internal/sdk/models/components/deleteannouncementrequest.go new file mode 100644 index 00000000..15d931ea --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deleteannouncementrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteAnnouncementRequest struct { + // The opaque id of the announcement to be deleted. + ID int64 `json:"id"` +} + +func (o *DeleteAnnouncementRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/deleteanswerrequest.go b/tests/mockserver/internal/sdk/models/components/deleteanswerrequest.go new file mode 100644 index 00000000..0ee5ee69 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deleteanswerrequest.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteAnswerRequest struct { + // The opaque ID of the Answer. + ID int64 `json:"id"` + // Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. + DocID *string `json:"docId,omitempty"` +} + +func (o *DeleteAnswerRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *DeleteAnswerRequest) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} diff --git a/tests/mockserver/internal/sdk/models/components/deletechatfilesrequest.go b/tests/mockserver/internal/sdk/models/components/deletechatfilesrequest.go new file mode 100644 index 00000000..e955ca76 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletechatfilesrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteChatFilesRequest struct { + // IDs of files to delete. + FileIds []string `json:"fileIds"` +} + +func (o *DeleteChatFilesRequest) GetFileIds() []string { + if o == nil { + return []string{} + } + return o.FileIds +} diff --git a/tests/mockserver/internal/sdk/models/components/deletechatsrequest.go b/tests/mockserver/internal/sdk/models/components/deletechatsrequest.go new file mode 100644 index 00000000..2f0acbf3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletechatsrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteChatsRequest struct { + // A non-empty list of ids of the Chats to be deleted. + Ids []string `json:"ids"` +} + +func (o *DeleteChatsRequest) GetIds() []string { + if o == nil { + return []string{} + } + return o.Ids +} diff --git a/tests/mockserver/internal/sdk/models/components/deletecollectionitemrequest.go b/tests/mockserver/internal/sdk/models/components/deletecollectionitemrequest.go new file mode 100644 index 00000000..768919fc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletecollectionitemrequest.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteCollectionItemRequest struct { + // The ID of the Collection to remove an item in. + CollectionID float64 `json:"collectionId"` + // The item ID of the CollectionItem to remove from this Collection. + ItemID string `json:"itemId"` + // The (optional) Glean Document ID of the CollectionItem to remove from this Collection if this is an indexed document. + DocumentID *string `json:"documentId,omitempty"` +} + +func (o *DeleteCollectionItemRequest) GetCollectionID() float64 { + if o == nil { + return 0.0 + } + return o.CollectionID +} + +func (o *DeleteCollectionItemRequest) GetItemID() string { + if o == nil { + return "" + } + return o.ItemID +} + +func (o *DeleteCollectionItemRequest) GetDocumentID() *string { + if o == nil { + return nil + } + return o.DocumentID +} diff --git a/tests/mockserver/internal/sdk/models/components/deletecollectionitemresponse.go b/tests/mockserver/internal/sdk/models/components/deletecollectionitemresponse.go new file mode 100644 index 00000000..94f10397 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletecollectionitemresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteCollectionItemResponse struct { + Collection *Collection `json:"collection,omitempty"` +} + +func (o *DeleteCollectionItemResponse) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} diff --git a/tests/mockserver/internal/sdk/models/components/deletecollectionrequest.go b/tests/mockserver/internal/sdk/models/components/deletecollectionrequest.go new file mode 100644 index 00000000..a3460a0a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletecollectionrequest.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteCollectionRequest struct { + // The IDs of the Collections to delete. + Ids []int64 `json:"ids"` + // The datasource allowed in the Collection to be deleted. + AllowedDatasource *string `json:"allowedDatasource,omitempty"` +} + +func (o *DeleteCollectionRequest) GetIds() []int64 { + if o == nil { + return []int64{} + } + return o.Ids +} + +func (o *DeleteCollectionRequest) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} diff --git a/tests/mockserver/internal/sdk/models/components/deletedocumentrequest.go b/tests/mockserver/internal/sdk/models/components/deletedocumentrequest.go new file mode 100644 index 00000000..e103c1c4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletedocumentrequest.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DeleteDocumentRequest - Describes the request body of the /deletedocument API call +type DeleteDocumentRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // datasource of the document + Datasource string `json:"datasource"` + // object type of the document + ObjectType string `json:"objectType"` + // The id of the document + ID string `json:"id"` +} + +func (o *DeleteDocumentRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *DeleteDocumentRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *DeleteDocumentRequest) GetObjectType() string { + if o == nil { + return "" + } + return o.ObjectType +} + +func (o *DeleteDocumentRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/deleteemployeerequest.go b/tests/mockserver/internal/sdk/models/components/deleteemployeerequest.go new file mode 100644 index 00000000..0e582507 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deleteemployeerequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DeleteEmployeeRequest - Describes the request body of the /deleteemployee API call +type DeleteEmployeeRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // The deleted employee's email + EmployeeEmail string `json:"employeeEmail"` +} + +func (o *DeleteEmployeeRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *DeleteEmployeeRequest) GetEmployeeEmail() string { + if o == nil { + return "" + } + return o.EmployeeEmail +} diff --git a/tests/mockserver/internal/sdk/models/components/deletegrouprequest.go b/tests/mockserver/internal/sdk/models/components/deletegrouprequest.go new file mode 100644 index 00000000..4c6a7310 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletegrouprequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DeleteGroupRequest - Describes the request body of the /deletegroup API call +type DeleteGroupRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // The datasource for which the group is removed + Datasource string `json:"datasource"` + // the name of the group to be deleted + GroupName string `json:"groupName"` +} + +func (o *DeleteGroupRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *DeleteGroupRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *DeleteGroupRequest) GetGroupName() string { + if o == nil { + return "" + } + return o.GroupName +} diff --git a/tests/mockserver/internal/sdk/models/components/deletemembershiprequest.go b/tests/mockserver/internal/sdk/models/components/deletemembershiprequest.go new file mode 100644 index 00000000..ed2ab708 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deletemembershiprequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DeleteMembershipRequest - Describes the request body of the /deletemembership API call +type DeleteMembershipRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // The datasource for which the membership is removed + Datasource string `json:"datasource"` + // describes the membership row of a group. Only one of memberUserId and memberGroupName can be specified. + Membership DatasourceMembershipDefinition `json:"membership"` +} + +func (o *DeleteMembershipRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *DeleteMembershipRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *DeleteMembershipRequest) GetMembership() DatasourceMembershipDefinition { + if o == nil { + return DatasourceMembershipDefinition{} + } + return o.Membership +} diff --git a/tests/mockserver/internal/sdk/models/components/deleteshortcutrequest.go b/tests/mockserver/internal/sdk/models/components/deleteshortcutrequest.go new file mode 100644 index 00000000..440f2958 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deleteshortcutrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DeleteShortcutRequest struct { + // The opaque id of the user generated content. + ID int64 `json:"id"` +} + +func (o *DeleteShortcutRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/deleteteamrequest.go b/tests/mockserver/internal/sdk/models/components/deleteteamrequest.go new file mode 100644 index 00000000..7d877567 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deleteteamrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DeleteTeamRequest - Describes the request body of the /deleteteam API call +type DeleteTeamRequest struct { + // The deleted team's id + ID string `json:"id"` +} + +func (o *DeleteTeamRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/deleteuserrequest.go b/tests/mockserver/internal/sdk/models/components/deleteuserrequest.go new file mode 100644 index 00000000..9e434013 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/deleteuserrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DeleteUserRequest - Describes the request body of the /deleteuser API call +type DeleteUserRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // The datasource for which the user is removed + Datasource string `json:"datasource"` + // The email of the user to be deleted + Email string `json:"email"` +} + +func (o *DeleteUserRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *DeleteUserRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *DeleteUserRequest) GetEmail() string { + if o == nil { + return "" + } + return o.Email +} diff --git a/tests/mockserver/internal/sdk/models/components/disambiguation.go b/tests/mockserver/internal/sdk/models/components/disambiguation.go new file mode 100644 index 00000000..4809f071 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/disambiguation.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Disambiguation - A disambiguation between multiple entities with the same name +type Disambiguation struct { + // Name of the ambiguous entity + Name *string `json:"name,omitempty"` + // The unique id of the entity in the knowledge graph + ID *string `json:"id,omitempty"` + // The type of entity. + Type *EntityType `json:"type,omitempty"` +} + +func (o *Disambiguation) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *Disambiguation) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Disambiguation) GetType() *EntityType { + if o == nil { + return nil + } + return o.Type +} diff --git a/tests/mockserver/internal/sdk/models/components/displayablelistitemuiconfig.go b/tests/mockserver/internal/sdk/models/components/displayablelistitemuiconfig.go new file mode 100644 index 00000000..a0e60528 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/displayablelistitemuiconfig.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DisplayableListItemUIConfig - UI configurations for each item of the list +type DisplayableListItemUIConfig struct { + // show a "New" pill next to the item + ShowNewIndicator *bool `json:"showNewIndicator,omitempty"` +} + +func (o *DisplayableListItemUIConfig) GetShowNewIndicator() *bool { + if o == nil { + return nil + } + return o.ShowNewIndicator +} diff --git a/tests/mockserver/internal/sdk/models/components/dlpconfig.go b/tests/mockserver/internal/sdk/models/components/dlpconfig.go new file mode 100644 index 00000000..3502af7b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/dlpconfig.go @@ -0,0 +1,125 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DlpConfig - Detailed configuration of what documents and sensitive content will be scanned. +type DlpConfig struct { + // Synonymous with report/policy id. + Version *int64 `json:"version,omitempty"` + // DEPRECATED - use `sensitiveContentOptions` instead. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + SensitiveInfoTypes []SensitiveInfoType `json:"sensitiveInfoTypes,omitempty"` + // Controls which data-sources and what time-range to include in scans. + InputOptions *InputOptions `json:"inputOptions,omitempty"` + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + ExternalSharingOptions *ExternalSharingOptions `json:"externalSharingOptions,omitempty"` + // Controls how "shared" a document must be to get picked for scans. + BroadSharingOptions *SharingOptions `json:"broadSharingOptions,omitempty"` + // Options for defining sensitive content within scanned documents. + SensitiveContentOptions *SensitiveContentOptions `json:"sensitiveContentOptions,omitempty"` + ReportName *string `json:"reportName,omitempty"` + // Interval between scans. + Frequency *string `json:"frequency,omitempty"` + // Details about the person who created this report/policy. + CreatedBy *DlpPerson `json:"createdBy,omitempty"` + // Timestamp at which this configuration was created. + CreatedAt *string `json:"createdAt,omitempty"` + // redact quote in findings of the report + RedactQuote *bool `json:"redactQuote,omitempty"` + // auto hide documents with findings in the report + AutoHideDocs *bool `json:"autoHideDocs,omitempty"` + // Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. + AllowlistOptions *AllowlistOptions `json:"allowlistOptions,omitempty"` +} + +func (o *DlpConfig) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *DlpConfig) GetSensitiveInfoTypes() []SensitiveInfoType { + if o == nil { + return nil + } + return o.SensitiveInfoTypes +} + +func (o *DlpConfig) GetInputOptions() *InputOptions { + if o == nil { + return nil + } + return o.InputOptions +} + +func (o *DlpConfig) GetExternalSharingOptions() *ExternalSharingOptions { + if o == nil { + return nil + } + return o.ExternalSharingOptions +} + +func (o *DlpConfig) GetBroadSharingOptions() *SharingOptions { + if o == nil { + return nil + } + return o.BroadSharingOptions +} + +func (o *DlpConfig) GetSensitiveContentOptions() *SensitiveContentOptions { + if o == nil { + return nil + } + return o.SensitiveContentOptions +} + +func (o *DlpConfig) GetReportName() *string { + if o == nil { + return nil + } + return o.ReportName +} + +func (o *DlpConfig) GetFrequency() *string { + if o == nil { + return nil + } + return o.Frequency +} + +func (o *DlpConfig) GetCreatedBy() *DlpPerson { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *DlpConfig) GetCreatedAt() *string { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *DlpConfig) GetRedactQuote() *bool { + if o == nil { + return nil + } + return o.RedactQuote +} + +func (o *DlpConfig) GetAutoHideDocs() *bool { + if o == nil { + return nil + } + return o.AutoHideDocs +} + +func (o *DlpConfig) GetAllowlistOptions() *AllowlistOptions { + if o == nil { + return nil + } + return o.AllowlistOptions +} diff --git a/tests/mockserver/internal/sdk/models/components/dlpfrequency.go b/tests/mockserver/internal/sdk/models/components/dlpfrequency.go new file mode 100644 index 00000000..7c8f72b3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/dlpfrequency.go @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DlpFrequency - Interval between scans. DAILY is deprecated. +type DlpFrequency string + +const ( + DlpFrequencyOnce DlpFrequency = "ONCE" + DlpFrequencyDaily DlpFrequency = "DAILY" + DlpFrequencyWeekly DlpFrequency = "WEEKLY" + DlpFrequencyContinuous DlpFrequency = "CONTINUOUS" + DlpFrequencyNone DlpFrequency = "NONE" +) + +func (e DlpFrequency) ToPointer() *DlpFrequency { + return &e +} +func (e *DlpFrequency) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ONCE": + fallthrough + case "DAILY": + fallthrough + case "WEEKLY": + fallthrough + case "CONTINUOUS": + fallthrough + case "NONE": + *e = DlpFrequency(v) + return nil + default: + return fmt.Errorf("invalid value for DlpFrequency: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/dlpperson.go b/tests/mockserver/internal/sdk/models/components/dlpperson.go new file mode 100644 index 00000000..1bcd022f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/dlpperson.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DlpPerson - Details about the person who created this report/policy. +type DlpPerson struct { + // The display name. + Name string `json:"name"` + // An opaque identifier that can be used to request metadata for a Person. + ObfuscatedID string `json:"obfuscatedId"` + Metadata *DlpPersonMetadata `json:"metadata,omitempty"` +} + +func (o *DlpPerson) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *DlpPerson) GetObfuscatedID() string { + if o == nil { + return "" + } + return o.ObfuscatedID +} + +func (o *DlpPerson) GetMetadata() *DlpPersonMetadata { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/tests/mockserver/internal/sdk/models/components/dlppersonmetadata.go b/tests/mockserver/internal/sdk/models/components/dlppersonmetadata.go new file mode 100644 index 00000000..5baf03bb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/dlppersonmetadata.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DlpPersonMetadata struct { + // The first name of the person + FirstName *string `json:"firstName,omitempty"` + // The user's primary email address + Email *string `json:"email,omitempty"` +} + +func (o *DlpPersonMetadata) GetFirstName() *string { + if o == nil { + return nil + } + return o.FirstName +} + +func (o *DlpPersonMetadata) GetEmail() *string { + if o == nil { + return nil + } + return o.Email +} diff --git a/tests/mockserver/internal/sdk/models/components/dlpreport.go b/tests/mockserver/internal/sdk/models/components/dlpreport.go new file mode 100644 index 00000000..8e6ccffc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/dlpreport.go @@ -0,0 +1,155 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type LastScanStatus string + +const ( + LastScanStatusPending LastScanStatus = "PENDING" + LastScanStatusSuccess LastScanStatus = "SUCCESS" + LastScanStatusFailure LastScanStatus = "FAILURE" + LastScanStatusCancelled LastScanStatus = "CANCELLED" + LastScanStatusCancelling LastScanStatus = "CANCELLING" + LastScanStatusActive LastScanStatus = "ACTIVE" +) + +func (e LastScanStatus) ToPointer() *LastScanStatus { + return &e +} +func (e *LastScanStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PENDING": + fallthrough + case "SUCCESS": + fallthrough + case "FAILURE": + fallthrough + case "CANCELLED": + fallthrough + case "CANCELLING": + fallthrough + case "ACTIVE": + *e = LastScanStatus(v) + return nil + default: + return fmt.Errorf("invalid value for LastScanStatus: %v", v) + } +} + +// DlpReport - Full policy information that will be used for scans. +type DlpReport struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Detailed configuration of what documents and sensitive content will be scanned. + Config *DlpConfig `json:"config,omitempty"` + // Interval between scans. DAILY is deprecated. + Frequency *DlpFrequency `json:"frequency,omitempty"` + // The status of the policy/report. Only ACTIVE status will be picked for scans. + Status *DlpReportStatus `json:"status,omitempty"` + // Details about the person who created this report/policy. + CreatedBy *DlpPerson `json:"createdBy,omitempty"` + // Timestamp at which the policy was created. + CreatedAt *string `json:"createdAt,omitempty"` + // Timestamp at which the policy was last updated. + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + // Auto hide documents with findings in the policy. + AutoHideDocs *bool `json:"autoHideDocs,omitempty"` + LastScanStatus *LastScanStatus `json:"lastScanStatus,omitempty"` + // The timestamp at which the report's last run/scan began. + LastScanStartTime *string `json:"lastScanStartTime,omitempty"` + // Details about the person who created this report/policy. + UpdatedBy *DlpPerson `json:"updatedBy,omitempty"` +} + +func (o *DlpReport) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *DlpReport) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *DlpReport) GetConfig() *DlpConfig { + if o == nil { + return nil + } + return o.Config +} + +func (o *DlpReport) GetFrequency() *DlpFrequency { + if o == nil { + return nil + } + return o.Frequency +} + +func (o *DlpReport) GetStatus() *DlpReportStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *DlpReport) GetCreatedBy() *DlpPerson { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *DlpReport) GetCreatedAt() *string { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *DlpReport) GetLastUpdatedAt() *string { + if o == nil { + return nil + } + return o.LastUpdatedAt +} + +func (o *DlpReport) GetAutoHideDocs() *bool { + if o == nil { + return nil + } + return o.AutoHideDocs +} + +func (o *DlpReport) GetLastScanStatus() *LastScanStatus { + if o == nil { + return nil + } + return o.LastScanStatus +} + +func (o *DlpReport) GetLastScanStartTime() *string { + if o == nil { + return nil + } + return o.LastScanStartTime +} + +func (o *DlpReport) GetUpdatedBy() *DlpPerson { + if o == nil { + return nil + } + return o.UpdatedBy +} diff --git a/tests/mockserver/internal/sdk/models/components/dlpreportstatus.go b/tests/mockserver/internal/sdk/models/components/dlpreportstatus.go new file mode 100644 index 00000000..6c4ea46f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/dlpreportstatus.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DlpReportStatus - The status of the policy/report. Only ACTIVE status will be picked for scans. +type DlpReportStatus string + +const ( + DlpReportStatusActive DlpReportStatus = "ACTIVE" + DlpReportStatusInactive DlpReportStatus = "INACTIVE" + DlpReportStatusCancelled DlpReportStatus = "CANCELLED" + DlpReportStatusNone DlpReportStatus = "NONE" +) + +func (e DlpReportStatus) ToPointer() *DlpReportStatus { + return &e +} +func (e *DlpReportStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ACTIVE": + fallthrough + case "INACTIVE": + fallthrough + case "CANCELLED": + fallthrough + case "NONE": + *e = DlpReportStatus(v) + return nil + default: + return fmt.Errorf("invalid value for DlpReportStatus: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/dlpsimpleresult.go b/tests/mockserver/internal/sdk/models/components/dlpsimpleresult.go new file mode 100644 index 00000000..f75e7454 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/dlpsimpleresult.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type DlpSimpleResult string + +const ( + DlpSimpleResultSuccess DlpSimpleResult = "SUCCESS" + DlpSimpleResultFailure DlpSimpleResult = "FAILURE" +) + +func (e DlpSimpleResult) ToPointer() *DlpSimpleResult { + return &e +} +func (e *DlpSimpleResult) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "SUCCESS": + fallthrough + case "FAILURE": + *e = DlpSimpleResult(v) + return nil + default: + return fmt.Errorf("invalid value for DlpSimpleResult: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/document.go b/tests/mockserver/internal/sdk/models/components/document.go new file mode 100644 index 00000000..842cd5b2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/document.go @@ -0,0 +1,101 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Document struct { + // The Glean Document ID. + ID *string `json:"id,omitempty"` + // The app or other repository type from which the document was extracted + Datasource *string `json:"datasource,omitempty"` + // The source from which document content was pulled, e.g. an API crawl or browser history + ConnectorType *ConnectorType `json:"connectorType,omitempty"` + // The datasource-specific type of the document (e.g. for Jira issues, this is the issue type such as Bug or Feature Request). + DocType *string `json:"docType,omitempty"` + Content *DocumentContent `json:"content,omitempty"` + ContainerDocument *Document `json:"containerDocument,omitempty"` + ParentDocument *Document `json:"parentDocument,omitempty"` + // The title of the document. + Title *string `json:"title,omitempty"` + // A permalink for the document. + URL *string `json:"url,omitempty"` + Metadata *DocumentMetadata `json:"metadata,omitempty"` + // A list of content sub-sections in the document, e.g. text blocks with different headings in a Drive doc or Confluence page. + Sections []DocumentSection `json:"sections,omitempty"` +} + +func (o *Document) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Document) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *Document) GetConnectorType() *ConnectorType { + if o == nil { + return nil + } + return o.ConnectorType +} + +func (o *Document) GetDocType() *string { + if o == nil { + return nil + } + return o.DocType +} + +func (o *Document) GetContent() *DocumentContent { + if o == nil { + return nil + } + return o.Content +} + +func (o *Document) GetContainerDocument() *Document { + if o == nil { + return nil + } + return o.ContainerDocument +} + +func (o *Document) GetParentDocument() *Document { + if o == nil { + return nil + } + return o.ParentDocument +} + +func (o *Document) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Document) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *Document) GetMetadata() *DocumentMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *Document) GetSections() []DocumentSection { + if o == nil { + return nil + } + return o.Sections +} diff --git a/tests/mockserver/internal/sdk/models/components/documentcontent.go b/tests/mockserver/internal/sdk/models/components/documentcontent.go new file mode 100644 index 00000000..d935b850 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentcontent.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DocumentContent struct { + // The plaintext content of the document. + FullTextList []string `json:"fullTextList,omitempty"` +} + +func (o *DocumentContent) GetFullTextList() []string { + if o == nil { + return nil + } + return o.FullTextList +} diff --git a/tests/mockserver/internal/sdk/models/components/documentdefinition.go b/tests/mockserver/internal/sdk/models/components/documentdefinition.go new file mode 100644 index 00000000..d4e073eb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentdefinition.go @@ -0,0 +1,213 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DocumentDefinition - Indexable document structure +type DocumentDefinition struct { + // Document title, in plain text, if present. If not present, the title would be attempted to be extracted from the content. + Title *string `json:"title,omitempty"` + // Source filename, in plain text, for the document. May be used as a fallback title for the document, if the title is not provided and cannot be extracted from the content. Populate this if there is no explicit title for the document and the content is sourced from a file. + Filename *string `json:"filename,omitempty"` + // The container name for the content (Folder for example for file content). + Container *string `json:"container,omitempty"` + // This represents the datasource sepcific id of the container. + ContainerDatasourceID *string `json:"containerDatasourceId,omitempty"` + // This represents the object type of the container. It cannot have spaces or _ + ContainerObjectType *string `json:"containerObjectType,omitempty"` + Datasource string `json:"datasource"` + // The type of the document (Case, KnowledgeArticle for Salesforce for example). It cannot have spaces or _ + ObjectType *string `json:"objectType,omitempty"` + // The permalink for viewing the document. **Note: viewURL is a required field for non-entity datasources, but not required if the datasource is used to push custom entities (ie. datasources where isEntityDatasource is false).**' + // + ViewURL *string `json:"viewURL,omitempty"` + // The datasource specific id for the document. This field is case insensitive and should not be more than 200 characters in length. + ID *string `json:"id,omitempty"` + // Describes text content or base64 encoded binary content + Summary *ContentDefinition `json:"summary,omitempty"` + // Describes text content or base64 encoded binary content + Body *ContentDefinition `json:"body,omitempty"` + // Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. + Author *UserReferenceDefinition `json:"author,omitempty"` + // Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. + Owner *UserReferenceDefinition `json:"owner,omitempty"` + // describes the access control details of the document + Permissions *DocumentPermissionsDefinition `json:"permissions,omitempty"` + // The creation time, in epoch seconds. + CreatedAt *int64 `json:"createdAt,omitempty"` + // The last update time, in epoch seconds. + UpdatedAt *int64 `json:"updatedAt,omitempty"` + // Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. + UpdatedBy *UserReferenceDefinition `json:"updatedBy,omitempty"` + // Labels associated with the document. + Tags []string `json:"tags,omitempty"` + // describes the interactions on the document + Interactions *DocumentInteractionsDefinition `json:"interactions,omitempty"` + Status *string `json:"status,omitempty"` + // Additional variations of the URL that this document points to. + AdditionalUrls []string `json:"additionalUrls,omitempty"` + // Comments associated with the document. + Comments []CommentDefinition `json:"comments,omitempty"` + // Additional metadata properties of the document. These can surface as [facets and operators](https://developers.glean.com/docs/facets_and_operators_for_custom_datasources/). + CustomProperties []CustomProperty `json:"customProperties,omitempty"` +} + +func (o *DocumentDefinition) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *DocumentDefinition) GetFilename() *string { + if o == nil { + return nil + } + return o.Filename +} + +func (o *DocumentDefinition) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *DocumentDefinition) GetContainerDatasourceID() *string { + if o == nil { + return nil + } + return o.ContainerDatasourceID +} + +func (o *DocumentDefinition) GetContainerObjectType() *string { + if o == nil { + return nil + } + return o.ContainerObjectType +} + +func (o *DocumentDefinition) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *DocumentDefinition) GetObjectType() *string { + if o == nil { + return nil + } + return o.ObjectType +} + +func (o *DocumentDefinition) GetViewURL() *string { + if o == nil { + return nil + } + return o.ViewURL +} + +func (o *DocumentDefinition) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *DocumentDefinition) GetSummary() *ContentDefinition { + if o == nil { + return nil + } + return o.Summary +} + +func (o *DocumentDefinition) GetBody() *ContentDefinition { + if o == nil { + return nil + } + return o.Body +} + +func (o *DocumentDefinition) GetAuthor() *UserReferenceDefinition { + if o == nil { + return nil + } + return o.Author +} + +func (o *DocumentDefinition) GetOwner() *UserReferenceDefinition { + if o == nil { + return nil + } + return o.Owner +} + +func (o *DocumentDefinition) GetPermissions() *DocumentPermissionsDefinition { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *DocumentDefinition) GetCreatedAt() *int64 { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *DocumentDefinition) GetUpdatedAt() *int64 { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *DocumentDefinition) GetUpdatedBy() *UserReferenceDefinition { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *DocumentDefinition) GetTags() []string { + if o == nil { + return nil + } + return o.Tags +} + +func (o *DocumentDefinition) GetInteractions() *DocumentInteractionsDefinition { + if o == nil { + return nil + } + return o.Interactions +} + +func (o *DocumentDefinition) GetStatus() *string { + if o == nil { + return nil + } + return o.Status +} + +func (o *DocumentDefinition) GetAdditionalUrls() []string { + if o == nil { + return nil + } + return o.AdditionalUrls +} + +func (o *DocumentDefinition) GetComments() []CommentDefinition { + if o == nil { + return nil + } + return o.Comments +} + +func (o *DocumentDefinition) GetCustomProperties() []CustomProperty { + if o == nil { + return nil + } + return o.CustomProperties +} diff --git a/tests/mockserver/internal/sdk/models/components/documentinsight.go b/tests/mockserver/internal/sdk/models/components/documentinsight.go new file mode 100644 index 00000000..3b304aee --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentinsight.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DocumentInsight struct { + Document Document `json:"document"` + ViewCount *CountInfo `json:"viewCount,omitempty"` + VisitorCount *CountInfo `json:"visitorCount,omitempty"` +} + +func (o *DocumentInsight) GetDocument() Document { + if o == nil { + return Document{} + } + return o.Document +} + +func (o *DocumentInsight) GetViewCount() *CountInfo { + if o == nil { + return nil + } + return o.ViewCount +} + +func (o *DocumentInsight) GetVisitorCount() *CountInfo { + if o == nil { + return nil + } + return o.VisitorCount +} diff --git a/tests/mockserver/internal/sdk/models/components/documentinteractions.go b/tests/mockserver/internal/sdk/models/components/documentinteractions.go new file mode 100644 index 00000000..81376a14 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentinteractions.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DocumentInteractions struct { + // The count of comments (thread replies in the case of slack). + NumComments *int64 `json:"numComments,omitempty"` + // The count of reactions on the document. + NumReactions *int64 `json:"numReactions,omitempty"` + // To be deprecated in favor of reacts. A (potentially non-exhaustive) list of reactions for the document. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Reactions []string `json:"reactions,omitempty"` + Reacts []Reaction `json:"reacts,omitempty"` + // Describes instances of someone posting a link to this document in one of our indexed datasources. + Shares []Share `json:"shares,omitempty"` + VisitorCount *CountInfo `json:"visitorCount,omitempty"` +} + +func (o *DocumentInteractions) GetNumComments() *int64 { + if o == nil { + return nil + } + return o.NumComments +} + +func (o *DocumentInteractions) GetNumReactions() *int64 { + if o == nil { + return nil + } + return o.NumReactions +} + +func (o *DocumentInteractions) GetReactions() []string { + if o == nil { + return nil + } + return o.Reactions +} + +func (o *DocumentInteractions) GetReacts() []Reaction { + if o == nil { + return nil + } + return o.Reacts +} + +func (o *DocumentInteractions) GetShares() []Share { + if o == nil { + return nil + } + return o.Shares +} + +func (o *DocumentInteractions) GetVisitorCount() *CountInfo { + if o == nil { + return nil + } + return o.VisitorCount +} diff --git a/tests/mockserver/internal/sdk/models/components/documentinteractionsdefinition.go b/tests/mockserver/internal/sdk/models/components/documentinteractionsdefinition.go new file mode 100644 index 00000000..f49af722 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentinteractionsdefinition.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DocumentInteractionsDefinition - describes the interactions on the document +type DocumentInteractionsDefinition struct { + NumViews *int64 `json:"numViews,omitempty"` + NumLikes *int64 `json:"numLikes,omitempty"` + NumComments *int64 `json:"numComments,omitempty"` +} + +func (o *DocumentInteractionsDefinition) GetNumViews() *int64 { + if o == nil { + return nil + } + return o.NumViews +} + +func (o *DocumentInteractionsDefinition) GetNumLikes() *int64 { + if o == nil { + return nil + } + return o.NumLikes +} + +func (o *DocumentInteractionsDefinition) GetNumComments() *int64 { + if o == nil { + return nil + } + return o.NumComments +} diff --git a/tests/mockserver/internal/sdk/models/components/documentmetadata.go b/tests/mockserver/internal/sdk/models/components/documentmetadata.go new file mode 100644 index 00000000..66a4dafb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentmetadata.go @@ -0,0 +1,366 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type DocumentMetadata struct { + Datasource *string `json:"datasource,omitempty"` + // The datasource instance from which the document was extracted. + DatasourceInstance *string `json:"datasourceInstance,omitempty"` + // The type of the result. Interpretation is specific to each datasource. (e.g. for Jira issues, this is the issue type such as Bug or Feature Request). + ObjectType *string `json:"objectType,omitempty"` + // The name of the container (higher level parent, not direct parent) of the result. Interpretation is specific to each datasource (e.g. Channels for Slack, Project for Jira). cf. parentId + Container *string `json:"container,omitempty"` + // The Glean Document ID of the container. Uniquely identifies the container. + ContainerID *string `json:"containerId,omitempty"` + // The Glean Document ID of the super container. Super container represents a broader abstraction that contains many containers. For example, whereas container might refer to a folder, super container would refer to a drive. + SuperContainerID *string `json:"superContainerId,omitempty"` + // The id of the direct parent of the result. Interpretation is specific to each datasource (e.g. parent issue for Jira). cf. container + ParentID *string `json:"parentId,omitempty"` + MimeType *string `json:"mimeType,omitempty"` + // The index-wide unique identifier. + DocumentID *string `json:"documentId,omitempty"` + // A unique identifier used to represent the document in any logging or feedback requests in place of documentId. + LoggingID *string `json:"loggingId,omitempty"` + // Hash of the Glean Document ID. + DocumentIDHash *string `json:"documentIdHash,omitempty"` + CreateTime *time.Time `json:"createTime,omitempty"` + UpdateTime *time.Time `json:"updateTime,omitempty"` + Author *Person `json:"author,omitempty"` + Owner *Person `json:"owner,omitempty"` + // A list of people mentioned in the document. + MentionedPeople []Person `json:"mentionedPeople,omitempty"` + // The level of visibility of the document as understood by our system. + Visibility *DocumentVisibility `json:"visibility,omitempty"` + // A list of components this result is associated with. Interpretation is specific to each datasource. (e.g. for Jira issues, these are [components](https://confluence.atlassian.com/jirasoftwarecloud/organizing-work-with-components-764478279.html).) + Components []string `json:"components,omitempty"` + // The status or disposition of the result. Interpretation is specific to each datasource. (e.g. for Jira issues, this is the issue status such as Done, In Progress or Will Not Fix). + Status *string `json:"status,omitempty"` + // The status category of the result. Meant to be more general than status. Interpretation is specific to each datasource. + StatusCategory *string `json:"statusCategory,omitempty"` + // A list of stars associated with this result. "Pin" is an older name. + Pins []PinDocument `json:"pins,omitempty"` + // The document priority. Interpretation is datasource specific. + Priority *string `json:"priority,omitempty"` + AssignedTo *Person `json:"assignedTo,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + // A list of tags for the document. Interpretation is datasource specific. + Labels []string `json:"labels,omitempty"` + // A list of collections that the document belongs to. + Collections []Collection `json:"collections,omitempty"` + // The user-visible datasource specific id (e.g. Salesforce case number for example, GitHub PR number). + DatasourceID *string `json:"datasourceId,omitempty"` + Interactions *DocumentInteractions `json:"interactions,omitempty"` + Verification *Verification `json:"verification,omitempty"` + ViewerInfo *ViewerInfo `json:"viewerInfo,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + VisitCount *CountInfo `json:"visitCount,omitempty"` + // A list of shortcuts of which destination URL is for the document. + Shortcuts []Shortcut `json:"shortcuts,omitempty"` + // For file datasources like onedrive/github etc this has the path to the file + Path *string `json:"path,omitempty"` + // Custom fields specific to individual datasources + CustomData map[string]CustomDataValue `json:"customData,omitempty"` + // The document's document_category(.proto). + DocumentCategory *string `json:"documentCategory,omitempty"` + ContactPerson *Person `json:"contactPerson,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + IndexStatus *IndexStatus `json:"indexStatus,omitempty"` + // A list of documents that are ancestors of this document in the hierarchy of the document's datasource, for example parent folders or containers. Ancestors can be of different types and some may not be indexed. Higher level ancestors appear earlier in the list. + Ancestors []Document `json:"ancestors,omitempty"` +} + +func (d DocumentMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DocumentMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { + return err + } + return nil +} + +func (o *DocumentMetadata) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *DocumentMetadata) GetDatasourceInstance() *string { + if o == nil { + return nil + } + return o.DatasourceInstance +} + +func (o *DocumentMetadata) GetObjectType() *string { + if o == nil { + return nil + } + return o.ObjectType +} + +func (o *DocumentMetadata) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *DocumentMetadata) GetContainerID() *string { + if o == nil { + return nil + } + return o.ContainerID +} + +func (o *DocumentMetadata) GetSuperContainerID() *string { + if o == nil { + return nil + } + return o.SuperContainerID +} + +func (o *DocumentMetadata) GetParentID() *string { + if o == nil { + return nil + } + return o.ParentID +} + +func (o *DocumentMetadata) GetMimeType() *string { + if o == nil { + return nil + } + return o.MimeType +} + +func (o *DocumentMetadata) GetDocumentID() *string { + if o == nil { + return nil + } + return o.DocumentID +} + +func (o *DocumentMetadata) GetLoggingID() *string { + if o == nil { + return nil + } + return o.LoggingID +} + +func (o *DocumentMetadata) GetDocumentIDHash() *string { + if o == nil { + return nil + } + return o.DocumentIDHash +} + +func (o *DocumentMetadata) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *DocumentMetadata) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *DocumentMetadata) GetAuthor() *Person { + if o == nil { + return nil + } + return o.Author +} + +func (o *DocumentMetadata) GetOwner() *Person { + if o == nil { + return nil + } + return o.Owner +} + +func (o *DocumentMetadata) GetMentionedPeople() []Person { + if o == nil { + return nil + } + return o.MentionedPeople +} + +func (o *DocumentMetadata) GetVisibility() *DocumentVisibility { + if o == nil { + return nil + } + return o.Visibility +} + +func (o *DocumentMetadata) GetComponents() []string { + if o == nil { + return nil + } + return o.Components +} + +func (o *DocumentMetadata) GetStatus() *string { + if o == nil { + return nil + } + return o.Status +} + +func (o *DocumentMetadata) GetStatusCategory() *string { + if o == nil { + return nil + } + return o.StatusCategory +} + +func (o *DocumentMetadata) GetPins() []PinDocument { + if o == nil { + return nil + } + return o.Pins +} + +func (o *DocumentMetadata) GetPriority() *string { + if o == nil { + return nil + } + return o.Priority +} + +func (o *DocumentMetadata) GetAssignedTo() *Person { + if o == nil { + return nil + } + return o.AssignedTo +} + +func (o *DocumentMetadata) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *DocumentMetadata) GetLabels() []string { + if o == nil { + return nil + } + return o.Labels +} + +func (o *DocumentMetadata) GetCollections() []Collection { + if o == nil { + return nil + } + return o.Collections +} + +func (o *DocumentMetadata) GetDatasourceID() *string { + if o == nil { + return nil + } + return o.DatasourceID +} + +func (o *DocumentMetadata) GetInteractions() *DocumentInteractions { + if o == nil { + return nil + } + return o.Interactions +} + +func (o *DocumentMetadata) GetVerification() *Verification { + if o == nil { + return nil + } + return o.Verification +} + +func (o *DocumentMetadata) GetViewerInfo() *ViewerInfo { + if o == nil { + return nil + } + return o.ViewerInfo +} + +func (o *DocumentMetadata) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *DocumentMetadata) GetVisitCount() *CountInfo { + if o == nil { + return nil + } + return o.VisitCount +} + +func (o *DocumentMetadata) GetShortcuts() []Shortcut { + if o == nil { + return nil + } + return o.Shortcuts +} + +func (o *DocumentMetadata) GetPath() *string { + if o == nil { + return nil + } + return o.Path +} + +func (o *DocumentMetadata) GetCustomData() map[string]CustomDataValue { + if o == nil { + return nil + } + return o.CustomData +} + +func (o *DocumentMetadata) GetDocumentCategory() *string { + if o == nil { + return nil + } + return o.DocumentCategory +} + +func (o *DocumentMetadata) GetContactPerson() *Person { + if o == nil { + return nil + } + return o.ContactPerson +} + +func (o *DocumentMetadata) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *DocumentMetadata) GetIndexStatus() *IndexStatus { + if o == nil { + return nil + } + return o.IndexStatus +} + +func (o *DocumentMetadata) GetAncestors() []Document { + if o == nil { + return nil + } + return o.Ancestors +} diff --git a/tests/mockserver/internal/sdk/models/components/documentorerrorunion.go b/tests/mockserver/internal/sdk/models/components/documentorerrorunion.go new file mode 100644 index 00000000..ab97bff3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentorerrorunion.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "errors" + "fmt" + "mockserver/internal/sdk/utils" +) + +type DocumentOrError struct { + // The text for error, reason. + Error *string `json:"error,omitempty"` +} + +func (o *DocumentOrError) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +type DocumentOrErrorUnionType string + +const ( + DocumentOrErrorUnionTypeDocument DocumentOrErrorUnionType = "Document" + DocumentOrErrorUnionTypeDocumentOrError DocumentOrErrorUnionType = "DocumentOrError" +) + +type DocumentOrErrorUnion struct { + Document *Document `queryParam:"inline"` + DocumentOrError *DocumentOrError `queryParam:"inline"` + + Type DocumentOrErrorUnionType +} + +func CreateDocumentOrErrorUnionDocument(document Document) DocumentOrErrorUnion { + typ := DocumentOrErrorUnionTypeDocument + + return DocumentOrErrorUnion{ + Document: &document, + Type: typ, + } +} + +func CreateDocumentOrErrorUnionDocumentOrError(documentOrError DocumentOrError) DocumentOrErrorUnion { + typ := DocumentOrErrorUnionTypeDocumentOrError + + return DocumentOrErrorUnion{ + DocumentOrError: &documentOrError, + Type: typ, + } +} + +func (u *DocumentOrErrorUnion) UnmarshalJSON(data []byte) error { + + var documentOrError DocumentOrError = DocumentOrError{} + if err := utils.UnmarshalJSON(data, &documentOrError, "", true, true); err == nil { + u.DocumentOrError = &documentOrError + u.Type = DocumentOrErrorUnionTypeDocumentOrError + return nil + } + + var document Document = Document{} + if err := utils.UnmarshalJSON(data, &document, "", true, true); err == nil { + u.Document = &document + u.Type = DocumentOrErrorUnionTypeDocument + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for DocumentOrErrorUnion", string(data)) +} + +func (u DocumentOrErrorUnion) MarshalJSON() ([]byte, error) { + if u.Document != nil { + return utils.MarshalJSON(u.Document, "", true) + } + + if u.DocumentOrError != nil { + return utils.MarshalJSON(u.DocumentOrError, "", true) + } + + return nil, errors.New("could not marshal union type DocumentOrErrorUnion: all fields are null") +} diff --git a/tests/mockserver/internal/sdk/models/components/documentpermissionsdefinition.go b/tests/mockserver/internal/sdk/models/components/documentpermissionsdefinition.go new file mode 100644 index 00000000..75459197 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentpermissionsdefinition.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DocumentPermissionsDefinition - describes the access control details of the document +type DocumentPermissionsDefinition struct { + // List of users who can view the document + AllowedUsers []UserReferenceDefinition `json:"allowedUsers,omitempty"` + // List of groups that can view the document + AllowedGroups []string `json:"allowedGroups,omitempty"` + // List of allowed group intersections. This describes a permissions constraint of the form ((GroupA AND GroupB AND GroupC) OR (GroupX AND GroupY) OR ... + AllowedGroupIntersections []PermissionsGroupIntersectionDefinition `json:"allowedGroupIntersections,omitempty"` + // If true, then any Glean user can view the document + AllowAnonymousAccess *bool `json:"allowAnonymousAccess,omitempty"` + // If true, then any user who has an account in the datasource can view the document. + AllowAllDatasourceUsersAccess *bool `json:"allowAllDatasourceUsersAccess,omitempty"` +} + +func (o *DocumentPermissionsDefinition) GetAllowedUsers() []UserReferenceDefinition { + if o == nil { + return nil + } + return o.AllowedUsers +} + +func (o *DocumentPermissionsDefinition) GetAllowedGroups() []string { + if o == nil { + return nil + } + return o.AllowedGroups +} + +func (o *DocumentPermissionsDefinition) GetAllowedGroupIntersections() []PermissionsGroupIntersectionDefinition { + if o == nil { + return nil + } + return o.AllowedGroupIntersections +} + +func (o *DocumentPermissionsDefinition) GetAllowAnonymousAccess() *bool { + if o == nil { + return nil + } + return o.AllowAnonymousAccess +} + +func (o *DocumentPermissionsDefinition) GetAllowAllDatasourceUsersAccess() *bool { + if o == nil { + return nil + } + return o.AllowAllDatasourceUsersAccess +} diff --git a/tests/mockserver/internal/sdk/models/components/documentsection.go b/tests/mockserver/internal/sdk/models/components/documentsection.go new file mode 100644 index 00000000..8c229694 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentsection.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type DocumentSection struct { + // The title of the document section (e.g. the section header). + Title *string `json:"title,omitempty"` + // The permalink of the document section. + URL *string `json:"url,omitempty"` +} + +func (o *DocumentSection) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *DocumentSection) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} diff --git a/tests/mockserver/internal/sdk/models/components/documentspecunion.go b/tests/mockserver/internal/sdk/models/components/documentspecunion.go new file mode 100644 index 00000000..612a5a45 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentspecunion.go @@ -0,0 +1,182 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "mockserver/internal/sdk/utils" +) + +// DocumentSpecUgcType - The type of the user generated content (UGC datasource). +type DocumentSpecUgcType string + +const ( + DocumentSpecUgcTypeAnnouncements DocumentSpecUgcType = "ANNOUNCEMENTS" + DocumentSpecUgcTypeAnswers DocumentSpecUgcType = "ANSWERS" + DocumentSpecUgcTypeCollections DocumentSpecUgcType = "COLLECTIONS" + DocumentSpecUgcTypeShortcuts DocumentSpecUgcType = "SHORTCUTS" +) + +func (e DocumentSpecUgcType) ToPointer() *DocumentSpecUgcType { + return &e +} +func (e *DocumentSpecUgcType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ANNOUNCEMENTS": + fallthrough + case "ANSWERS": + fallthrough + case "COLLECTIONS": + fallthrough + case "SHORTCUTS": + *e = DocumentSpecUgcType(v) + return nil + default: + return fmt.Errorf("invalid value for DocumentSpecUgcType: %v", v) + } +} + +type DocumentSpec3 struct { + // The type of the user generated content (UGC datasource). + UgcType *DocumentSpecUgcType `json:"ugcType,omitempty"` + // The id for user generated content. + ContentID *int64 `json:"contentId,omitempty"` + // The specific type of the user generated content type. + DocType *string `json:"docType,omitempty"` +} + +func (o *DocumentSpec3) GetUgcType() *DocumentSpecUgcType { + if o == nil { + return nil + } + return o.UgcType +} + +func (o *DocumentSpec3) GetContentID() *int64 { + if o == nil { + return nil + } + return o.ContentID +} + +func (o *DocumentSpec3) GetDocType() *string { + if o == nil { + return nil + } + return o.DocType +} + +type DocumentSpec2 struct { + // The ID of the document. + ID *string `json:"id,omitempty"` +} + +func (o *DocumentSpec2) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +type DocumentSpec1 struct { + // The URL of the document. + URL *string `json:"url,omitempty"` +} + +func (o *DocumentSpec1) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +type DocumentSpecUnionType string + +const ( + DocumentSpecUnionTypeDocumentSpec1 DocumentSpecUnionType = "DocumentSpec_1" + DocumentSpecUnionTypeDocumentSpec2 DocumentSpecUnionType = "DocumentSpec_2" + DocumentSpecUnionTypeDocumentSpec3 DocumentSpecUnionType = "DocumentSpec_3" +) + +type DocumentSpecUnion struct { + DocumentSpec1 *DocumentSpec1 `queryParam:"inline"` + DocumentSpec2 *DocumentSpec2 `queryParam:"inline"` + DocumentSpec3 *DocumentSpec3 `queryParam:"inline"` + + Type DocumentSpecUnionType +} + +func CreateDocumentSpecUnionDocumentSpec1(documentSpec1 DocumentSpec1) DocumentSpecUnion { + typ := DocumentSpecUnionTypeDocumentSpec1 + + return DocumentSpecUnion{ + DocumentSpec1: &documentSpec1, + Type: typ, + } +} + +func CreateDocumentSpecUnionDocumentSpec2(documentSpec2 DocumentSpec2) DocumentSpecUnion { + typ := DocumentSpecUnionTypeDocumentSpec2 + + return DocumentSpecUnion{ + DocumentSpec2: &documentSpec2, + Type: typ, + } +} + +func CreateDocumentSpecUnionDocumentSpec3(documentSpec3 DocumentSpec3) DocumentSpecUnion { + typ := DocumentSpecUnionTypeDocumentSpec3 + + return DocumentSpecUnion{ + DocumentSpec3: &documentSpec3, + Type: typ, + } +} + +func (u *DocumentSpecUnion) UnmarshalJSON(data []byte) error { + + var documentSpec1 DocumentSpec1 = DocumentSpec1{} + if err := utils.UnmarshalJSON(data, &documentSpec1, "", true, true); err == nil { + u.DocumentSpec1 = &documentSpec1 + u.Type = DocumentSpecUnionTypeDocumentSpec1 + return nil + } + + var documentSpec2 DocumentSpec2 = DocumentSpec2{} + if err := utils.UnmarshalJSON(data, &documentSpec2, "", true, true); err == nil { + u.DocumentSpec2 = &documentSpec2 + u.Type = DocumentSpecUnionTypeDocumentSpec2 + return nil + } + + var documentSpec3 DocumentSpec3 = DocumentSpec3{} + if err := utils.UnmarshalJSON(data, &documentSpec3, "", true, true); err == nil { + u.DocumentSpec3 = &documentSpec3 + u.Type = DocumentSpecUnionTypeDocumentSpec3 + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for DocumentSpecUnion", string(data)) +} + +func (u DocumentSpecUnion) MarshalJSON() ([]byte, error) { + if u.DocumentSpec1 != nil { + return utils.MarshalJSON(u.DocumentSpec1, "", true) + } + + if u.DocumentSpec2 != nil { + return utils.MarshalJSON(u.DocumentSpec2, "", true) + } + + if u.DocumentSpec3 != nil { + return utils.MarshalJSON(u.DocumentSpec3, "", true) + } + + return nil, errors.New("could not marshal union type DocumentSpecUnion: all fields are null") +} diff --git a/tests/mockserver/internal/sdk/models/components/documentstatusresponse.go b/tests/mockserver/internal/sdk/models/components/documentstatusresponse.go new file mode 100644 index 00000000..72007844 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentstatusresponse.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DocumentStatusResponse - Describes the document status response body +type DocumentStatusResponse struct { + // Upload status, enum of NOT_UPLOADED, UPLOADED, STATUS_UNKNOWN + UploadStatus *string `json:"uploadStatus,omitempty"` + // Time of last successful upload for the document, in ISO 8601 format + LastUploadedAt *string `json:"lastUploadedAt,omitempty"` + // Indexing status, enum of NOT_INDEXED, INDEXED, STATUS_UNKNOWN + IndexingStatus *string `json:"indexingStatus,omitempty"` + // Time of last successful indexing for the document, in ISO 8601 format + LastIndexedAt *string `json:"lastIndexedAt,omitempty"` + // Permission identity status, enum of NOT_UPLOADED, UPLOADED, STATUS_UNKNOWN (Always unknown if `identityDatasourceName` is set). Document visibility may be affected status is `NOT_UPLOADED`. + PermissionIdentityStatus *string `json:"permissionIdentityStatus,omitempty"` +} + +func (o *DocumentStatusResponse) GetUploadStatus() *string { + if o == nil { + return nil + } + return o.UploadStatus +} + +func (o *DocumentStatusResponse) GetLastUploadedAt() *string { + if o == nil { + return nil + } + return o.LastUploadedAt +} + +func (o *DocumentStatusResponse) GetIndexingStatus() *string { + if o == nil { + return nil + } + return o.IndexingStatus +} + +func (o *DocumentStatusResponse) GetLastIndexedAt() *string { + if o == nil { + return nil + } + return o.LastIndexedAt +} + +func (o *DocumentStatusResponse) GetPermissionIdentityStatus() *string { + if o == nil { + return nil + } + return o.PermissionIdentityStatus +} diff --git a/tests/mockserver/internal/sdk/models/components/documentvisibility.go b/tests/mockserver/internal/sdk/models/components/documentvisibility.go new file mode 100644 index 00000000..3d7e72b7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentvisibility.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DocumentVisibility - The level of visibility of the document as understood by our system. +type DocumentVisibility string + +const ( + DocumentVisibilityPrivate DocumentVisibility = "PRIVATE" + DocumentVisibilitySpecificPeopleAndGroups DocumentVisibility = "SPECIFIC_PEOPLE_AND_GROUPS" + DocumentVisibilityDomainLink DocumentVisibility = "DOMAIN_LINK" + DocumentVisibilityDomainVisible DocumentVisibility = "DOMAIN_VISIBLE" + DocumentVisibilityPublicLink DocumentVisibility = "PUBLIC_LINK" + DocumentVisibilityPublicVisible DocumentVisibility = "PUBLIC_VISIBLE" +) + +func (e DocumentVisibility) ToPointer() *DocumentVisibility { + return &e +} +func (e *DocumentVisibility) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PRIVATE": + fallthrough + case "SPECIFIC_PEOPLE_AND_GROUPS": + fallthrough + case "DOMAIN_LINK": + fallthrough + case "DOMAIN_VISIBLE": + fallthrough + case "PUBLIC_LINK": + fallthrough + case "PUBLIC_VISIBLE": + *e = DocumentVisibility(v) + return nil + default: + return fmt.Errorf("invalid value for DocumentVisibility: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/documentvisibilityoverride.go b/tests/mockserver/internal/sdk/models/components/documentvisibilityoverride.go new file mode 100644 index 00000000..5d424357 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentvisibilityoverride.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DocumentVisibilityOverrideOverride - The visibility-override state of the document. +type DocumentVisibilityOverrideOverride string + +const ( + DocumentVisibilityOverrideOverrideNone DocumentVisibilityOverrideOverride = "NONE" + DocumentVisibilityOverrideOverrideHideFromAll DocumentVisibilityOverrideOverride = "HIDE_FROM_ALL" + DocumentVisibilityOverrideOverrideHideFromGroups DocumentVisibilityOverrideOverride = "HIDE_FROM_GROUPS" + DocumentVisibilityOverrideOverrideHideFromAllExceptOwner DocumentVisibilityOverrideOverride = "HIDE_FROM_ALL_EXCEPT_OWNER" +) + +func (e DocumentVisibilityOverrideOverride) ToPointer() *DocumentVisibilityOverrideOverride { + return &e +} +func (e *DocumentVisibilityOverrideOverride) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NONE": + fallthrough + case "HIDE_FROM_ALL": + fallthrough + case "HIDE_FROM_GROUPS": + fallthrough + case "HIDE_FROM_ALL_EXCEPT_OWNER": + *e = DocumentVisibilityOverrideOverride(v) + return nil + default: + return fmt.Errorf("invalid value for DocumentVisibilityOverrideOverride: %v", v) + } +} + +type DocumentVisibilityOverride struct { + DocID *string `json:"docId,omitempty"` + // The visibility-override state of the document. + Override *DocumentVisibilityOverrideOverride `json:"override,omitempty"` +} + +func (o *DocumentVisibilityOverride) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} + +func (o *DocumentVisibilityOverride) GetOverride() *DocumentVisibilityOverrideOverride { + if o == nil { + return nil + } + return o.Override +} diff --git a/tests/mockserver/internal/sdk/models/components/documentvisibilityupdateresult.go b/tests/mockserver/internal/sdk/models/components/documentvisibilityupdateresult.go new file mode 100644 index 00000000..5b76ae89 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/documentvisibilityupdateresult.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DocumentVisibilityUpdateResultOverride - The visibility-override state of the document. +type DocumentVisibilityUpdateResultOverride string + +const ( + DocumentVisibilityUpdateResultOverrideNone DocumentVisibilityUpdateResultOverride = "NONE" + DocumentVisibilityUpdateResultOverrideHideFromAll DocumentVisibilityUpdateResultOverride = "HIDE_FROM_ALL" + DocumentVisibilityUpdateResultOverrideHideFromGroups DocumentVisibilityUpdateResultOverride = "HIDE_FROM_GROUPS" + DocumentVisibilityUpdateResultOverrideHideFromAllExceptOwner DocumentVisibilityUpdateResultOverride = "HIDE_FROM_ALL_EXCEPT_OWNER" +) + +func (e DocumentVisibilityUpdateResultOverride) ToPointer() *DocumentVisibilityUpdateResultOverride { + return &e +} +func (e *DocumentVisibilityUpdateResultOverride) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NONE": + fallthrough + case "HIDE_FROM_ALL": + fallthrough + case "HIDE_FROM_GROUPS": + fallthrough + case "HIDE_FROM_ALL_EXCEPT_OWNER": + *e = DocumentVisibilityUpdateResultOverride(v) + return nil + default: + return fmt.Errorf("invalid value for DocumentVisibilityUpdateResultOverride: %v", v) + } +} + +type DocumentVisibilityUpdateResult struct { + DocID *string `json:"docId,omitempty"` + // The visibility-override state of the document. + Override *DocumentVisibilityUpdateResultOverride `json:"override,omitempty"` + // Whether this document was successfully set to its desired visibility state. + Success *bool `json:"success,omitempty"` +} + +func (o *DocumentVisibilityUpdateResult) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} + +func (o *DocumentVisibilityUpdateResult) GetOverride() *DocumentVisibilityUpdateResultOverride { + if o == nil { + return nil + } + return o.Override +} + +func (o *DocumentVisibilityUpdateResult) GetSuccess() *bool { + if o == nil { + return nil + } + return o.Success +} diff --git a/tests/mockserver/internal/sdk/models/components/editanswerrequest.go b/tests/mockserver/internal/sdk/models/components/editanswerrequest.go new file mode 100644 index 00000000..cf5732f1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/editanswerrequest.go @@ -0,0 +1,170 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type EditAnswerRequestSourceType string + +const ( + EditAnswerRequestSourceTypeDocument EditAnswerRequestSourceType = "DOCUMENT" + EditAnswerRequestSourceTypeAssistant EditAnswerRequestSourceType = "ASSISTANT" +) + +func (e EditAnswerRequestSourceType) ToPointer() *EditAnswerRequestSourceType { + return &e +} +func (e *EditAnswerRequestSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DOCUMENT": + fallthrough + case "ASSISTANT": + *e = EditAnswerRequestSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for EditAnswerRequestSourceType: %v", v) + } +} + +type EditAnswerRequest struct { + // The opaque ID of the Answer. + ID int64 `json:"id"` + // Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. + DocID *string `json:"docId,omitempty"` + Question *string `json:"question,omitempty"` + // Additional ways of phrasing this question. + QuestionVariations []string `json:"questionVariations,omitempty"` + // The plain text answer to the question. + BodyText *string `json:"bodyText,omitempty"` + // The parent board ID of this Answer, or 0 if it's a floating Answer. Adding Answers to Answer Boards is no longer permitted. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + BoardID *int64 `json:"boardId,omitempty"` + // Filters which restrict who should see the answer. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // A list of user roles for the answer added by the owner. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of user roles for the answer removed by the owner. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // A list of roles for this answer explicitly granted by an owner, editor, or admin. + Roles []UserRoleSpecification `json:"roles,omitempty"` + SourceDocumentSpec *DocumentSpecUnion `json:"sourceDocumentSpec,omitempty"` + SourceType *EditAnswerRequestSourceType `json:"sourceType,omitempty"` + // IDs of Collections to which a document is added. + AddedCollections []int64 `json:"addedCollections,omitempty"` + // IDs of Collections from which a document is removed. + RemovedCollections []int64 `json:"removedCollections,omitempty"` + CombinedAnswerText *StructuredTextMutableProperties `json:"combinedAnswerText,omitempty"` +} + +func (o *EditAnswerRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *EditAnswerRequest) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} + +func (o *EditAnswerRequest) GetQuestion() *string { + if o == nil { + return nil + } + return o.Question +} + +func (o *EditAnswerRequest) GetQuestionVariations() []string { + if o == nil { + return nil + } + return o.QuestionVariations +} + +func (o *EditAnswerRequest) GetBodyText() *string { + if o == nil { + return nil + } + return o.BodyText +} + +func (o *EditAnswerRequest) GetBoardID() *int64 { + if o == nil { + return nil + } + return o.BoardID +} + +func (o *EditAnswerRequest) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *EditAnswerRequest) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *EditAnswerRequest) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *EditAnswerRequest) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} + +func (o *EditAnswerRequest) GetSourceDocumentSpec() *DocumentSpecUnion { + if o == nil { + return nil + } + return o.SourceDocumentSpec +} + +func (o *EditAnswerRequest) GetSourceType() *EditAnswerRequestSourceType { + if o == nil { + return nil + } + return o.SourceType +} + +func (o *EditAnswerRequest) GetAddedCollections() []int64 { + if o == nil { + return nil + } + return o.AddedCollections +} + +func (o *EditAnswerRequest) GetRemovedCollections() []int64 { + if o == nil { + return nil + } + return o.RemovedCollections +} + +func (o *EditAnswerRequest) GetCombinedAnswerText() *StructuredTextMutableProperties { + if o == nil { + return nil + } + return o.CombinedAnswerText +} diff --git a/tests/mockserver/internal/sdk/models/components/editcollectionitemrequest.go b/tests/mockserver/internal/sdk/models/components/editcollectionitemrequest.go new file mode 100644 index 00000000..d43b56a7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/editcollectionitemrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type EditCollectionItemRequest struct { + // The optional name of the Collection item. + Name *string `json:"name,omitempty"` + // A helpful description of why this CollectionItem is in the Collection that it's in. + Description *string `json:"description,omitempty"` + // The emoji icon for this CollectionItem. Only used for Text type items. + Icon *string `json:"icon,omitempty"` + // The ID of the Collection to edit CollectionItems in. + CollectionID int64 `json:"collectionId"` + // The ID of the CollectionItem to edit. + ItemID string `json:"itemId"` +} + +func (o *EditCollectionItemRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *EditCollectionItemRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *EditCollectionItemRequest) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *EditCollectionItemRequest) GetCollectionID() int64 { + if o == nil { + return 0 + } + return o.CollectionID +} + +func (o *EditCollectionItemRequest) GetItemID() string { + if o == nil { + return "" + } + return o.ItemID +} diff --git a/tests/mockserver/internal/sdk/models/components/editcollectionitemresponse.go b/tests/mockserver/internal/sdk/models/components/editcollectionitemresponse.go new file mode 100644 index 00000000..2d6a42bf --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/editcollectionitemresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type EditCollectionItemResponse struct { + Collection *Collection `json:"collection,omitempty"` +} + +func (o *EditCollectionItemResponse) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} diff --git a/tests/mockserver/internal/sdk/models/components/editcollectionrequest.go b/tests/mockserver/internal/sdk/models/components/editcollectionrequest.go new file mode 100644 index 00000000..ed60e373 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/editcollectionrequest.go @@ -0,0 +1,104 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type EditCollectionRequest struct { + // The unique name of the Collection. + Name string `json:"name"` + // A brief summary of the Collection's contents. + Description *string `json:"description,omitempty"` + // A list of added user roles for the Collection. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of removed user roles for the Collection. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The emoji icon of this Collection. + Icon *string `json:"icon,omitempty"` + // Indicates whether edits are allowed for everyone or only admins. + AdminLocked *bool `json:"adminLocked,omitempty"` + // The parent of this Collection, or 0 if it's a top-level Collection. + ParentID *int64 `json:"parentId,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + // The datasource type this Collection can hold. + AllowedDatasource *string `json:"allowedDatasource,omitempty"` + // The ID of the Collection to modify. + ID int64 `json:"id"` +} + +func (o *EditCollectionRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *EditCollectionRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *EditCollectionRequest) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *EditCollectionRequest) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *EditCollectionRequest) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *EditCollectionRequest) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *EditCollectionRequest) GetAdminLocked() *bool { + if o == nil { + return nil + } + return o.AdminLocked +} + +func (o *EditCollectionRequest) GetParentID() *int64 { + if o == nil { + return nil + } + return o.ParentID +} + +func (o *EditCollectionRequest) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *EditCollectionRequest) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} + +func (o *EditCollectionRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/editcollectionresponse.go b/tests/mockserver/internal/sdk/models/components/editcollectionresponse.go new file mode 100644 index 00000000..9cf6c7a4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/editcollectionresponse.go @@ -0,0 +1,289 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +type EditCollectionResponseErrorCode string + +const ( + EditCollectionResponseErrorCodeNameExists EditCollectionResponseErrorCode = "NAME_EXISTS" + EditCollectionResponseErrorCodeNotFound EditCollectionResponseErrorCode = "NOT_FOUND" + EditCollectionResponseErrorCodeCollectionPinned EditCollectionResponseErrorCode = "COLLECTION_PINNED" + EditCollectionResponseErrorCodeConcurrentHierarchyEdit EditCollectionResponseErrorCode = "CONCURRENT_HIERARCHY_EDIT" + EditCollectionResponseErrorCodeHeightViolation EditCollectionResponseErrorCode = "HEIGHT_VIOLATION" + EditCollectionResponseErrorCodeWidthViolation EditCollectionResponseErrorCode = "WIDTH_VIOLATION" + EditCollectionResponseErrorCodeNoPermissions EditCollectionResponseErrorCode = "NO_PERMISSIONS" +) + +func (e EditCollectionResponseErrorCode) ToPointer() *EditCollectionResponseErrorCode { + return &e +} +func (e *EditCollectionResponseErrorCode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NAME_EXISTS": + fallthrough + case "NOT_FOUND": + fallthrough + case "COLLECTION_PINNED": + fallthrough + case "CONCURRENT_HIERARCHY_EDIT": + fallthrough + case "HEIGHT_VIOLATION": + fallthrough + case "WIDTH_VIOLATION": + fallthrough + case "NO_PERMISSIONS": + *e = EditCollectionResponseErrorCode(v) + return nil + default: + return fmt.Errorf("invalid value for EditCollectionResponseErrorCode: %v", v) + } +} + +type EditCollectionResponse struct { + // The unique name of the Collection. + Name string `json:"name"` + // A brief summary of the Collection's contents. + Description string `json:"description"` + // A list of added user roles for the Collection. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of removed user roles for the Collection. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + // Filters which restrict who should see this Collection. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The emoji icon of this Collection. + Icon *string `json:"icon,omitempty"` + // Indicates whether edits are allowed for everyone or only admins. + AdminLocked *bool `json:"adminLocked,omitempty"` + // The parent of this Collection, or 0 if it's a top-level Collection. + ParentID *int64 `json:"parentId,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + // The datasource type this Collection can hold. + AllowedDatasource *string `json:"allowedDatasource,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // The unique ID of the Collection. + ID int64 `json:"id"` + CreateTime *time.Time `json:"createTime,omitempty"` + UpdateTime *time.Time `json:"updateTime,omitempty"` + Creator *Person `json:"creator,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + // The number of items currently in the Collection. Separated from the actual items so we can grab the count without items. + ItemCount *int64 `json:"itemCount,omitempty"` + // The number of children Collections. Separated from the actual children so we can grab the count without children. + ChildCount *int64 `json:"childCount,omitempty"` + // The items in this Collection. + Items []CollectionItem `json:"items,omitempty"` + PinMetadata *CollectionPinnedMetadata `json:"pinMetadata,omitempty"` + // The names of the shortcuts (Go Links) that point to this Collection. + Shortcuts []string `json:"shortcuts,omitempty"` + // The children Collections of this Collection. + Children []Collection `json:"children,omitempty"` + // A list of user roles for the Collection. + Roles []UserRoleSpecification `json:"roles,omitempty"` + ErrorCode EditCollectionResponseErrorCode `json:"errorCode"` + Collection *Collection `json:"collection,omitempty"` + Error *CollectionError `json:"error,omitempty"` +} + +func (e EditCollectionResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditCollectionResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { + return err + } + return nil +} + +func (o *EditCollectionResponse) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *EditCollectionResponse) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *EditCollectionResponse) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *EditCollectionResponse) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *EditCollectionResponse) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *EditCollectionResponse) GetIcon() *string { + if o == nil { + return nil + } + return o.Icon +} + +func (o *EditCollectionResponse) GetAdminLocked() *bool { + if o == nil { + return nil + } + return o.AdminLocked +} + +func (o *EditCollectionResponse) GetParentID() *int64 { + if o == nil { + return nil + } + return o.ParentID +} + +func (o *EditCollectionResponse) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *EditCollectionResponse) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} + +func (o *EditCollectionResponse) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *EditCollectionResponse) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *EditCollectionResponse) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *EditCollectionResponse) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *EditCollectionResponse) GetCreator() *Person { + if o == nil { + return nil + } + return o.Creator +} + +func (o *EditCollectionResponse) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *EditCollectionResponse) GetItemCount() *int64 { + if o == nil { + return nil + } + return o.ItemCount +} + +func (o *EditCollectionResponse) GetChildCount() *int64 { + if o == nil { + return nil + } + return o.ChildCount +} + +func (o *EditCollectionResponse) GetItems() []CollectionItem { + if o == nil { + return nil + } + return o.Items +} + +func (o *EditCollectionResponse) GetPinMetadata() *CollectionPinnedMetadata { + if o == nil { + return nil + } + return o.PinMetadata +} + +func (o *EditCollectionResponse) GetShortcuts() []string { + if o == nil { + return nil + } + return o.Shortcuts +} + +func (o *EditCollectionResponse) GetChildren() []Collection { + if o == nil { + return nil + } + return o.Children +} + +func (o *EditCollectionResponse) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} + +func (o *EditCollectionResponse) GetErrorCode() EditCollectionResponseErrorCode { + if o == nil { + return EditCollectionResponseErrorCode("") + } + return o.ErrorCode +} + +func (o *EditCollectionResponse) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} + +func (o *EditCollectionResponse) GetError() *CollectionError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/editpinrequest.go b/tests/mockserver/internal/sdk/models/components/editpinrequest.go new file mode 100644 index 00000000..ab648e15 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/editpinrequest.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type EditPinRequest struct { + // The query strings for which the pinned result will show. + Queries []string `json:"queries,omitempty"` + // Filters which restrict who should see the pinned document. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The opaque id of the pin to be edited. + ID *string `json:"id,omitempty"` +} + +func (o *EditPinRequest) GetQueries() []string { + if o == nil { + return nil + } + return o.Queries +} + +func (o *EditPinRequest) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *EditPinRequest) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/employeeinfodefinition.go b/tests/mockserver/internal/sdk/models/components/employeeinfodefinition.go new file mode 100644 index 00000000..91056ac5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/employeeinfodefinition.go @@ -0,0 +1,272 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" +) + +// EmployeeInfoDefinition - Describes employee info +type EmployeeInfoDefinition struct { + // The employee's email + Email string `json:"email"` + // The first name of the employee. **Note**: The value cannot be empty + // + FirstName *string `json:"firstName,omitempty"` + // The last name of the employee. **Note**: The value cannot be empty + // + LastName *string `json:"lastName,omitempty"` + // The preferred name or nickname of the employee + PreferredName *string `json:"preferredName,omitempty"` + // **[Advanced]** A unique universal internal identifier for the employee. This is solely used for understanding manager relationships along with `managerId`. + // + ID *string `json:"id,omitempty"` + // The employee's phone number. + PhoneNumber *string `json:"phoneNumber,omitempty"` + // The employee's location (city/office name etc). + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Location *string `json:"location,omitempty"` + // Detailed location with information about country, state, city etc. + StructuredLocation *StructuredLocation `json:"structuredLocation,omitempty"` + // The employee's role title. + Title *string `json:"title,omitempty"` + // The employee's profile pic + PhotoURL *string `json:"photoUrl,omitempty"` + // Typically the highest level organizational unit; generally applies to bigger companies with multiple distinct businesses. + BusinessUnit *string `json:"businessUnit,omitempty"` + // An organizational unit where everyone has a similar task, e.g. `Engineering`. + Department string `json:"department"` + // The datasource profiles of the employee, e.g. `Slack`,`Github`. + DatasourceProfiles []DatasourceProfile `json:"datasourceProfiles,omitempty"` + // Info about the employee's team(s) + Teams []EmployeeTeamInfo `json:"teams,omitempty"` + // The date when the employee started + StartDate *types.Date `json:"startDate,omitempty"` + // If a former employee, the last date of employment. + EndDate *types.Date `json:"endDate,omitempty"` + // Short biography or mission statement of the employee. + Bio *string `json:"bio,omitempty"` + // She/her, He/his or other pronoun. + Pronoun *string `json:"pronoun,omitempty"` + // Other names associated with the employee. + AlsoKnownAs []string `json:"alsoKnownAs,omitempty"` + // Link to internal company person profile. + ProfileURL *string `json:"profileUrl,omitempty"` + // List of social network profiles. + SocialNetworks []SocialNetworkDefinition `json:"socialNetworks,omitempty"` + // The email of the employee's manager + ManagerEmail *string `json:"managerEmail,omitempty"` + // **[Advanced]** A unique universal internal identifier for the employee's manager. This is solely used in conjunction with `id`. + // + ManagerID *string `json:"managerId,omitempty"` + // The type of the employee, an enum of `FULL_TIME`, `CONTRACTOR`, `NON_EMPLOYEE` + Type *string `default:"FULL_TIME" json:"type"` + // List of unidirectional relationships with other employees. E.g. this employee (`A`) is a CHIEF_OF_STAFF to another employee (`B`); or this employee (`A`) is an EXECUTIVE_ASSISTANT of another employee (`C`). The mapping should be attached to `A`'s profile. + Relationships []EntityRelationship `json:"relationships,omitempty"` + // The status of the employee, an enum of `CURRENT`, `FUTURE`, `EX` + Status *string `default:"CURRENT" json:"status"` + // List of additional fields with more information about the employee. + AdditionalFields []AdditionalFieldDefinition `json:"additionalFields,omitempty"` +} + +func (e EmployeeInfoDefinition) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EmployeeInfoDefinition) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { + return err + } + return nil +} + +func (o *EmployeeInfoDefinition) GetEmail() string { + if o == nil { + return "" + } + return o.Email +} + +func (o *EmployeeInfoDefinition) GetFirstName() *string { + if o == nil { + return nil + } + return o.FirstName +} + +func (o *EmployeeInfoDefinition) GetLastName() *string { + if o == nil { + return nil + } + return o.LastName +} + +func (o *EmployeeInfoDefinition) GetPreferredName() *string { + if o == nil { + return nil + } + return o.PreferredName +} + +func (o *EmployeeInfoDefinition) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *EmployeeInfoDefinition) GetPhoneNumber() *string { + if o == nil { + return nil + } + return o.PhoneNumber +} + +func (o *EmployeeInfoDefinition) GetLocation() *string { + if o == nil { + return nil + } + return o.Location +} + +func (o *EmployeeInfoDefinition) GetStructuredLocation() *StructuredLocation { + if o == nil { + return nil + } + return o.StructuredLocation +} + +func (o *EmployeeInfoDefinition) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *EmployeeInfoDefinition) GetPhotoURL() *string { + if o == nil { + return nil + } + return o.PhotoURL +} + +func (o *EmployeeInfoDefinition) GetBusinessUnit() *string { + if o == nil { + return nil + } + return o.BusinessUnit +} + +func (o *EmployeeInfoDefinition) GetDepartment() string { + if o == nil { + return "" + } + return o.Department +} + +func (o *EmployeeInfoDefinition) GetDatasourceProfiles() []DatasourceProfile { + if o == nil { + return nil + } + return o.DatasourceProfiles +} + +func (o *EmployeeInfoDefinition) GetTeams() []EmployeeTeamInfo { + if o == nil { + return nil + } + return o.Teams +} + +func (o *EmployeeInfoDefinition) GetStartDate() *types.Date { + if o == nil { + return nil + } + return o.StartDate +} + +func (o *EmployeeInfoDefinition) GetEndDate() *types.Date { + if o == nil { + return nil + } + return o.EndDate +} + +func (o *EmployeeInfoDefinition) GetBio() *string { + if o == nil { + return nil + } + return o.Bio +} + +func (o *EmployeeInfoDefinition) GetPronoun() *string { + if o == nil { + return nil + } + return o.Pronoun +} + +func (o *EmployeeInfoDefinition) GetAlsoKnownAs() []string { + if o == nil { + return nil + } + return o.AlsoKnownAs +} + +func (o *EmployeeInfoDefinition) GetProfileURL() *string { + if o == nil { + return nil + } + return o.ProfileURL +} + +func (o *EmployeeInfoDefinition) GetSocialNetworks() []SocialNetworkDefinition { + if o == nil { + return nil + } + return o.SocialNetworks +} + +func (o *EmployeeInfoDefinition) GetManagerEmail() *string { + if o == nil { + return nil + } + return o.ManagerEmail +} + +func (o *EmployeeInfoDefinition) GetManagerID() *string { + if o == nil { + return nil + } + return o.ManagerID +} + +func (o *EmployeeInfoDefinition) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *EmployeeInfoDefinition) GetRelationships() []EntityRelationship { + if o == nil { + return nil + } + return o.Relationships +} + +func (o *EmployeeInfoDefinition) GetStatus() *string { + if o == nil { + return nil + } + return o.Status +} + +func (o *EmployeeInfoDefinition) GetAdditionalFields() []AdditionalFieldDefinition { + if o == nil { + return nil + } + return o.AdditionalFields +} diff --git a/tests/mockserver/internal/sdk/models/components/employeeteaminfo.go b/tests/mockserver/internal/sdk/models/components/employeeteaminfo.go new file mode 100644 index 00000000..dd50fe0e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/employeeteaminfo.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// EmployeeTeamInfo - Information about which team an employee belongs to +type EmployeeTeamInfo struct { + // unique identifier for this team + ID *string `json:"id,omitempty"` + // Team name + Name *string `json:"name,omitempty"` + // Link to internal company team page + URL *string `json:"url,omitempty"` +} + +func (o *EmployeeTeamInfo) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *EmployeeTeamInfo) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *EmployeeTeamInfo) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} diff --git a/tests/mockserver/internal/sdk/models/components/entitiessortorder.go b/tests/mockserver/internal/sdk/models/components/entitiessortorder.go new file mode 100644 index 00000000..6888c129 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/entitiessortorder.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// EntitiesSortOrder - Different ways of sorting entities +type EntitiesSortOrder string + +const ( + EntitiesSortOrderEntityName EntitiesSortOrder = "ENTITY_NAME" + EntitiesSortOrderFirstName EntitiesSortOrder = "FIRST_NAME" + EntitiesSortOrderLastName EntitiesSortOrder = "LAST_NAME" + EntitiesSortOrderOrgSizeCount EntitiesSortOrder = "ORG_SIZE_COUNT" + EntitiesSortOrderStartDate EntitiesSortOrder = "START_DATE" + EntitiesSortOrderTeamSize EntitiesSortOrder = "TEAM_SIZE" + EntitiesSortOrderRelevance EntitiesSortOrder = "RELEVANCE" +) + +func (e EntitiesSortOrder) ToPointer() *EntitiesSortOrder { + return &e +} +func (e *EntitiesSortOrder) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ENTITY_NAME": + fallthrough + case "FIRST_NAME": + fallthrough + case "LAST_NAME": + fallthrough + case "ORG_SIZE_COUNT": + fallthrough + case "START_DATE": + fallthrough + case "TEAM_SIZE": + fallthrough + case "RELEVANCE": + *e = EntitiesSortOrder(v) + return nil + default: + return fmt.Errorf("invalid value for EntitiesSortOrder: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/entityrelationship.go b/tests/mockserver/internal/sdk/models/components/entityrelationship.go new file mode 100644 index 00000000..fee77670 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/entityrelationship.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// EntityRelationship - Describes a relationship edge between a source and destination entity +type EntityRelationship struct { + // The title or type of relationship. Currently an enum of `CHIEF_OF_STAFF`, `EXECUTIVE_ASSISTANT` + Name string `json:"name"` + // Email of the person with whom the relationship exists. Per the example above, either `B` or `C`'s email depending on the relationship. + Email string `json:"email"` +} + +func (o *EntityRelationship) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *EntityRelationship) GetEmail() string { + if o == nil { + return "" + } + return o.Email +} diff --git a/tests/mockserver/internal/sdk/models/components/entitytype.go b/tests/mockserver/internal/sdk/models/components/entitytype.go new file mode 100644 index 00000000..18fae8c8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/entitytype.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// EntityType - The type of entity. +type EntityType string + +const ( + EntityTypePerson EntityType = "PERSON" + EntityTypeProject EntityType = "PROJECT" + EntityTypeCustomer EntityType = "CUSTOMER" +) + +func (e EntityType) ToPointer() *EntityType { + return &e +} +func (e *EntityType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PERSON": + fallthrough + case "PROJECT": + fallthrough + case "CUSTOMER": + *e = EntityType(v) + return nil + default: + return fmt.Errorf("invalid value for EntityType: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/errormessage.go b/tests/mockserver/internal/sdk/models/components/errormessage.go new file mode 100644 index 00000000..053c085d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/errormessage.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ErrorMessage struct { + // The datasource this message relates to. + Source *string `json:"source,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +func (o *ErrorMessage) GetSource() *string { + if o == nil { + return nil + } + return o.Source +} + +func (o *ErrorMessage) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} diff --git a/tests/mockserver/internal/sdk/models/components/eventclassification.go b/tests/mockserver/internal/sdk/models/components/eventclassification.go new file mode 100644 index 00000000..99367087 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/eventclassification.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// EventClassification - A generated classification of a given event. +type EventClassification struct { + // The name for a generated classification of an event. + Name *EventClassificationName `json:"name,omitempty"` + Strategies []EventStrategyName `json:"strategies,omitempty"` +} + +func (o *EventClassification) GetName() *EventClassificationName { + if o == nil { + return nil + } + return o.Name +} + +func (o *EventClassification) GetStrategies() []EventStrategyName { + if o == nil { + return nil + } + return o.Strategies +} diff --git a/tests/mockserver/internal/sdk/models/components/eventclassificationname.go b/tests/mockserver/internal/sdk/models/components/eventclassificationname.go new file mode 100644 index 00000000..2971f669 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/eventclassificationname.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// EventClassificationName - The name for a generated classification of an event. +type EventClassificationName string + +const ( + EventClassificationNameExternalEvent EventClassificationName = "External Event" +) + +func (e EventClassificationName) ToPointer() *EventClassificationName { + return &e +} +func (e *EventClassificationName) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "External Event": + *e = EventClassificationName(v) + return nil + default: + return fmt.Errorf("invalid value for EventClassificationName: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/eventstrategyname.go b/tests/mockserver/internal/sdk/models/components/eventstrategyname.go new file mode 100644 index 00000000..fbbce772 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/eventstrategyname.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// EventStrategyName - The name of method used to surface relevant data for a given calendar event. +type EventStrategyName string + +const ( + EventStrategyNameCustomerCard EventStrategyName = "customerCard" + EventStrategyNameNews EventStrategyName = "news" + EventStrategyNameCall EventStrategyName = "call" + EventStrategyNameEmail EventStrategyName = "email" + EventStrategyNameMeetingNotes EventStrategyName = "meetingNotes" + EventStrategyNameLinkedIn EventStrategyName = "linkedIn" + EventStrategyNameRelevantDocuments EventStrategyName = "relevantDocuments" + EventStrategyNameChatFollowUps EventStrategyName = "chatFollowUps" + EventStrategyNameConversations EventStrategyName = "conversations" +) + +func (e EventStrategyName) ToPointer() *EventStrategyName { + return &e +} +func (e *EventStrategyName) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "customerCard": + fallthrough + case "news": + fallthrough + case "call": + fallthrough + case "email": + fallthrough + case "meetingNotes": + fallthrough + case "linkedIn": + fallthrough + case "relevantDocuments": + fallthrough + case "chatFollowUps": + fallthrough + case "conversations": + *e = EventStrategyName(v) + return nil + default: + return fmt.Errorf("invalid value for EventStrategyName: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/externalsharingoptions.go b/tests/mockserver/internal/sdk/models/components/externalsharingoptions.go new file mode 100644 index 00000000..0d0a7b9c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/externalsharingoptions.go @@ -0,0 +1,89 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ExternalSharingOptions - Controls how "shared" a document must be to get picked for scans. +// +// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. +type ExternalSharingOptions struct { + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Enabled *bool `json:"enabled,omitempty"` + // The minimum number of users the document is shared with. + Threshold *int64 `json:"threshold,omitempty"` + // Documents will be filtered based on how many people have access to it. + ThresholdEnabled *bool `json:"thresholdEnabled,omitempty"` + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + AnyoneWithLinkEnabled *bool `json:"anyoneWithLinkEnabled,omitempty"` + // Only users within the organization can access the document. + AnyoneInternalEnabled *bool `json:"anyoneInternalEnabled,omitempty"` + // Anyone on the internet can access the document. + AnonymousAccessEnabled *bool `json:"anonymousAccessEnabled,omitempty"` + // Enable user access check + UserAccessEnabled *bool `json:"userAccessEnabled,omitempty"` + // Any one of the specified users can access the document. + UserIds []string `json:"userIds,omitempty"` + DomainAccessEnabled *bool `json:"domainAccessEnabled,omitempty"` +} + +func (o *ExternalSharingOptions) GetEnabled() *bool { + if o == nil { + return nil + } + return o.Enabled +} + +func (o *ExternalSharingOptions) GetThreshold() *int64 { + if o == nil { + return nil + } + return o.Threshold +} + +func (o *ExternalSharingOptions) GetThresholdEnabled() *bool { + if o == nil { + return nil + } + return o.ThresholdEnabled +} + +func (o *ExternalSharingOptions) GetAnyoneWithLinkEnabled() *bool { + if o == nil { + return nil + } + return o.AnyoneWithLinkEnabled +} + +func (o *ExternalSharingOptions) GetAnyoneInternalEnabled() *bool { + if o == nil { + return nil + } + return o.AnyoneInternalEnabled +} + +func (o *ExternalSharingOptions) GetAnonymousAccessEnabled() *bool { + if o == nil { + return nil + } + return o.AnonymousAccessEnabled +} + +func (o *ExternalSharingOptions) GetUserAccessEnabled() *bool { + if o == nil { + return nil + } + return o.UserAccessEnabled +} + +func (o *ExternalSharingOptions) GetUserIds() []string { + if o == nil { + return nil + } + return o.UserIds +} + +func (o *ExternalSharingOptions) GetDomainAccessEnabled() *bool { + if o == nil { + return nil + } + return o.DomainAccessEnabled +} diff --git a/tests/mockserver/internal/sdk/models/components/externalshortcut.go b/tests/mockserver/internal/sdk/models/components/externalshortcut.go new file mode 100644 index 00000000..24eee619 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/externalshortcut.go @@ -0,0 +1,105 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ExternalShortcut struct { + // link text following the viewPrefix as entered by the user. For example, if the view prefix is `go/` and the shortened URL is `go/abc`, then `abc` is the inputAlias. + InputAlias string `json:"inputAlias"` + // A short, plain text blurb to help people understand the intent of the shortcut. + Description *string `json:"description,omitempty"` + // destination URL for the shortcut. + DestinationURL string `json:"destinationUrl"` + // Email of the user who created this shortcut. + CreatedBy string `json:"createdBy"` + // The time the shortcut was created in epoch seconds. + CreateTime *int64 `json:"createTime,omitempty"` + // Email of the user who last updated this shortcut. + UpdatedBy *string `json:"updatedBy,omitempty"` + // The time the shortcut was updated in epoch seconds. + UpdateTime *int64 `json:"updateTime,omitempty"` + // Title of the golink + Title *string `json:"title,omitempty"` + // The URL from which the user is then redirected to the destination URL. + IntermediateURL string `json:"intermediateUrl"` + // decayed visits score for ranking + DecayedVisitScore *float64 `json:"decayedVisitScore,omitempty"` + // The URL using which the user can access the edit page of the shortcut. + EditURL *string `json:"editUrl,omitempty"` +} + +func (o *ExternalShortcut) GetInputAlias() string { + if o == nil { + return "" + } + return o.InputAlias +} + +func (o *ExternalShortcut) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *ExternalShortcut) GetDestinationURL() string { + if o == nil { + return "" + } + return o.DestinationURL +} + +func (o *ExternalShortcut) GetCreatedBy() string { + if o == nil { + return "" + } + return o.CreatedBy +} + +func (o *ExternalShortcut) GetCreateTime() *int64 { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *ExternalShortcut) GetUpdatedBy() *string { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *ExternalShortcut) GetUpdateTime() *int64 { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *ExternalShortcut) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *ExternalShortcut) GetIntermediateURL() string { + if o == nil { + return "" + } + return o.IntermediateURL +} + +func (o *ExternalShortcut) GetDecayedVisitScore() *float64 { + if o == nil { + return nil + } + return o.DecayedVisitScore +} + +func (o *ExternalShortcut) GetEditURL() *string { + if o == nil { + return nil + } + return o.EditURL +} diff --git a/tests/mockserver/internal/sdk/models/components/extractedqna.go b/tests/mockserver/internal/sdk/models/components/extractedqna.go new file mode 100644 index 00000000..f3a6ce3a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/extractedqna.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ExtractedQnA struct { + // Heading text that was matched to produce this result. + Heading *string `json:"heading,omitempty"` + // Question text that was matched to produce this result. + Question *string `json:"question,omitempty"` + QuestionResult *SearchResult `json:"questionResult,omitempty"` +} + +func (o *ExtractedQnA) GetHeading() *string { + if o == nil { + return nil + } + return o.Heading +} + +func (o *ExtractedQnA) GetQuestion() *string { + if o == nil { + return nil + } + return o.Question +} + +func (o *ExtractedQnA) GetQuestionResult() *SearchResult { + if o == nil { + return nil + } + return o.QuestionResult +} diff --git a/tests/mockserver/internal/sdk/models/components/facetbucket.go b/tests/mockserver/internal/sdk/models/components/facetbucket.go new file mode 100644 index 00000000..bc1861d2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/facetbucket.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type FacetBucket struct { + // Estimated number of results in this facet. + Count *int64 `json:"count,omitempty"` + // The datasource the value belongs to. This will be used by the all tab to show types across all datasources. + Datasource *string `json:"datasource,omitempty"` + // Estimated percentage of results in this facet. + Percentage *int64 `json:"percentage,omitempty"` + Value *FacetValue `json:"value,omitempty"` +} + +func (o *FacetBucket) GetCount() *int64 { + if o == nil { + return nil + } + return o.Count +} + +func (o *FacetBucket) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *FacetBucket) GetPercentage() *int64 { + if o == nil { + return nil + } + return o.Percentage +} + +func (o *FacetBucket) GetValue() *FacetValue { + if o == nil { + return nil + } + return o.Value +} diff --git a/tests/mockserver/internal/sdk/models/components/facetbucketfilter.go b/tests/mockserver/internal/sdk/models/components/facetbucketfilter.go new file mode 100644 index 00000000..f7dacbe1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/facetbucketfilter.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type FacetBucketFilter struct { + // The facet whose buckets should be filtered. + Facet *string `json:"facet,omitempty"` + // The per-term prefix that facet buckets should be filtered on. + Prefix *string `json:"prefix,omitempty"` +} + +func (o *FacetBucketFilter) GetFacet() *string { + if o == nil { + return nil + } + return o.Facet +} + +func (o *FacetBucketFilter) GetPrefix() *string { + if o == nil { + return nil + } + return o.Prefix +} diff --git a/tests/mockserver/internal/sdk/models/components/facetfilter.go b/tests/mockserver/internal/sdk/models/components/facetfilter.go new file mode 100644 index 00000000..b20d27ef --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/facetfilter.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type FacetFilter struct { + FieldName *string `json:"fieldName,omitempty"` + // Within a single FacetFilter, the values are to be treated like an OR. For example, fieldName type with values [EQUALS Presentation, EQUALS Spreadsheet] means we want to show a document if it's a Presentation OR a Spreadsheet. + Values []FacetFilterValue `json:"values,omitempty"` + // Indicates the value of a facet, if any, that the given facet is grouped under. This is only used for nested facets, for example, fieldName could be owner and groupName would be Spreadsheet if showing all owners for spreadsheets as a nested facet. + GroupName *string `json:"groupName,omitempty"` +} + +func (o *FacetFilter) GetFieldName() *string { + if o == nil { + return nil + } + return o.FieldName +} + +func (o *FacetFilter) GetValues() []FacetFilterValue { + if o == nil { + return nil + } + return o.Values +} + +func (o *FacetFilter) GetGroupName() *string { + if o == nil { + return nil + } + return o.GroupName +} diff --git a/tests/mockserver/internal/sdk/models/components/facetfilterset.go b/tests/mockserver/internal/sdk/models/components/facetfilterset.go new file mode 100644 index 00000000..fd364863 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/facetfilterset.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// FacetFilterSet - Within a single FacetFilterSet, the filters are treated as AND. For example, owner Sumeet and type Spreadsheet shows documents that are by Sumeet AND are Spreadsheets. +type FacetFilterSet struct { + Filters []FacetFilter `json:"filters,omitempty"` +} + +func (o *FacetFilterSet) GetFilters() []FacetFilter { + if o == nil { + return nil + } + return o.Filters +} diff --git a/tests/mockserver/internal/sdk/models/components/facetfiltervalue.go b/tests/mockserver/internal/sdk/models/components/facetfiltervalue.go new file mode 100644 index 00000000..bff109f9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/facetfiltervalue.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type RelationType string + +const ( + RelationTypeEquals RelationType = "EQUALS" + RelationTypeIDEquals RelationType = "ID_EQUALS" + RelationTypeLt RelationType = "LT" + RelationTypeGt RelationType = "GT" + RelationTypeNotEquals RelationType = "NOT_EQUALS" +) + +func (e RelationType) ToPointer() *RelationType { + return &e +} +func (e *RelationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "EQUALS": + fallthrough + case "ID_EQUALS": + fallthrough + case "LT": + fallthrough + case "GT": + fallthrough + case "NOT_EQUALS": + *e = RelationType(v) + return nil + default: + return fmt.Errorf("invalid value for RelationType: %v", v) + } +} + +type FacetFilterValue struct { + Value *string `json:"value,omitempty"` + RelationType *RelationType `json:"relationType,omitempty"` + // DEPRECATED - please use relationType instead + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + IsNegated *bool `json:"isNegated,omitempty"` +} + +func (o *FacetFilterValue) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} + +func (o *FacetFilterValue) GetRelationType() *RelationType { + if o == nil { + return nil + } + return o.RelationType +} + +func (o *FacetFilterValue) GetIsNegated() *bool { + if o == nil { + return nil + } + return o.IsNegated +} diff --git a/tests/mockserver/internal/sdk/models/components/facetresult.go b/tests/mockserver/internal/sdk/models/components/facetresult.go new file mode 100644 index 00000000..a9ad79ba --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/facetresult.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type FacetResult struct { + // The source of this facet (e.g. container_name, type, last_updated_at). + SourceName *string `json:"sourceName,omitempty"` + // How to display this facet. Currently supportes 'SelectSingle' and 'SelectMultiple'. + OperatorName *string `json:"operatorName,omitempty"` + // A list of unique buckets that exist within this result set. + Buckets []FacetBucket `json:"buckets,omitempty"` + // Returns true if more buckets exist than those returned. Additional buckets can be retrieve by requesting again with a higher facetBucketSize. + HasMoreBuckets *bool `json:"hasMoreBuckets,omitempty"` + // For most facets this will be the empty string, meaning the facet is high-level and applies to all documents for the datasource. When non-empty, this is used to group facets together (i.e. group facets for each doctype for a certain datasource) + GroupName *string `json:"groupName,omitempty"` +} + +func (o *FacetResult) GetSourceName() *string { + if o == nil { + return nil + } + return o.SourceName +} + +func (o *FacetResult) GetOperatorName() *string { + if o == nil { + return nil + } + return o.OperatorName +} + +func (o *FacetResult) GetBuckets() []FacetBucket { + if o == nil { + return nil + } + return o.Buckets +} + +func (o *FacetResult) GetHasMoreBuckets() *bool { + if o == nil { + return nil + } + return o.HasMoreBuckets +} + +func (o *FacetResult) GetGroupName() *string { + if o == nil { + return nil + } + return o.GroupName +} diff --git a/tests/mockserver/internal/sdk/models/components/facetvalue.go b/tests/mockserver/internal/sdk/models/components/facetvalue.go new file mode 100644 index 00000000..e720e4a7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/facetvalue.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type FacetValue struct { + // The value that should be set in the FacetFilter when applying this filter to a search request. + StringValue *string `json:"stringValue,omitempty"` + IntegerValue *int64 `json:"integerValue,omitempty"` + // An optional user-friendly label to display in place of the facet value. + DisplayLabel *string `json:"displayLabel,omitempty"` + // Defines how to render an icon + IconConfig *IconConfig `json:"iconConfig,omitempty"` +} + +func (o *FacetValue) GetStringValue() *string { + if o == nil { + return nil + } + return o.StringValue +} + +func (o *FacetValue) GetIntegerValue() *int64 { + if o == nil { + return nil + } + return o.IntegerValue +} + +func (o *FacetValue) GetDisplayLabel() *string { + if o == nil { + return nil + } + return o.DisplayLabel +} + +func (o *FacetValue) GetIconConfig() *IconConfig { + if o == nil { + return nil + } + return o.IconConfig +} diff --git a/tests/mockserver/internal/sdk/models/components/favoriteinfo.go b/tests/mockserver/internal/sdk/models/components/favoriteinfo.go new file mode 100644 index 00000000..7e46f018 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/favoriteinfo.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type FavoriteInfo struct { + UgcType *UgcType `json:"ugcType,omitempty"` + // Opaque id of the UGC. + ID *string `json:"id,omitempty"` + // Number of users this object has been favorited by. + Count *int64 `json:"count,omitempty"` + // If the requesting user has favorited this object. + FavoritedByUser *bool `json:"favoritedByUser,omitempty"` +} + +func (o *FavoriteInfo) GetUgcType() *UgcType { + if o == nil { + return nil + } + return o.UgcType +} + +func (o *FavoriteInfo) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *FavoriteInfo) GetCount() *int64 { + if o == nil { + return nil + } + return o.Count +} + +func (o *FavoriteInfo) GetFavoritedByUser() *bool { + if o == nil { + return nil + } + return o.FavoritedByUser +} diff --git a/tests/mockserver/internal/sdk/models/components/feedback.go b/tests/mockserver/internal/sdk/models/components/feedback.go new file mode 100644 index 00000000..101c1f19 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/feedback.go @@ -0,0 +1,386 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// FeedbackCategory - The feature category to which the feedback applies. These should be broad product areas such as Announcements, Answers, Search, etc. rather than specific components or UI treatments within those areas. +type FeedbackCategory string + +const ( + FeedbackCategoryAnnouncement FeedbackCategory = "ANNOUNCEMENT" + FeedbackCategoryAutocomplete FeedbackCategory = "AUTOCOMPLETE" + FeedbackCategoryCollections FeedbackCategory = "COLLECTIONS" + FeedbackCategoryFeed FeedbackCategory = "FEED" + FeedbackCategorySearch FeedbackCategory = "SEARCH" + FeedbackCategoryChat FeedbackCategory = "CHAT" + FeedbackCategoryNtp FeedbackCategory = "NTP" + FeedbackCategoryWorkflows FeedbackCategory = "WORKFLOWS" + FeedbackCategorySummary FeedbackCategory = "SUMMARY" + FeedbackCategoryGeneral FeedbackCategory = "GENERAL" + FeedbackCategoryPrompts FeedbackCategory = "PROMPTS" +) + +func (e FeedbackCategory) ToPointer() *FeedbackCategory { + return &e +} +func (e *FeedbackCategory) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ANNOUNCEMENT": + fallthrough + case "AUTOCOMPLETE": + fallthrough + case "COLLECTIONS": + fallthrough + case "FEED": + fallthrough + case "SEARCH": + fallthrough + case "CHAT": + fallthrough + case "NTP": + fallthrough + case "WORKFLOWS": + fallthrough + case "SUMMARY": + fallthrough + case "GENERAL": + fallthrough + case "PROMPTS": + *e = FeedbackCategory(v) + return nil + default: + return fmt.Errorf("invalid value for FeedbackCategory: %v", v) + } +} + +// Event - The action the user took within a Glean client with respect to the object referred to by the given `trackingToken`. +type Event string + +const ( + EventClick Event = "CLICK" + EventContainerClick Event = "CONTAINER_CLICK" + EventCopyLink Event = "COPY_LINK" + EventCreate Event = "CREATE" + EventDismiss Event = "DISMISS" + EventDownvote Event = "DOWNVOTE" + EventEmail Event = "EMAIL" + EventExecute Event = "EXECUTE" + EventFilter Event = "FILTER" + EventFirstToken Event = "FIRST_TOKEN" + EventFocusIn Event = "FOCUS_IN" + EventLastToken Event = "LAST_TOKEN" + EventManualFeedback Event = "MANUAL_FEEDBACK" + EventMarkAsRead Event = "MARK_AS_READ" + EventMessage Event = "MESSAGE" + EventMiddleClick Event = "MIDDLE_CLICK" + EventPageBlur Event = "PAGE_BLUR" + EventPageFocus Event = "PAGE_FOCUS" + EventPageLeave Event = "PAGE_LEAVE" + EventPreview Event = "PREVIEW" + EventRelatedClick Event = "RELATED_CLICK" + EventRightClick Event = "RIGHT_CLICK" + EventSectionClick Event = "SECTION_CLICK" + EventSeen Event = "SEEN" + EventShare Event = "SHARE" + EventShowMore Event = "SHOW_MORE" + EventUpvote Event = "UPVOTE" + EventView Event = "VIEW" + EventVisible Event = "VISIBLE" +) + +func (e Event) ToPointer() *Event { + return &e +} +func (e *Event) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "CLICK": + fallthrough + case "CONTAINER_CLICK": + fallthrough + case "COPY_LINK": + fallthrough + case "CREATE": + fallthrough + case "DISMISS": + fallthrough + case "DOWNVOTE": + fallthrough + case "EMAIL": + fallthrough + case "EXECUTE": + fallthrough + case "FILTER": + fallthrough + case "FIRST_TOKEN": + fallthrough + case "FOCUS_IN": + fallthrough + case "LAST_TOKEN": + fallthrough + case "MANUAL_FEEDBACK": + fallthrough + case "MARK_AS_READ": + fallthrough + case "MESSAGE": + fallthrough + case "MIDDLE_CLICK": + fallthrough + case "PAGE_BLUR": + fallthrough + case "PAGE_FOCUS": + fallthrough + case "PAGE_LEAVE": + fallthrough + case "PREVIEW": + fallthrough + case "RELATED_CLICK": + fallthrough + case "RIGHT_CLICK": + fallthrough + case "SECTION_CLICK": + fallthrough + case "SEEN": + fallthrough + case "SHARE": + fallthrough + case "SHOW_MORE": + fallthrough + case "UPVOTE": + fallthrough + case "VIEW": + fallthrough + case "VISIBLE": + *e = Event(v) + return nil + default: + return fmt.Errorf("invalid value for Event: %v", v) + } +} + +type FeedbackChannel string + +const ( + FeedbackChannelCompany FeedbackChannel = "COMPANY" + FeedbackChannelGlean FeedbackChannel = "GLEAN" +) + +func (e FeedbackChannel) ToPointer() *FeedbackChannel { + return &e +} +func (e *FeedbackChannel) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "COMPANY": + fallthrough + case "GLEAN": + *e = FeedbackChannel(v) + return nil + default: + return fmt.Errorf("invalid value for FeedbackChannel: %v", v) + } +} + +type Feedback struct { + // Universally unique identifier of the event. To allow for reliable retransmission, only the earliest received event of a given UUID is considered valid by the server and subsequent are ignored. + ID *string `json:"id,omitempty"` + // The feature category to which the feedback applies. These should be broad product areas such as Announcements, Answers, Search, etc. rather than specific components or UI treatments within those areas. + Category *FeedbackCategory `json:"category,omitempty"` + // A list of server-generated trackingTokens to which this event applies. + TrackingTokens []string `json:"trackingTokens"` + // The action the user took within a Glean client with respect to the object referred to by the given `trackingToken`. + Event Event `json:"event"` + // Position of the element in the case that the client controls order (such as feed and autocomplete). + Position *int64 `json:"position,omitempty"` + // For type MANUAL_FEEDBACK, contains string of user feedback. For autocomplete, partial query string. For feed, string of user feedback in addition to manual feedback signals extracted from all suggested content. + Payload *string `json:"payload,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + // The ISO 8601 timestamp when the event occured. + Timestamp *time.Time `json:"timestamp,omitempty"` + User *User `json:"user,omitempty"` + // The path the client was at when the feedback event triggered. + Pathname *string `json:"pathname,omitempty"` + // Where the feedback will be sent, e.g. to Glean, the user's company, or both. If no channels are specified, feedback will go only to Glean. + Channels []FeedbackChannel `json:"channels,omitempty"` + // The URL the client was at when the feedback event triggered. + URL *string `json:"url,omitempty"` + // The UI element tree associated with the event, if any. + UITree []string `json:"uiTree,omitempty"` + // The UI element associated with the event, if any. + UIElement *string `json:"uiElement,omitempty"` + ManualFeedbackInfo *ManualFeedbackInfo `json:"manualFeedbackInfo,omitempty"` + SeenFeedbackInfo *SeenFeedbackInfo `json:"seenFeedbackInfo,omitempty"` + UserViewInfo *UserViewInfo `json:"userViewInfo,omitempty"` + WorkflowFeedbackInfo *WorkflowFeedbackInfo `json:"workflowFeedbackInfo,omitempty"` + // The application ID of the client that sent the feedback event. + ApplicationID *string `json:"applicationId,omitempty"` + // The agent ID of the client that sent the feedback event. + AgentID *string `json:"agentId,omitempty"` +} + +func (f Feedback) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *Feedback) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Feedback) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Feedback) GetCategory() *FeedbackCategory { + if o == nil { + return nil + } + return o.Category +} + +func (o *Feedback) GetTrackingTokens() []string { + if o == nil { + return []string{} + } + return o.TrackingTokens +} + +func (o *Feedback) GetEvent() Event { + if o == nil { + return Event("") + } + return o.Event +} + +func (o *Feedback) GetPosition() *int64 { + if o == nil { + return nil + } + return o.Position +} + +func (o *Feedback) GetPayload() *string { + if o == nil { + return nil + } + return o.Payload +} + +func (o *Feedback) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *Feedback) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} + +func (o *Feedback) GetUser() *User { + if o == nil { + return nil + } + return o.User +} + +func (o *Feedback) GetPathname() *string { + if o == nil { + return nil + } + return o.Pathname +} + +func (o *Feedback) GetChannels() []FeedbackChannel { + if o == nil { + return nil + } + return o.Channels +} + +func (o *Feedback) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *Feedback) GetUITree() []string { + if o == nil { + return nil + } + return o.UITree +} + +func (o *Feedback) GetUIElement() *string { + if o == nil { + return nil + } + return o.UIElement +} + +func (o *Feedback) GetManualFeedbackInfo() *ManualFeedbackInfo { + if o == nil { + return nil + } + return o.ManualFeedbackInfo +} + +func (o *Feedback) GetSeenFeedbackInfo() *SeenFeedbackInfo { + if o == nil { + return nil + } + return o.SeenFeedbackInfo +} + +func (o *Feedback) GetUserViewInfo() *UserViewInfo { + if o == nil { + return nil + } + return o.UserViewInfo +} + +func (o *Feedback) GetWorkflowFeedbackInfo() *WorkflowFeedbackInfo { + if o == nil { + return nil + } + return o.WorkflowFeedbackInfo +} + +func (o *Feedback) GetApplicationID() *string { + if o == nil { + return nil + } + return o.ApplicationID +} + +func (o *Feedback) GetAgentID() *string { + if o == nil { + return nil + } + return o.AgentID +} diff --git a/tests/mockserver/internal/sdk/models/components/feedbackchatexchange.go b/tests/mockserver/internal/sdk/models/components/feedbackchatexchange.go new file mode 100644 index 00000000..04cc3a93 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/feedbackchatexchange.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ResultDocument struct { + Title *string `json:"title,omitempty"` + URL *string `json:"url,omitempty"` +} + +func (o *ResultDocument) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *ResultDocument) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +type FeedbackChatExchange struct { + // Unix timestamp in millis for the chat request. + Timestamp *int64 `json:"timestamp,omitempty"` + // Either DEFAULT (company knowledge) or GPT (world knowledge). + Agent *string `json:"agent,omitempty"` + // Initial query entered by the user. + UserQuery *string `json:"userQuery,omitempty"` + // Search query performed by the agent. + SearchQuery *string `json:"searchQuery,omitempty"` + // List of documents read by the agent. + ResultDocuments []ResultDocument `json:"resultDocuments,omitempty"` + Response *string `json:"response,omitempty"` +} + +func (o *FeedbackChatExchange) GetTimestamp() *int64 { + if o == nil { + return nil + } + return o.Timestamp +} + +func (o *FeedbackChatExchange) GetAgent() *string { + if o == nil { + return nil + } + return o.Agent +} + +func (o *FeedbackChatExchange) GetUserQuery() *string { + if o == nil { + return nil + } + return o.UserQuery +} + +func (o *FeedbackChatExchange) GetSearchQuery() *string { + if o == nil { + return nil + } + return o.SearchQuery +} + +func (o *FeedbackChatExchange) GetResultDocuments() []ResultDocument { + if o == nil { + return nil + } + return o.ResultDocuments +} + +func (o *FeedbackChatExchange) GetResponse() *string { + if o == nil { + return nil + } + return o.Response +} diff --git a/tests/mockserver/internal/sdk/models/components/feedentry.go b/tests/mockserver/internal/sdk/models/components/feedentry.go new file mode 100644 index 00000000..84d2f8c5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/feedentry.go @@ -0,0 +1,340 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// Format - defines how to render this particular displayable list card +type Format string + +const ( + FormatList Format = "LIST" +) + +func (e Format) ToPointer() *Format { + return &e +} +func (e *Format) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "LIST": + *e = Format(v) + return nil + default: + return fmt.Errorf("invalid value for Format: %v", v) + } +} + +type UIConfig struct { + // defines how to render this particular displayable list card + Format *Format `json:"format,omitempty"` + // UI configurations for each item of the list + AdditionalFlags *DisplayableListItemUIConfig `json:"additionalFlags,omitempty"` +} + +func (o *UIConfig) GetFormat() *Format { + if o == nil { + return nil + } + return o.Format +} + +func (o *UIConfig) GetAdditionalFlags() *DisplayableListItemUIConfig { + if o == nil { + return nil + } + return o.AdditionalFlags +} + +// JustificationType - Type of the justification. +type JustificationType string + +const ( + JustificationTypeFrequentlyAccessed JustificationType = "FREQUENTLY_ACCESSED" + JustificationTypeRecentlyAccessed JustificationType = "RECENTLY_ACCESSED" + JustificationTypeTrendingDocument JustificationType = "TRENDING_DOCUMENT" + JustificationTypeVerificationReminder JustificationType = "VERIFICATION_REMINDER" + JustificationTypeSuggestedDocument JustificationType = "SUGGESTED_DOCUMENT" + JustificationTypeEmptyStateSuggestion JustificationType = "EMPTY_STATE_SUGGESTION" + JustificationTypeFrecencyScored JustificationType = "FRECENCY_SCORED" + JustificationTypeServerGenerated JustificationType = "SERVER_GENERATED" + JustificationTypeUseCase JustificationType = "USE_CASE" + JustificationTypeUpdateSinceLastView JustificationType = "UPDATE_SINCE_LAST_VIEW" + JustificationTypeRecentlyStarted JustificationType = "RECENTLY_STARTED" + JustificationTypeEvent JustificationType = "EVENT" + JustificationTypeUserMention JustificationType = "USER_MENTION" + JustificationTypeAnnouncement JustificationType = "ANNOUNCEMENT" + JustificationTypeExternalAnnouncement JustificationType = "EXTERNAL_ANNOUNCEMENT" + JustificationTypePopularityBasedTrending JustificationType = "POPULARITY_BASED_TRENDING" + JustificationTypeCompanyResource JustificationType = "COMPANY_RESOURCE" + JustificationTypeEventDocumentFromContent JustificationType = "EVENT_DOCUMENT_FROM_CONTENT" + JustificationTypeEventDocumentFromSearch JustificationType = "EVENT_DOCUMENT_FROM_SEARCH" + JustificationTypeVisitAffinityScored JustificationType = "VISIT_AFFINITY_SCORED" + JustificationTypeSuggestedApp JustificationType = "SUGGESTED_APP" + JustificationTypeSuggestedPerson JustificationType = "SUGGESTED_PERSON" + JustificationTypeActivityHighlight JustificationType = "ACTIVITY_HIGHLIGHT" + JustificationTypeSavedSearch JustificationType = "SAVED_SEARCH" + JustificationTypeSuggestedChannel JustificationType = "SUGGESTED_CHANNEL" + JustificationTypePeopleCelebrations JustificationType = "PEOPLE_CELEBRATIONS" + JustificationTypeSocialLink JustificationType = "SOCIAL_LINK" + JustificationTypeZeroStateChatSuggestion JustificationType = "ZERO_STATE_CHAT_SUGGESTION" + JustificationTypeZeroStateChatToolSuggestion JustificationType = "ZERO_STATE_CHAT_TOOL_SUGGESTION" + JustificationTypeZeroStatePromptTemplateSuggestion JustificationType = "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION" + JustificationTypeZeroStateStaticWorkflowSuggestion JustificationType = "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION" + JustificationTypeZeroStateAgentSuggestion JustificationType = "ZERO_STATE_AGENT_SUGGESTION" +) + +func (e JustificationType) ToPointer() *JustificationType { + return &e +} +func (e *JustificationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "FREQUENTLY_ACCESSED": + fallthrough + case "RECENTLY_ACCESSED": + fallthrough + case "TRENDING_DOCUMENT": + fallthrough + case "VERIFICATION_REMINDER": + fallthrough + case "SUGGESTED_DOCUMENT": + fallthrough + case "EMPTY_STATE_SUGGESTION": + fallthrough + case "FRECENCY_SCORED": + fallthrough + case "SERVER_GENERATED": + fallthrough + case "USE_CASE": + fallthrough + case "UPDATE_SINCE_LAST_VIEW": + fallthrough + case "RECENTLY_STARTED": + fallthrough + case "EVENT": + fallthrough + case "USER_MENTION": + fallthrough + case "ANNOUNCEMENT": + fallthrough + case "EXTERNAL_ANNOUNCEMENT": + fallthrough + case "POPULARITY_BASED_TRENDING": + fallthrough + case "COMPANY_RESOURCE": + fallthrough + case "EVENT_DOCUMENT_FROM_CONTENT": + fallthrough + case "EVENT_DOCUMENT_FROM_SEARCH": + fallthrough + case "VISIT_AFFINITY_SCORED": + fallthrough + case "SUGGESTED_APP": + fallthrough + case "SUGGESTED_PERSON": + fallthrough + case "ACTIVITY_HIGHLIGHT": + fallthrough + case "SAVED_SEARCH": + fallthrough + case "SUGGESTED_CHANNEL": + fallthrough + case "PEOPLE_CELEBRATIONS": + fallthrough + case "SOCIAL_LINK": + fallthrough + case "ZERO_STATE_CHAT_SUGGESTION": + fallthrough + case "ZERO_STATE_CHAT_TOOL_SUGGESTION": + fallthrough + case "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION": + fallthrough + case "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION": + fallthrough + case "ZERO_STATE_AGENT_SUGGESTION": + *e = JustificationType(v) + return nil + default: + return fmt.Errorf("invalid value for JustificationType: %v", v) + } +} + +type FeedEntry struct { + // optional ID associated with a single feed entry (displayable_list_id) + EntryID *string `json:"entryId,omitempty"` + // Title for the result. Can be document title, event title and so on. + Title string `json:"title"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + CreatedBy *Person `json:"createdBy,omitempty"` + UIConfig *UIConfig `json:"uiConfig,omitempty"` + // Type of the justification. + JustificationType *JustificationType `json:"justificationType,omitempty"` + // Server side generated justification string if server provides one. + Justification *string `json:"justification,omitempty"` + // An opaque token that represents this particular feed entry in this particular response. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` + // View URL for the entry if based on links that are not documents in Glean. + ViewURL *string `json:"viewUrl,omitempty"` + Document *Document `json:"document,omitempty"` + Event *CalendarEvent `json:"event,omitempty"` + Announcement *Announcement `json:"announcement,omitempty"` + Collection *Collection `json:"collection,omitempty"` + CollectionItem *CollectionItem `json:"collectionItem,omitempty"` + Person *Person `json:"person,omitempty"` + App *AppResult `json:"app,omitempty"` + PromptTemplate *PromptTemplateResult `json:"promptTemplate,omitempty"` + Workflow *WorkflowResult `json:"workflow,omitempty"` + // List of activity where each activity has user, action, timestamp. + Activities []UserActivity `json:"activities,omitempty"` + DocumentVisitorCount *CountInfo `json:"documentVisitorCount,omitempty"` +} + +func (o *FeedEntry) GetEntryID() *string { + if o == nil { + return nil + } + return o.EntryID +} + +func (o *FeedEntry) GetTitle() string { + if o == nil { + return "" + } + return o.Title +} + +func (o *FeedEntry) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *FeedEntry) GetCreatedBy() *Person { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *FeedEntry) GetUIConfig() *UIConfig { + if o == nil { + return nil + } + return o.UIConfig +} + +func (o *FeedEntry) GetJustificationType() *JustificationType { + if o == nil { + return nil + } + return o.JustificationType +} + +func (o *FeedEntry) GetJustification() *string { + if o == nil { + return nil + } + return o.Justification +} + +func (o *FeedEntry) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *FeedEntry) GetViewURL() *string { + if o == nil { + return nil + } + return o.ViewURL +} + +func (o *FeedEntry) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} + +func (o *FeedEntry) GetEvent() *CalendarEvent { + if o == nil { + return nil + } + return o.Event +} + +func (o *FeedEntry) GetAnnouncement() *Announcement { + if o == nil { + return nil + } + return o.Announcement +} + +func (o *FeedEntry) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} + +func (o *FeedEntry) GetCollectionItem() *CollectionItem { + if o == nil { + return nil + } + return o.CollectionItem +} + +func (o *FeedEntry) GetPerson() *Person { + if o == nil { + return nil + } + return o.Person +} + +func (o *FeedEntry) GetApp() *AppResult { + if o == nil { + return nil + } + return o.App +} + +func (o *FeedEntry) GetPromptTemplate() *PromptTemplateResult { + if o == nil { + return nil + } + return o.PromptTemplate +} + +func (o *FeedEntry) GetWorkflow() *WorkflowResult { + if o == nil { + return nil + } + return o.Workflow +} + +func (o *FeedEntry) GetActivities() []UserActivity { + if o == nil { + return nil + } + return o.Activities +} + +func (o *FeedEntry) GetDocumentVisitorCount() *CountInfo { + if o == nil { + return nil + } + return o.DocumentVisitorCount +} diff --git a/tests/mockserver/internal/sdk/models/components/feedrequest.go b/tests/mockserver/internal/sdk/models/components/feedrequest.go new file mode 100644 index 00000000..bc913d44 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/feedrequest.go @@ -0,0 +1,131 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type FeedRequestCategory string + +const ( + FeedRequestCategoryDocumentSuggestion FeedRequestCategory = "DOCUMENT_SUGGESTION" + FeedRequestCategoryDocumentSuggestionScenario FeedRequestCategory = "DOCUMENT_SUGGESTION_SCENARIO" + FeedRequestCategoryTrendingDocument FeedRequestCategory = "TRENDING_DOCUMENT" + FeedRequestCategoryVerificationReminder FeedRequestCategory = "VERIFICATION_REMINDER" + FeedRequestCategoryEvent FeedRequestCategory = "EVENT" + FeedRequestCategoryAnnouncement FeedRequestCategory = "ANNOUNCEMENT" + FeedRequestCategoryMention FeedRequestCategory = "MENTION" + FeedRequestCategoryDatasourceAffinity FeedRequestCategory = "DATASOURCE_AFFINITY" + FeedRequestCategoryRecent FeedRequestCategory = "RECENT" + FeedRequestCategoryCompanyResource FeedRequestCategory = "COMPANY_RESOURCE" + FeedRequestCategoryExperimental FeedRequestCategory = "EXPERIMENTAL" + FeedRequestCategoryPeopleCelebrations FeedRequestCategory = "PEOPLE_CELEBRATIONS" + FeedRequestCategoryDisplayableList FeedRequestCategory = "DISPLAYABLE_LIST" + FeedRequestCategorySocialLink FeedRequestCategory = "SOCIAL_LINK" + FeedRequestCategoryExternalTasks FeedRequestCategory = "EXTERNAL_TASKS" + FeedRequestCategoryWorkflowCollections FeedRequestCategory = "WORKFLOW_COLLECTIONS" + FeedRequestCategoryZeroStateChatSuggestion FeedRequestCategory = "ZERO_STATE_CHAT_SUGGESTION" + FeedRequestCategoryZeroStateChatToolSuggestion FeedRequestCategory = "ZERO_STATE_CHAT_TOOL_SUGGESTION" + FeedRequestCategoryZeroStateWorkflowCreatedByMe FeedRequestCategory = "ZERO_STATE_WORKFLOW_CREATED_BY_ME" + FeedRequestCategoryZeroStateWorkflowFavorites FeedRequestCategory = "ZERO_STATE_WORKFLOW_FAVORITES" + FeedRequestCategoryZeroStateWorkflowPopular FeedRequestCategory = "ZERO_STATE_WORKFLOW_POPULAR" + FeedRequestCategoryZeroStateWorkflowSuggestion FeedRequestCategory = "ZERO_STATE_WORKFLOW_SUGGESTION" +) + +func (e FeedRequestCategory) ToPointer() *FeedRequestCategory { + return &e +} +func (e *FeedRequestCategory) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DOCUMENT_SUGGESTION": + fallthrough + case "DOCUMENT_SUGGESTION_SCENARIO": + fallthrough + case "TRENDING_DOCUMENT": + fallthrough + case "VERIFICATION_REMINDER": + fallthrough + case "EVENT": + fallthrough + case "ANNOUNCEMENT": + fallthrough + case "MENTION": + fallthrough + case "DATASOURCE_AFFINITY": + fallthrough + case "RECENT": + fallthrough + case "COMPANY_RESOURCE": + fallthrough + case "EXPERIMENTAL": + fallthrough + case "PEOPLE_CELEBRATIONS": + fallthrough + case "DISPLAYABLE_LIST": + fallthrough + case "SOCIAL_LINK": + fallthrough + case "EXTERNAL_TASKS": + fallthrough + case "WORKFLOW_COLLECTIONS": + fallthrough + case "ZERO_STATE_CHAT_SUGGESTION": + fallthrough + case "ZERO_STATE_CHAT_TOOL_SUGGESTION": + fallthrough + case "ZERO_STATE_WORKFLOW_CREATED_BY_ME": + fallthrough + case "ZERO_STATE_WORKFLOW_FAVORITES": + fallthrough + case "ZERO_STATE_WORKFLOW_POPULAR": + fallthrough + case "ZERO_STATE_WORKFLOW_SUGGESTION": + *e = FeedRequestCategory(v) + return nil + default: + return fmt.Errorf("invalid value for FeedRequestCategory: %v", v) + } +} + +type FeedRequest struct { + // Categories of content requested. An allowlist gives flexibility to request content separately or together. + Categories []FeedRequestCategory `json:"categories,omitempty"` + RequestOptions *FeedRequestOptions `json:"requestOptions,omitempty"` + // Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + TimeoutMillis *int64 `json:"timeoutMillis,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` +} + +func (o *FeedRequest) GetCategories() []FeedRequestCategory { + if o == nil { + return nil + } + return o.Categories +} + +func (o *FeedRequest) GetRequestOptions() *FeedRequestOptions { + if o == nil { + return nil + } + return o.RequestOptions +} + +func (o *FeedRequest) GetTimeoutMillis() *int64 { + if o == nil { + return nil + } + return o.TimeoutMillis +} + +func (o *FeedRequest) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} diff --git a/tests/mockserver/internal/sdk/models/components/feedrequestoptions.go b/tests/mockserver/internal/sdk/models/components/feedrequestoptions.go new file mode 100644 index 00000000..7a1d1f2e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/feedrequestoptions.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CategoryToResultSize struct { + ResultSize *int64 `json:"resultSize,omitempty"` +} + +func (o *CategoryToResultSize) GetResultSize() *int64 { + if o == nil { + return nil + } + return o.ResultSize +} + +type FeedRequestOptions struct { + // Number of results asked in response. If a result is a collection, counts as one. + ResultSize int64 `json:"resultSize"` + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `json:"timezoneOffset,omitempty"` + // Mapping from category to number of results asked for the category. + CategoryToResultSize map[string]CategoryToResultSize `json:"categoryToResultSize,omitempty"` + // Datasources for which content should be included. Empty is for all. + DatasourceFilter []string `json:"datasourceFilter,omitempty"` + ChatZeroStateSuggestionOptions *ChatZeroStateSuggestionOptions `json:"chatZeroStateSuggestionOptions,omitempty"` +} + +func (o *FeedRequestOptions) GetResultSize() int64 { + if o == nil { + return 0 + } + return o.ResultSize +} + +func (o *FeedRequestOptions) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *FeedRequestOptions) GetCategoryToResultSize() map[string]CategoryToResultSize { + if o == nil { + return nil + } + return o.CategoryToResultSize +} + +func (o *FeedRequestOptions) GetDatasourceFilter() []string { + if o == nil { + return nil + } + return o.DatasourceFilter +} + +func (o *FeedRequestOptions) GetChatZeroStateSuggestionOptions() *ChatZeroStateSuggestionOptions { + if o == nil { + return nil + } + return o.ChatZeroStateSuggestionOptions +} diff --git a/tests/mockserver/internal/sdk/models/components/feedresponse.go b/tests/mockserver/internal/sdk/models/components/feedresponse.go new file mode 100644 index 00000000..54f9d1a8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/feedresponse.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type FeedResponse struct { + // List of experiment ids for the corresponding request. + ExperimentIds []int64 `json:"experimentIds,omitempty"` + // An opaque token that represents this particular feed response. + TrackingToken *string `json:"trackingToken,omitempty"` + // Server unix timestamp (in seconds since epoch UTC). + ServerTimestamp int64 `json:"serverTimestamp"` + Results []FeedResult `json:"results,omitempty"` + // Map from category to the list of facets that can be used to filter the entry's content. + FacetResults map[string][]FacetResult `json:"facetResults,omitempty"` + // The time window (in hours) used for generating user mentions. + MentionsTimeWindowInHours *int64 `json:"mentionsTimeWindowInHours,omitempty"` +} + +func (o *FeedResponse) GetExperimentIds() []int64 { + if o == nil { + return nil + } + return o.ExperimentIds +} + +func (o *FeedResponse) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *FeedResponse) GetServerTimestamp() int64 { + if o == nil { + return 0 + } + return o.ServerTimestamp +} + +func (o *FeedResponse) GetResults() []FeedResult { + if o == nil { + return nil + } + return o.Results +} + +func (o *FeedResponse) GetFacetResults() map[string][]FacetResult { + if o == nil { + return nil + } + return o.FacetResults +} + +func (o *FeedResponse) GetMentionsTimeWindowInHours() *int64 { + if o == nil { + return nil + } + return o.MentionsTimeWindowInHours +} diff --git a/tests/mockserver/internal/sdk/models/components/feedresult.go b/tests/mockserver/internal/sdk/models/components/feedresult.go new file mode 100644 index 00000000..7fa16e06 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/feedresult.go @@ -0,0 +1,133 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// FeedResultCategory - Category of the result, one of the requested categories in incoming request. +type FeedResultCategory string + +const ( + FeedResultCategoryDocumentSuggestion FeedResultCategory = "DOCUMENT_SUGGESTION" + FeedResultCategoryDocumentSuggestionScenario FeedResultCategory = "DOCUMENT_SUGGESTION_SCENARIO" + FeedResultCategoryTrendingDocument FeedResultCategory = "TRENDING_DOCUMENT" + FeedResultCategoryUseCase FeedResultCategory = "USE_CASE" + FeedResultCategoryVerificationReminder FeedResultCategory = "VERIFICATION_REMINDER" + FeedResultCategoryEvent FeedResultCategory = "EVENT" + FeedResultCategoryAnnouncement FeedResultCategory = "ANNOUNCEMENT" + FeedResultCategoryMention FeedResultCategory = "MENTION" + FeedResultCategoryDatasourceAffinity FeedResultCategory = "DATASOURCE_AFFINITY" + FeedResultCategoryRecent FeedResultCategory = "RECENT" + FeedResultCategoryCompanyResource FeedResultCategory = "COMPANY_RESOURCE" + FeedResultCategoryExperimental FeedResultCategory = "EXPERIMENTAL" + FeedResultCategoryPeopleCelebrations FeedResultCategory = "PEOPLE_CELEBRATIONS" + FeedResultCategorySocialLink FeedResultCategory = "SOCIAL_LINK" + FeedResultCategoryExternalTasks FeedResultCategory = "EXTERNAL_TASKS" + FeedResultCategoryDisplayableList FeedResultCategory = "DISPLAYABLE_LIST" + FeedResultCategoryZeroStateChatSuggestion FeedResultCategory = "ZERO_STATE_CHAT_SUGGESTION" + FeedResultCategoryZeroStateChatToolSuggestion FeedResultCategory = "ZERO_STATE_CHAT_TOOL_SUGGESTION" + FeedResultCategoryZeroStateWorkflowCreatedByMe FeedResultCategory = "ZERO_STATE_WORKFLOW_CREATED_BY_ME" + FeedResultCategoryZeroStateWorkflowFavorites FeedResultCategory = "ZERO_STATE_WORKFLOW_FAVORITES" + FeedResultCategoryZeroStateWorkflowPopular FeedResultCategory = "ZERO_STATE_WORKFLOW_POPULAR" + FeedResultCategoryZeroStateWorkflowSuggestion FeedResultCategory = "ZERO_STATE_WORKFLOW_SUGGESTION" +) + +func (e FeedResultCategory) ToPointer() *FeedResultCategory { + return &e +} +func (e *FeedResultCategory) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DOCUMENT_SUGGESTION": + fallthrough + case "DOCUMENT_SUGGESTION_SCENARIO": + fallthrough + case "TRENDING_DOCUMENT": + fallthrough + case "USE_CASE": + fallthrough + case "VERIFICATION_REMINDER": + fallthrough + case "EVENT": + fallthrough + case "ANNOUNCEMENT": + fallthrough + case "MENTION": + fallthrough + case "DATASOURCE_AFFINITY": + fallthrough + case "RECENT": + fallthrough + case "COMPANY_RESOURCE": + fallthrough + case "EXPERIMENTAL": + fallthrough + case "PEOPLE_CELEBRATIONS": + fallthrough + case "SOCIAL_LINK": + fallthrough + case "EXTERNAL_TASKS": + fallthrough + case "DISPLAYABLE_LIST": + fallthrough + case "ZERO_STATE_CHAT_SUGGESTION": + fallthrough + case "ZERO_STATE_CHAT_TOOL_SUGGESTION": + fallthrough + case "ZERO_STATE_WORKFLOW_CREATED_BY_ME": + fallthrough + case "ZERO_STATE_WORKFLOW_FAVORITES": + fallthrough + case "ZERO_STATE_WORKFLOW_POPULAR": + fallthrough + case "ZERO_STATE_WORKFLOW_SUGGESTION": + *e = FeedResultCategory(v) + return nil + default: + return fmt.Errorf("invalid value for FeedResultCategory: %v", v) + } +} + +type FeedResult struct { + // Category of the result, one of the requested categories in incoming request. + Category FeedResultCategory `json:"category"` + PrimaryEntry FeedEntry `json:"primaryEntry"` + // Secondary entries for the result e.g. suggested docs for the calendar, carousel. + SecondaryEntries []FeedEntry `json:"secondaryEntries,omitempty"` + // Rank of the result. Rank is suggested by server. Client side rank may differ. + Rank *int64 `json:"rank,omitempty"` +} + +func (o *FeedResult) GetCategory() FeedResultCategory { + if o == nil { + return FeedResultCategory("") + } + return o.Category +} + +func (o *FeedResult) GetPrimaryEntry() FeedEntry { + if o == nil { + return FeedEntry{} + } + return o.PrimaryEntry +} + +func (o *FeedResult) GetSecondaryEntries() []FeedEntry { + if o == nil { + return nil + } + return o.SecondaryEntries +} + +func (o *FeedResult) GetRank() *int64 { + if o == nil { + return nil + } + return o.Rank +} diff --git a/tests/mockserver/internal/sdk/models/components/followupaction.go b/tests/mockserver/internal/sdk/models/components/followupaction.go new file mode 100644 index 00000000..78bd5812 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/followupaction.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// FollowupAction - A follow-up action that can be invoked by the user after a response. The action parameters are not included and need to be predicted/filled separately. +type FollowupAction struct { + // Unique identifier for this actionRun recommendation event. + ActionRunID *string `json:"actionRunId,omitempty"` + // The ID of the action instance that will be invoked. + ActionInstanceID *string `json:"actionInstanceId,omitempty"` + // The ID of the associated action. + ActionID *string `json:"actionId,omitempty"` + // Text to be displayed to the user when recommending the action instance. + RecommendationText *string `json:"recommendationText,omitempty"` + // The label to be used when displaying a button to execute this action instance. + ActionLabel *string `json:"actionLabel,omitempty"` + // Whether user confirmation is needed before executing this action instance. + UserConfirmationRequired *bool `json:"userConfirmationRequired,omitempty"` +} + +func (o *FollowupAction) GetActionRunID() *string { + if o == nil { + return nil + } + return o.ActionRunID +} + +func (o *FollowupAction) GetActionInstanceID() *string { + if o == nil { + return nil + } + return o.ActionInstanceID +} + +func (o *FollowupAction) GetActionID() *string { + if o == nil { + return nil + } + return o.ActionID +} + +func (o *FollowupAction) GetRecommendationText() *string { + if o == nil { + return nil + } + return o.RecommendationText +} + +func (o *FollowupAction) GetActionLabel() *string { + if o == nil { + return nil + } + return o.ActionLabel +} + +func (o *FollowupAction) GetUserConfirmationRequired() *bool { + if o == nil { + return nil + } + return o.UserConfirmationRequired +} diff --git a/tests/mockserver/internal/sdk/models/components/generatedattachment.go b/tests/mockserver/internal/sdk/models/components/generatedattachment.go new file mode 100644 index 00000000..0e418f08 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/generatedattachment.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GeneratedAttachment - These are attachments that aren't natively present on the event, and have been smartly suggested. +type GeneratedAttachment struct { + // The name of method used to surface relevant data for a given calendar event. + StrategyName *EventStrategyName `json:"strategyName,omitempty"` + Documents []Document `json:"documents,omitempty"` + Person *Person `json:"person,omitempty"` + Customer *Customer `json:"customer,omitempty"` + // A list of links to external sources outside of Glean. + ExternalLinks []StructuredLink `json:"externalLinks,omitempty"` + Content []GeneratedAttachmentContent `json:"content,omitempty"` +} + +func (o *GeneratedAttachment) GetStrategyName() *EventStrategyName { + if o == nil { + return nil + } + return o.StrategyName +} + +func (o *GeneratedAttachment) GetDocuments() []Document { + if o == nil { + return nil + } + return o.Documents +} + +func (o *GeneratedAttachment) GetPerson() *Person { + if o == nil { + return nil + } + return o.Person +} + +func (o *GeneratedAttachment) GetCustomer() *Customer { + if o == nil { + return nil + } + return o.Customer +} + +func (o *GeneratedAttachment) GetExternalLinks() []StructuredLink { + if o == nil { + return nil + } + return o.ExternalLinks +} + +func (o *GeneratedAttachment) GetContent() []GeneratedAttachmentContent { + if o == nil { + return nil + } + return o.Content +} diff --git a/tests/mockserver/internal/sdk/models/components/generatedattachmentcontent.go b/tests/mockserver/internal/sdk/models/components/generatedattachmentcontent.go new file mode 100644 index 00000000..5b1366c1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/generatedattachmentcontent.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GeneratedAttachmentContent - Content that has been generated or extrapolated from the documents present in the document field. +type GeneratedAttachmentContent struct { + // The header describing the generated content. + DisplayHeader *string `json:"displayHeader,omitempty"` + // The content that has been generated. + Text *string `json:"text,omitempty"` +} + +func (o *GeneratedAttachmentContent) GetDisplayHeader() *string { + if o == nil { + return nil + } + return o.DisplayHeader +} + +func (o *GeneratedAttachmentContent) GetText() *string { + if o == nil { + return nil + } + return o.Text +} diff --git a/tests/mockserver/internal/sdk/models/components/generatedqna.go b/tests/mockserver/internal/sdk/models/components/generatedqna.go new file mode 100644 index 00000000..ddecb6d8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/generatedqna.go @@ -0,0 +1,128 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// GeneratedQnaStatus - Status of backend generating the answer +type GeneratedQnaStatus string + +const ( + GeneratedQnaStatusComputing GeneratedQnaStatus = "COMPUTING" + GeneratedQnaStatusDisabled GeneratedQnaStatus = "DISABLED" + GeneratedQnaStatusFailed GeneratedQnaStatus = "FAILED" + GeneratedQnaStatusNoAnswer GeneratedQnaStatus = "NO_ANSWER" + GeneratedQnaStatusSkipped GeneratedQnaStatus = "SKIPPED" + GeneratedQnaStatusStreaming GeneratedQnaStatus = "STREAMING" + GeneratedQnaStatusSucceeded GeneratedQnaStatus = "SUCCEEDED" + GeneratedQnaStatusTimeout GeneratedQnaStatus = "TIMEOUT" +) + +func (e GeneratedQnaStatus) ToPointer() *GeneratedQnaStatus { + return &e +} +func (e *GeneratedQnaStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "COMPUTING": + fallthrough + case "DISABLED": + fallthrough + case "FAILED": + fallthrough + case "NO_ANSWER": + fallthrough + case "SKIPPED": + fallthrough + case "STREAMING": + fallthrough + case "SUCCEEDED": + fallthrough + case "TIMEOUT": + *e = GeneratedQnaStatus(v) + return nil + default: + return fmt.Errorf("invalid value for GeneratedQnaStatus: %v", v) + } +} + +type GeneratedQna struct { + // Search query rephrased into a question. + Question *string `json:"question,omitempty"` + // Answer generated for the given query or the generated question. + Answer *string `json:"answer,omitempty"` + // List of all follow-up prompts generated for the given query or the generated question. + FollowUpPrompts []string `json:"followUpPrompts,omitempty"` + // List of follow-up actions generated for the given query or the generated question. + FollowupActions []FollowupAction `json:"followupActions,omitempty"` + // Answer subsections to mark with special formatting (citations, bolding etc) + Ranges []TextRange `json:"ranges,omitempty"` + // Status of backend generating the answer + Status *GeneratedQnaStatus `json:"status,omitempty"` + // An opaque cursor representing the search request + Cursor *string `json:"cursor,omitempty"` + // An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` +} + +func (o *GeneratedQna) GetQuestion() *string { + if o == nil { + return nil + } + return o.Question +} + +func (o *GeneratedQna) GetAnswer() *string { + if o == nil { + return nil + } + return o.Answer +} + +func (o *GeneratedQna) GetFollowUpPrompts() []string { + if o == nil { + return nil + } + return o.FollowUpPrompts +} + +func (o *GeneratedQna) GetFollowupActions() []FollowupAction { + if o == nil { + return nil + } + return o.FollowupActions +} + +func (o *GeneratedQna) GetRanges() []TextRange { + if o == nil { + return nil + } + return o.Ranges +} + +func (o *GeneratedQna) GetStatus() *GeneratedQnaStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *GeneratedQna) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *GeneratedQna) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} diff --git a/tests/mockserver/internal/sdk/models/components/getanswererror.go b/tests/mockserver/internal/sdk/models/components/getanswererror.go new file mode 100644 index 00000000..76937f9b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getanswererror.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type GetAnswerErrorErrorType string + +const ( + GetAnswerErrorErrorTypeNoPermission GetAnswerErrorErrorType = "NO_PERMISSION" + GetAnswerErrorErrorTypeInvalidID GetAnswerErrorErrorType = "INVALID_ID" +) + +func (e GetAnswerErrorErrorType) ToPointer() *GetAnswerErrorErrorType { + return &e +} +func (e *GetAnswerErrorErrorType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NO_PERMISSION": + fallthrough + case "INVALID_ID": + *e = GetAnswerErrorErrorType(v) + return nil + default: + return fmt.Errorf("invalid value for GetAnswerErrorErrorType: %v", v) + } +} + +type GetAnswerError struct { + ErrorType *GetAnswerErrorErrorType `json:"errorType,omitempty"` + AnswerAuthor *Person `json:"answerAuthor,omitempty"` +} + +func (o *GetAnswerError) GetErrorType() *GetAnswerErrorErrorType { + if o == nil { + return nil + } + return o.ErrorType +} + +func (o *GetAnswerError) GetAnswerAuthor() *Person { + if o == nil { + return nil + } + return o.AnswerAuthor +} diff --git a/tests/mockserver/internal/sdk/models/components/getanswerrequest.go b/tests/mockserver/internal/sdk/models/components/getanswerrequest.go new file mode 100644 index 00000000..2f1611b9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getanswerrequest.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetAnswerRequest struct { + // The opaque ID of the Answer. + ID *int64 `json:"id,omitempty"` + // Glean Document ID of the Answer. The Glean Document ID is supported for cases where the Answer ID isn't available. If both are available, using the Answer ID is preferred. + DocID *string `json:"docId,omitempty"` +} + +func (o *GetAnswerRequest) GetID() *int64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *GetAnswerRequest) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} diff --git a/tests/mockserver/internal/sdk/models/components/getanswerresponse.go b/tests/mockserver/internal/sdk/models/components/getanswerresponse.go new file mode 100644 index 00000000..0272f330 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getanswerresponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetAnswerResponse struct { + AnswerResult *AnswerResult `json:"answerResult,omitempty"` + Error *GetAnswerError `json:"error,omitempty"` +} + +func (o *GetAnswerResponse) GetAnswerResult() *AnswerResult { + if o == nil { + return nil + } + return o.AnswerResult +} + +func (o *GetAnswerResponse) GetError() *GetAnswerError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/getchatapplicationrequest.go b/tests/mockserver/internal/sdk/models/components/getchatapplicationrequest.go new file mode 100644 index 00000000..ed309bf7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getchatapplicationrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetChatApplicationRequest struct { + // The id of the Chat application to be retrieved. + ID string `json:"id"` +} + +func (o *GetChatApplicationRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/getchatapplicationresponse.go b/tests/mockserver/internal/sdk/models/components/getchatapplicationresponse.go new file mode 100644 index 00000000..e55f9694 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getchatapplicationresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetChatApplicationResponse struct { + Application any `json:"application,omitempty"` +} + +func (o *GetChatApplicationResponse) GetApplication() any { + if o == nil { + return nil + } + return o.Application +} diff --git a/tests/mockserver/internal/sdk/models/components/getchatfilesrequest.go b/tests/mockserver/internal/sdk/models/components/getchatfilesrequest.go new file mode 100644 index 00000000..01e36cf0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getchatfilesrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetChatFilesRequest struct { + // IDs of files to fetch. + FileIds []string `json:"fileIds"` +} + +func (o *GetChatFilesRequest) GetFileIds() []string { + if o == nil { + return []string{} + } + return o.FileIds +} diff --git a/tests/mockserver/internal/sdk/models/components/getchatfilesresponse.go b/tests/mockserver/internal/sdk/models/components/getchatfilesresponse.go new file mode 100644 index 00000000..1148537a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getchatfilesresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetChatFilesResponse struct { + // A map of file IDs to ChatFile structs. + Files map[string]ChatFile `json:"files,omitempty"` +} + +func (o *GetChatFilesResponse) GetFiles() map[string]ChatFile { + if o == nil { + return nil + } + return o.Files +} diff --git a/tests/mockserver/internal/sdk/models/components/getchatrequest.go b/tests/mockserver/internal/sdk/models/components/getchatrequest.go new file mode 100644 index 00000000..82118136 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getchatrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetChatRequest struct { + // The id of the Chat to be retrieved. + ID string `json:"id"` +} + +func (o *GetChatRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/getchatresponse.go b/tests/mockserver/internal/sdk/models/components/getchatresponse.go new file mode 100644 index 00000000..88ac7a95 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getchatresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetChatResponse struct { + ChatResult *ChatResult `json:"chatResult,omitempty"` +} + +func (o *GetChatResponse) GetChatResult() *ChatResult { + if o == nil { + return nil + } + return o.ChatResult +} diff --git a/tests/mockserver/internal/sdk/models/components/getcollectionrequest.go b/tests/mockserver/internal/sdk/models/components/getcollectionrequest.go new file mode 100644 index 00000000..89a1e14b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getcollectionrequest.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetCollectionRequest struct { + // The ID of the Collection to be retrieved. + ID int64 `json:"id"` + // Whether or not to include the Collection Items in this Collection. Only request if absolutely required, as this is expensive. + WithItems *bool `json:"withItems,omitempty"` + // Whether or not to include the top level Collection in this Collection's hierarchy. + WithHierarchy *bool `json:"withHierarchy,omitempty"` + // The datasource allowed in the Collection returned. + AllowedDatasource *string `json:"allowedDatasource,omitempty"` +} + +func (o *GetCollectionRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *GetCollectionRequest) GetWithItems() *bool { + if o == nil { + return nil + } + return o.WithItems +} + +func (o *GetCollectionRequest) GetWithHierarchy() *bool { + if o == nil { + return nil + } + return o.WithHierarchy +} + +func (o *GetCollectionRequest) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} diff --git a/tests/mockserver/internal/sdk/models/components/getcollectionresponse.go b/tests/mockserver/internal/sdk/models/components/getcollectionresponse.go new file mode 100644 index 00000000..e8446d27 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getcollectionresponse.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetCollectionResponse struct { + Collection *Collection `json:"collection,omitempty"` + RootCollection *Collection `json:"rootCollection,omitempty"` + // An opaque token that represents this particular Collection. To be used for `/feedback` reporting. + TrackingToken *string `json:"trackingToken,omitempty"` + Error *CollectionError `json:"error,omitempty"` +} + +func (o *GetCollectionResponse) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} + +func (o *GetCollectionResponse) GetRootCollection() *Collection { + if o == nil { + return nil + } + return o.RootCollection +} + +func (o *GetCollectionResponse) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *GetCollectionResponse) GetError() *CollectionError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/getdatasourceconfigrequest.go b/tests/mockserver/internal/sdk/models/components/getdatasourceconfigrequest.go new file mode 100644 index 00000000..61fa0d59 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdatasourceconfigrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetDatasourceConfigRequest - Describes the request body of the /getdatasourceconfig API call +type GetDatasourceConfigRequest struct { + // Datasource name for which config is needed. + Datasource string `json:"datasource"` +} + +func (o *GetDatasourceConfigRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} diff --git a/tests/mockserver/internal/sdk/models/components/getdlpreportresponse.go b/tests/mockserver/internal/sdk/models/components/getdlpreportresponse.go new file mode 100644 index 00000000..275dbf8c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdlpreportresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetDlpReportResponse struct { + // Full policy information that will be used for scans. + Report *DlpReport `json:"report,omitempty"` +} + +func (o *GetDlpReportResponse) GetReport() *DlpReport { + if o == nil { + return nil + } + return o.Report +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocpermissionsrequest.go b/tests/mockserver/internal/sdk/models/components/getdocpermissionsrequest.go new file mode 100644 index 00000000..05b37eac --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocpermissionsrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetDocPermissionsRequest struct { + // The Glean Document ID to retrieve permissions for. + DocumentID *string `json:"documentId,omitempty"` +} + +func (o *GetDocPermissionsRequest) GetDocumentID() *string { + if o == nil { + return nil + } + return o.DocumentID +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocpermissionsresponse.go b/tests/mockserver/internal/sdk/models/components/getdocpermissionsresponse.go new file mode 100644 index 00000000..8e244e14 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocpermissionsresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetDocPermissionsResponse struct { + // A list of emails of users who have access to the document. If the document is visible to all Glean users, a list with only a single value of 'VISIBLE_TO_ALL'. + AllowedUserEmails []string `json:"allowedUserEmails,omitempty"` +} + +func (o *GetDocPermissionsResponse) GetAllowedUserEmails() []string { + if o == nil { + return nil + } + return o.AllowedUserEmails +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentcountrequest.go b/tests/mockserver/internal/sdk/models/components/getdocumentcountrequest.go new file mode 100644 index 00000000..a0961331 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentcountrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetDocumentCountRequest - Describes the request body of the /getdocumentcount API call +type GetDocumentCountRequest struct { + // Datasource name for which document count is needed. + Datasource string `json:"datasource"` +} + +func (o *GetDocumentCountRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentcountresponse.go b/tests/mockserver/internal/sdk/models/components/getdocumentcountresponse.go new file mode 100644 index 00000000..1691776f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentcountresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetDocumentCountResponse - Describes the response body of the /getdocumentcount API call +type GetDocumentCountResponse struct { + // Number of documents corresponding to the specified custom datasource. + DocumentCount *int64 `json:"documentCount,omitempty"` +} + +func (o *GetDocumentCountResponse) GetDocumentCount() *int64 { + if o == nil { + return nil + } + return o.DocumentCount +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsrequest.go b/tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsrequest.go new file mode 100644 index 00000000..62e8ccc0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsrequest.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetDocumentsByFacetsRequest struct { + // Filter results to one or more datasources (e.g. gmail, slack). All results are returned if missing. + DatasourcesFilter []string `json:"datasourcesFilter,omitempty"` + // A list of facet filter sets that will be OR'ed together. An AND is assumed between different filters in each set. + FilterSets []FacetFilterSet `json:"filterSets"` + // Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + Cursor *string `json:"cursor,omitempty"` +} + +func (o *GetDocumentsByFacetsRequest) GetDatasourcesFilter() []string { + if o == nil { + return nil + } + return o.DatasourcesFilter +} + +func (o *GetDocumentsByFacetsRequest) GetFilterSets() []FacetFilterSet { + if o == nil { + return []FacetFilterSet{} + } + return o.FilterSets +} + +func (o *GetDocumentsByFacetsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsresponse.go b/tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsresponse.go new file mode 100644 index 00000000..74a0f90f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentsbyfacetsresponse.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetDocumentsByFacetsResponse struct { + // The document details, ordered by score. + Documents []Document `json:"documents,omitempty"` + // Whether more results are available. Use cursor to retrieve them. + HasMoreResults *bool `json:"hasMoreResults,omitempty"` + // Cursor that indicates the start of the next page of results. To be passed in "more" requests for this query. + Cursor *string `json:"cursor,omitempty"` +} + +func (o *GetDocumentsByFacetsResponse) GetDocuments() []Document { + if o == nil { + return nil + } + return o.Documents +} + +func (o *GetDocumentsByFacetsResponse) GetHasMoreResults() *bool { + if o == nil { + return nil + } + return o.HasMoreResults +} + +func (o *GetDocumentsByFacetsResponse) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentsrequest.go b/tests/mockserver/internal/sdk/models/components/getdocumentsrequest.go new file mode 100644 index 00000000..48c69211 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentsrequest.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type GetDocumentsRequestIncludeField string + +const ( + GetDocumentsRequestIncludeFieldLastViewedAt GetDocumentsRequestIncludeField = "LAST_VIEWED_AT" + GetDocumentsRequestIncludeFieldVisitorsCount GetDocumentsRequestIncludeField = "VISITORS_COUNT" + GetDocumentsRequestIncludeFieldRecentShares GetDocumentsRequestIncludeField = "RECENT_SHARES" + GetDocumentsRequestIncludeFieldDocumentContent GetDocumentsRequestIncludeField = "DOCUMENT_CONTENT" +) + +func (e GetDocumentsRequestIncludeField) ToPointer() *GetDocumentsRequestIncludeField { + return &e +} +func (e *GetDocumentsRequestIncludeField) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "LAST_VIEWED_AT": + fallthrough + case "VISITORS_COUNT": + fallthrough + case "RECENT_SHARES": + fallthrough + case "DOCUMENT_CONTENT": + *e = GetDocumentsRequestIncludeField(v) + return nil + default: + return fmt.Errorf("invalid value for GetDocumentsRequestIncludeField: %v", v) + } +} + +type GetDocumentsRequest struct { + // The specification for the documents to be retrieved. + DocumentSpecs []DocumentSpecUnion `json:"documentSpecs"` + // List of Document fields to return (that aren't returned by default) + IncludeFields []GetDocumentsRequestIncludeField `json:"includeFields,omitempty"` +} + +func (o *GetDocumentsRequest) GetDocumentSpecs() []DocumentSpecUnion { + if o == nil { + return []DocumentSpecUnion{} + } + return o.DocumentSpecs +} + +func (o *GetDocumentsRequest) GetIncludeFields() []GetDocumentsRequestIncludeField { + if o == nil { + return nil + } + return o.IncludeFields +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentsresponse.go b/tests/mockserver/internal/sdk/models/components/getdocumentsresponse.go new file mode 100644 index 00000000..f1940563 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentsresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetDocumentsResponse struct { + // The document details or the error if document is not found. + Documents map[string]DocumentOrErrorUnion `json:"documents,omitempty"` +} + +func (o *GetDocumentsResponse) GetDocuments() map[string]DocumentOrErrorUnion { + if o == nil { + return nil + } + return o.Documents +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentstatusrequest.go b/tests/mockserver/internal/sdk/models/components/getdocumentstatusrequest.go new file mode 100644 index 00000000..a16e6e72 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentstatusrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetDocumentStatusRequest - Describes the request body for /getdocumentstatus API call +type GetDocumentStatusRequest struct { + // Datasource to get fetch document status for + Datasource string `json:"datasource"` + // Object type of the document to get the status for + ObjectType string `json:"objectType"` + // Glean Document ID within the datasource to get the status for. + DocID string `json:"docId"` +} + +func (o *GetDocumentStatusRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *GetDocumentStatusRequest) GetObjectType() string { + if o == nil { + return "" + } + return o.ObjectType +} + +func (o *GetDocumentStatusRequest) GetDocID() string { + if o == nil { + return "" + } + return o.DocID +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentstatusresponse.go b/tests/mockserver/internal/sdk/models/components/getdocumentstatusresponse.go new file mode 100644 index 00000000..b87bd528 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentstatusresponse.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetDocumentStatusResponse - Describes the response body of the /getdocumentstatus API call +type GetDocumentStatusResponse struct { + // Upload status, enum of NOT_UPLOADED, UPLOADED, STATUS_UNKNOWN + UploadStatus *string `json:"uploadStatus,omitempty"` + // Time of last successful upload, in epoch seconds + LastUploadedAt *int64 `json:"lastUploadedAt,omitempty"` + // Indexing status, enum of NOT_INDEXED, INDEXED, STATUS_UNKNOWN + IndexingStatus *string `json:"indexingStatus,omitempty"` + // Time of last successful indexing, in epoch seconds + LastIndexedAt *int64 `json:"lastIndexedAt,omitempty"` +} + +func (o *GetDocumentStatusResponse) GetUploadStatus() *string { + if o == nil { + return nil + } + return o.UploadStatus +} + +func (o *GetDocumentStatusResponse) GetLastUploadedAt() *int64 { + if o == nil { + return nil + } + return o.LastUploadedAt +} + +func (o *GetDocumentStatusResponse) GetIndexingStatus() *string { + if o == nil { + return nil + } + return o.IndexingStatus +} + +func (o *GetDocumentStatusResponse) GetLastIndexedAt() *int64 { + if o == nil { + return nil + } + return o.LastIndexedAt +} diff --git a/tests/mockserver/internal/sdk/models/components/getdocumentvisibilityoverridesresponse.go b/tests/mockserver/internal/sdk/models/components/getdocumentvisibilityoverridesresponse.go new file mode 100644 index 00000000..5bd08e14 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getdocumentvisibilityoverridesresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetDocumentVisibilityOverridesResponse struct { + VisibilityOverrides []DocumentVisibilityOverride `json:"visibilityOverrides,omitempty"` +} + +func (o *GetDocumentVisibilityOverridesResponse) GetVisibilityOverrides() []DocumentVisibilityOverride { + if o == nil { + return nil + } + return o.VisibilityOverrides +} diff --git a/tests/mockserver/internal/sdk/models/components/getpinrequest.go b/tests/mockserver/internal/sdk/models/components/getpinrequest.go new file mode 100644 index 00000000..f126af9c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getpinrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetPinRequest struct { + // The opaque id of the pin to be fetched. + ID *string `json:"id,omitempty"` +} + +func (o *GetPinRequest) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/getpinresponse.go b/tests/mockserver/internal/sdk/models/components/getpinresponse.go new file mode 100644 index 00000000..e6eb59d7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getpinresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetPinResponse struct { + Pin *PinDocument `json:"pin,omitempty"` +} + +func (o *GetPinResponse) GetPin() *PinDocument { + if o == nil { + return nil + } + return o.Pin +} diff --git a/tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go b/tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go new file mode 100644 index 00000000..b3db7d31 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getshortcutrequestunion.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "errors" + "fmt" + "mockserver/internal/sdk/utils" +) + +type GetShortcutRequest struct { + // The alias for the shortcut, including any arguments for variable shortcuts. + Alias string `json:"alias"` +} + +func (o *GetShortcutRequest) GetAlias() string { + if o == nil { + return "" + } + return o.Alias +} + +type GetShortcutRequestUnionType string + +const ( + GetShortcutRequestUnionTypeUserGeneratedContentID GetShortcutRequestUnionType = "UserGeneratedContentId" + GetShortcutRequestUnionTypeGetShortcutRequest GetShortcutRequestUnionType = "GetShortcutRequest" +) + +type GetShortcutRequestUnion struct { + UserGeneratedContentID *UserGeneratedContentID `queryParam:"inline"` + GetShortcutRequest *GetShortcutRequest `queryParam:"inline"` + + Type GetShortcutRequestUnionType +} + +func CreateGetShortcutRequestUnionUserGeneratedContentID(userGeneratedContentID UserGeneratedContentID) GetShortcutRequestUnion { + typ := GetShortcutRequestUnionTypeUserGeneratedContentID + + return GetShortcutRequestUnion{ + UserGeneratedContentID: &userGeneratedContentID, + Type: typ, + } +} + +func CreateGetShortcutRequestUnionGetShortcutRequest(getShortcutRequest GetShortcutRequest) GetShortcutRequestUnion { + typ := GetShortcutRequestUnionTypeGetShortcutRequest + + return GetShortcutRequestUnion{ + GetShortcutRequest: &getShortcutRequest, + Type: typ, + } +} + +func (u *GetShortcutRequestUnion) UnmarshalJSON(data []byte) error { + + var userGeneratedContentID UserGeneratedContentID = UserGeneratedContentID{} + if err := utils.UnmarshalJSON(data, &userGeneratedContentID, "", true, true); err == nil { + u.UserGeneratedContentID = &userGeneratedContentID + u.Type = GetShortcutRequestUnionTypeUserGeneratedContentID + return nil + } + + var getShortcutRequest GetShortcutRequest = GetShortcutRequest{} + if err := utils.UnmarshalJSON(data, &getShortcutRequest, "", true, true); err == nil { + u.GetShortcutRequest = &getShortcutRequest + u.Type = GetShortcutRequestUnionTypeGetShortcutRequest + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for GetShortcutRequestUnion", string(data)) +} + +func (u GetShortcutRequestUnion) MarshalJSON() ([]byte, error) { + if u.UserGeneratedContentID != nil { + return utils.MarshalJSON(u.UserGeneratedContentID, "", true) + } + + if u.GetShortcutRequest != nil { + return utils.MarshalJSON(u.GetShortcutRequest, "", true) + } + + return nil, errors.New("could not marshal union type GetShortcutRequestUnion: all fields are null") +} diff --git a/tests/mockserver/internal/sdk/models/components/getshortcutresponse.go b/tests/mockserver/internal/sdk/models/components/getshortcutresponse.go new file mode 100644 index 00000000..4e6db38c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getshortcutresponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetShortcutResponse struct { + Shortcut *Shortcut `json:"shortcut,omitempty"` + Error *ShortcutError `json:"error,omitempty"` +} + +func (o *GetShortcutResponse) GetShortcut() *Shortcut { + if o == nil { + return nil + } + return o.Shortcut +} + +func (o *GetShortcutResponse) GetError() *ShortcutError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/getusercountrequest.go b/tests/mockserver/internal/sdk/models/components/getusercountrequest.go new file mode 100644 index 00000000..c86badbe --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getusercountrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetUserCountRequest - Describes the request body of the /getusercount API call +type GetUserCountRequest struct { + // Datasource name for which user count is needed. + Datasource string `json:"datasource"` +} + +func (o *GetUserCountRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} diff --git a/tests/mockserver/internal/sdk/models/components/getusercountresponse.go b/tests/mockserver/internal/sdk/models/components/getusercountresponse.go new file mode 100644 index 00000000..49761b93 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/getusercountresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetUserCountResponse - Describes the response body of the /getusercount API call +type GetUserCountResponse struct { + // Number of users corresponding to the specified custom datasource. + UserCount *int64 `json:"userCount,omitempty"` +} + +func (o *GetUserCountResponse) GetUserCount() *int64 { + if o == nil { + return nil + } + return o.UserCount +} diff --git a/tests/mockserver/internal/sdk/models/components/gleanassistinsightsresponse.go b/tests/mockserver/internal/sdk/models/components/gleanassistinsightsresponse.go new file mode 100644 index 00000000..9bc58150 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/gleanassistinsightsresponse.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GleanAssistInsightsResponse struct { + // Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). + LastLogTimestamp *int64 `json:"lastLogTimestamp,omitempty"` + // Insights for all active users with respect to set of actions. + ActivityInsights []UserActivityInsight `json:"activityInsights,omitempty"` + // Total number of active users in the requested period. + TotalActiveUsers *int64 `json:"totalActiveUsers,omitempty"` + // List of datasource instances for which glean assist is enabled. + DatasourceInstances []string `json:"datasourceInstances,omitempty"` + // List of departments applicable for users tab. + Departments []string `json:"departments,omitempty"` +} + +func (o *GleanAssistInsightsResponse) GetLastLogTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastLogTimestamp +} + +func (o *GleanAssistInsightsResponse) GetActivityInsights() []UserActivityInsight { + if o == nil { + return nil + } + return o.ActivityInsights +} + +func (o *GleanAssistInsightsResponse) GetTotalActiveUsers() *int64 { + if o == nil { + return nil + } + return o.TotalActiveUsers +} + +func (o *GleanAssistInsightsResponse) GetDatasourceInstances() []string { + if o == nil { + return nil + } + return o.DatasourceInstances +} + +func (o *GleanAssistInsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} diff --git a/tests/mockserver/internal/sdk/models/components/gleandataerror.go b/tests/mockserver/internal/sdk/models/components/gleandataerror.go new file mode 100644 index 00000000..12eecd2e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/gleandataerror.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GleanDataError struct { + // Indicates the gmail results could not be fetched due to bad token. + BadGmailToken *bool `json:"badGmailToken,omitempty"` + // Indicates the outlook results could not be fetched due to bad token. + BadOutlookToken *bool `json:"badOutlookToken,omitempty"` + // Indicates results could not be fetched due to invalid operators in the query. + InvalidOperators []InvalidOperatorValueError `json:"invalidOperators,omitempty"` + ErrorMessages []ErrorMessage `json:"errorMessages,omitempty"` +} + +func (o *GleanDataError) GetBadGmailToken() *bool { + if o == nil { + return nil + } + return o.BadGmailToken +} + +func (o *GleanDataError) GetBadOutlookToken() *bool { + if o == nil { + return nil + } + return o.BadOutlookToken +} + +func (o *GleanDataError) GetInvalidOperators() []InvalidOperatorValueError { + if o == nil { + return nil + } + return o.InvalidOperators +} + +func (o *GleanDataError) GetErrorMessages() []ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessages +} diff --git a/tests/mockserver/internal/sdk/models/components/grantpermission.go b/tests/mockserver/internal/sdk/models/components/grantpermission.go new file mode 100644 index 00000000..b7685b36 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/grantpermission.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GrantPermission - Describes the grant permission level that a user has for a specific feature +type GrantPermission struct { + // Describes the scope for a ReadPermission, WritePermission, or GrantPermission object + ScopeType *ScopeType `json:"scopeType,omitempty"` +} + +func (o *GrantPermission) GetScopeType() *ScopeType { + if o == nil { + return nil + } + return o.ScopeType +} diff --git a/tests/mockserver/internal/sdk/models/components/greenlistusersrequest.go b/tests/mockserver/internal/sdk/models/components/greenlistusersrequest.go new file mode 100644 index 00000000..7cfe20c0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/greenlistusersrequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GreenlistUsersRequest - Describes the request body of the /betausers API call +type GreenlistUsersRequest struct { + // Datasource which needs to be made visible to users specified in the `emails` field. + Datasource string `json:"datasource"` + // The emails of the beta users + Emails []string `json:"emails"` +} + +func (o *GreenlistUsersRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *GreenlistUsersRequest) GetEmails() []string { + if o == nil { + return []string{} + } + return o.Emails +} diff --git a/tests/mockserver/internal/sdk/models/components/group.go b/tests/mockserver/internal/sdk/models/components/group.go new file mode 100644 index 00000000..1b639d40 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/group.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Group struct { + // The type of user group + Type GroupType `json:"type"` + // A unique identifier for the group. May be the same as name. + ID string `json:"id"` + // Name of the group. + Name *string `json:"name,omitempty"` +} + +func (o *Group) GetType() GroupType { + if o == nil { + return GroupType("") + } + return o.Type +} + +func (o *Group) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Group) GetName() *string { + if o == nil { + return nil + } + return o.Name +} diff --git a/tests/mockserver/internal/sdk/models/components/grouptype.go b/tests/mockserver/internal/sdk/models/components/grouptype.go new file mode 100644 index 00000000..3f25f70b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/grouptype.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// GroupType - The type of user group +type GroupType string + +const ( + GroupTypeDepartment GroupType = "DEPARTMENT" + GroupTypeAll GroupType = "ALL" + GroupTypeTeam GroupType = "TEAM" + GroupTypeJobTitle GroupType = "JOB_TITLE" + GroupTypeRoleType GroupType = "ROLE_TYPE" + GroupTypeLocation GroupType = "LOCATION" + GroupTypeRegion GroupType = "REGION" + GroupTypeExternalGroup GroupType = "EXTERNAL_GROUP" +) + +func (e GroupType) ToPointer() *GroupType { + return &e +} +func (e *GroupType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DEPARTMENT": + fallthrough + case "ALL": + fallthrough + case "TEAM": + fallthrough + case "JOB_TITLE": + fallthrough + case "ROLE_TYPE": + fallthrough + case "LOCATION": + fallthrough + case "REGION": + fallthrough + case "EXTERNAL_GROUP": + *e = GroupType(v) + return nil + default: + return fmt.Errorf("invalid value for GroupType: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/hotword.go b/tests/mockserver/internal/sdk/models/components/hotword.go new file mode 100644 index 00000000..ed23ff8d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/hotword.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Hotword struct { + Regex *string `json:"regex,omitempty"` + Proximity *HotwordProximity `json:"proximity,omitempty"` +} + +func (o *Hotword) GetRegex() *string { + if o == nil { + return nil + } + return o.Regex +} + +func (o *Hotword) GetProximity() *HotwordProximity { + if o == nil { + return nil + } + return o.Proximity +} diff --git a/tests/mockserver/internal/sdk/models/components/hotwordproximity.go b/tests/mockserver/internal/sdk/models/components/hotwordproximity.go new file mode 100644 index 00000000..611b62d7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/hotwordproximity.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type HotwordProximity struct { + WindowBefore *int64 `json:"windowBefore,omitempty"` + WindowAfter *int64 `json:"windowAfter,omitempty"` +} + +func (o *HotwordProximity) GetWindowBefore() *int64 { + if o == nil { + return nil + } + return o.WindowBefore +} + +func (o *HotwordProximity) GetWindowAfter() *int64 { + if o == nil { + return nil + } + return o.WindowAfter +} diff --git a/tests/mockserver/internal/sdk/models/components/httpmetadata.go b/tests/mockserver/internal/sdk/models/components/httpmetadata.go new file mode 100644 index 00000000..e18bdc06 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/httpmetadata.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "net/http" +) + +type HTTPMetadata struct { + // Raw HTTP response; suitable for custom response parsing + Response *http.Response `json:"-"` + // Raw HTTP request; suitable for debugging + Request *http.Request `json:"-"` +} + +func (o *HTTPMetadata) GetResponse() *http.Response { + if o == nil { + return nil + } + return o.Response +} + +func (o *HTTPMetadata) GetRequest() *http.Request { + if o == nil { + return nil + } + return o.Request +} diff --git a/tests/mockserver/internal/sdk/models/components/iconconfig.go b/tests/mockserver/internal/sdk/models/components/iconconfig.go new file mode 100644 index 00000000..5f79d9dd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/iconconfig.go @@ -0,0 +1,138 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type IconType string + +const ( + IconTypeCollection IconType = "COLLECTION" + IconTypeCustom IconType = "CUSTOM" + IconTypeDatasource IconType = "DATASOURCE" + IconTypeDatasourceInstance IconType = "DATASOURCE_INSTANCE" + IconTypeFavicon IconType = "FAVICON" + IconTypeFileType IconType = "FILE_TYPE" + IconTypeGeneratedBackground IconType = "GENERATED_BACKGROUND" + IconTypeGlyph IconType = "GLYPH" + IconTypeMimeType IconType = "MIME_TYPE" + IconTypeNoIcon IconType = "NO_ICON" + IconTypePerson IconType = "PERSON" + IconTypeReactions IconType = "REACTIONS" + IconTypeURL IconType = "URL" +) + +func (e IconType) ToPointer() *IconType { + return &e +} +func (e *IconType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "COLLECTION": + fallthrough + case "CUSTOM": + fallthrough + case "DATASOURCE": + fallthrough + case "DATASOURCE_INSTANCE": + fallthrough + case "FAVICON": + fallthrough + case "FILE_TYPE": + fallthrough + case "GENERATED_BACKGROUND": + fallthrough + case "GLYPH": + fallthrough + case "MIME_TYPE": + fallthrough + case "NO_ICON": + fallthrough + case "PERSON": + fallthrough + case "REACTIONS": + fallthrough + case "URL": + *e = IconType(v) + return nil + default: + return fmt.Errorf("invalid value for IconType: %v", v) + } +} + +// IconConfig - Defines how to render an icon +type IconConfig struct { + GeneratedBackgroundColorKey *string `json:"generatedBackgroundColorKey,omitempty"` + BackgroundColor *string `json:"backgroundColor,omitempty"` + Color *string `json:"color,omitempty"` + Key *string `json:"key,omitempty"` + IconType *IconType `json:"iconType,omitempty"` + // Whether the icon should be masked based on current theme. + Masked *bool `json:"masked,omitempty"` + // The name of the icon if applicable, e.g. the glyph name for `IconType.GLYPH` icons. + Name *string `json:"name,omitempty"` + // The URL to an image to be displayed if applicable, e.g. the URL for `iconType.URL` icons. + URL *string `json:"url,omitempty"` +} + +func (o *IconConfig) GetGeneratedBackgroundColorKey() *string { + if o == nil { + return nil + } + return o.GeneratedBackgroundColorKey +} + +func (o *IconConfig) GetBackgroundColor() *string { + if o == nil { + return nil + } + return o.BackgroundColor +} + +func (o *IconConfig) GetColor() *string { + if o == nil { + return nil + } + return o.Color +} + +func (o *IconConfig) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *IconConfig) GetIconType() *IconType { + if o == nil { + return nil + } + return o.IconType +} + +func (o *IconConfig) GetMasked() *bool { + if o == nil { + return nil + } + return o.Masked +} + +func (o *IconConfig) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *IconConfig) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} diff --git a/tests/mockserver/internal/sdk/models/components/indexdocumentrequest.go b/tests/mockserver/internal/sdk/models/components/indexdocumentrequest.go new file mode 100644 index 00000000..86a60a70 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexdocumentrequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// IndexDocumentRequest - Describes the request body of the /indexdocument API call +type IndexDocumentRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // Indexable document structure + Document DocumentDefinition `json:"document"` +} + +func (o *IndexDocumentRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *IndexDocumentRequest) GetDocument() DocumentDefinition { + if o == nil { + return DocumentDefinition{} + } + return o.Document +} diff --git a/tests/mockserver/internal/sdk/models/components/indexdocumentsrequest.go b/tests/mockserver/internal/sdk/models/components/indexdocumentsrequest.go new file mode 100644 index 00000000..759eb8b7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexdocumentsrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// IndexDocumentsRequest - Describes the request body of the /indexdocuments API call +type IndexDocumentsRequest struct { + // Optional id parameter to identify and track a batch of documents. + UploadID *string `json:"uploadId,omitempty"` + // Datasource of the documents + Datasource string `json:"datasource"` + // Batch of documents being added/updated + Documents []DocumentDefinition `json:"documents"` +} + +func (o *IndexDocumentsRequest) GetUploadID() *string { + if o == nil { + return nil + } + return o.UploadID +} + +func (o *IndexDocumentsRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *IndexDocumentsRequest) GetDocuments() []DocumentDefinition { + if o == nil { + return []DocumentDefinition{} + } + return o.Documents +} diff --git a/tests/mockserver/internal/sdk/models/components/indexemployeerequest.go b/tests/mockserver/internal/sdk/models/components/indexemployeerequest.go new file mode 100644 index 00000000..8d08b0b7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexemployeerequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// IndexEmployeeRequest - Info about an employee and optional version for that info +type IndexEmployeeRequest struct { + // Describes employee info + Employee EmployeeInfoDefinition `json:"employee"` + // Version number for the employee object. If absent or 0 then no version checks are done + Version *int64 `json:"version,omitempty"` +} + +func (o *IndexEmployeeRequest) GetEmployee() EmployeeInfoDefinition { + if o == nil { + return EmployeeInfoDefinition{} + } + return o.Employee +} + +func (o *IndexEmployeeRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} diff --git a/tests/mockserver/internal/sdk/models/components/indexgrouprequest.go b/tests/mockserver/internal/sdk/models/components/indexgrouprequest.go new file mode 100644 index 00000000..acd400f6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexgrouprequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// IndexGroupRequest - Describes the request body of the /indexgroup API call +type IndexGroupRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // The datasource for which the group is added + Datasource string `json:"datasource"` + // describes a group in the datasource + Group DatasourceGroupDefinition `json:"group"` +} + +func (o *IndexGroupRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *IndexGroupRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *IndexGroupRequest) GetGroup() DatasourceGroupDefinition { + if o == nil { + return DatasourceGroupDefinition{} + } + return o.Group +} diff --git a/tests/mockserver/internal/sdk/models/components/indexingshortcut.go b/tests/mockserver/internal/sdk/models/components/indexingshortcut.go new file mode 100644 index 00000000..b7b7ca15 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexingshortcut.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type IndexingShortcut struct { + // link text following the viewPrefix as entered by the user. For example, if the view prefix is `go/` and the shortened URL is `go/abc`, then `abc` is the inputAlias. + InputAlias string `json:"inputAlias"` + // A short, plain text blurb to help people understand the intent of the shortcut. + Description *string `json:"description,omitempty"` + // destination URL for the shortcut. + DestinationURL string `json:"destinationUrl"` + // Email of the user who created this shortcut. + CreatedBy string `json:"createdBy"` + // The time the shortcut was created in epoch seconds. + CreateTime *int64 `json:"createTime,omitempty"` + // Email of the user who last updated this shortcut. + UpdatedBy *string `json:"updatedBy,omitempty"` + // The time the shortcut was updated in epoch seconds. + UpdateTime *int64 `json:"updateTime,omitempty"` + // Whether this shortcut is unlisted or not. Unlisted shortcuts are visible to author and admins only. + Unlisted *bool `json:"unlisted,omitempty"` + // For variable shortcuts, contains the URL template; note, `destinationUrl` contains default URL. + URLTemplate *string `json:"urlTemplate,omitempty"` +} + +func (o *IndexingShortcut) GetInputAlias() string { + if o == nil { + return "" + } + return o.InputAlias +} + +func (o *IndexingShortcut) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *IndexingShortcut) GetDestinationURL() string { + if o == nil { + return "" + } + return o.DestinationURL +} + +func (o *IndexingShortcut) GetCreatedBy() string { + if o == nil { + return "" + } + return o.CreatedBy +} + +func (o *IndexingShortcut) GetCreateTime() *int64 { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *IndexingShortcut) GetUpdatedBy() *string { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *IndexingShortcut) GetUpdateTime() *int64 { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *IndexingShortcut) GetUnlisted() *bool { + if o == nil { + return nil + } + return o.Unlisted +} + +func (o *IndexingShortcut) GetURLTemplate() *string { + if o == nil { + return nil + } + return o.URLTemplate +} diff --git a/tests/mockserver/internal/sdk/models/components/indexmembershiprequest.go b/tests/mockserver/internal/sdk/models/components/indexmembershiprequest.go new file mode 100644 index 00000000..e7b2a46c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexmembershiprequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// IndexMembershipRequest - Describes the request body of the /indexmembership API call +type IndexMembershipRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // The datasource for which the membership is added + Datasource string `json:"datasource"` + // describes the membership row of a group. Only one of memberUserId and memberGroupName can be specified. + Membership DatasourceMembershipDefinition `json:"membership"` +} + +func (o *IndexMembershipRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *IndexMembershipRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *IndexMembershipRequest) GetMembership() DatasourceMembershipDefinition { + if o == nil { + return DatasourceMembershipDefinition{} + } + return o.Membership +} diff --git a/tests/mockserver/internal/sdk/models/components/indexstatus.go b/tests/mockserver/internal/sdk/models/components/indexstatus.go new file mode 100644 index 00000000..23360275 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexstatus.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type IndexStatus struct { + // When the document was last crawled + LastCrawledTime *time.Time `json:"lastCrawledTime,omitempty"` + // When the document was last indexed + LastIndexedTime *time.Time `json:"lastIndexedTime,omitempty"` +} + +func (i IndexStatus) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *IndexStatus) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { + return err + } + return nil +} + +func (o *IndexStatus) GetLastCrawledTime() *time.Time { + if o == nil { + return nil + } + return o.LastCrawledTime +} + +func (o *IndexStatus) GetLastIndexedTime() *time.Time { + if o == nil { + return nil + } + return o.LastIndexedTime +} diff --git a/tests/mockserver/internal/sdk/models/components/indexteamrequest.go b/tests/mockserver/internal/sdk/models/components/indexteamrequest.go new file mode 100644 index 00000000..64f2b364 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexteamrequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// IndexTeamRequest - Info about a team and optional version for that info +type IndexTeamRequest struct { + // Information about an employee's team + Team TeamInfoDefinition `json:"team"` + // Version number for the team object. If absent or 0 then no version checks are done + Version *int64 `json:"version,omitempty"` +} + +func (o *IndexTeamRequest) GetTeam() TeamInfoDefinition { + if o == nil { + return TeamInfoDefinition{} + } + return o.Team +} + +func (o *IndexTeamRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} diff --git a/tests/mockserver/internal/sdk/models/components/indexuserrequest.go b/tests/mockserver/internal/sdk/models/components/indexuserrequest.go new file mode 100644 index 00000000..daf6de74 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/indexuserrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// IndexUserRequest - Describes the request body of the /indexuser API call +type IndexUserRequest struct { + // Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. + Version *int64 `json:"version,omitempty"` + // The datasource for which the user is added + Datasource string `json:"datasource"` + // describes a user in the datasource + User DatasourceUserDefinition `json:"user"` +} + +func (o *IndexUserRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +func (o *IndexUserRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *IndexUserRequest) GetUser() DatasourceUserDefinition { + if o == nil { + return DatasourceUserDefinition{} + } + return o.User +} diff --git a/tests/mockserver/internal/sdk/models/components/inputoptions.go b/tests/mockserver/internal/sdk/models/components/inputoptions.go new file mode 100644 index 00000000..51e07919 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/inputoptions.go @@ -0,0 +1,132 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DatasourcesType - The types of datasource for which to run the report/policy. +type DatasourcesType string + +const ( + DatasourcesTypeAll DatasourcesType = "ALL" + DatasourcesTypeCustom DatasourcesType = "CUSTOM" +) + +func (e DatasourcesType) ToPointer() *DatasourcesType { + return &e +} +func (e *DatasourcesType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ALL": + fallthrough + case "CUSTOM": + *e = DatasourcesType(v) + return nil + default: + return fmt.Errorf("invalid value for DatasourcesType: %v", v) + } +} + +// TimePeriodType - Type of time period for which to run the report/policy. PAST_DAY is deprecated. +type TimePeriodType string + +const ( + TimePeriodTypeAllTime TimePeriodType = "ALL_TIME" + TimePeriodTypePastYear TimePeriodType = "PAST_YEAR" + TimePeriodTypePastDay TimePeriodType = "PAST_DAY" + TimePeriodTypeCustom TimePeriodType = "CUSTOM" + TimePeriodTypeLastNDays TimePeriodType = "LAST_N_DAYS" +) + +func (e TimePeriodType) ToPointer() *TimePeriodType { + return &e +} +func (e *TimePeriodType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ALL_TIME": + fallthrough + case "PAST_YEAR": + fallthrough + case "PAST_DAY": + fallthrough + case "CUSTOM": + fallthrough + case "LAST_N_DAYS": + *e = TimePeriodType(v) + return nil + default: + return fmt.Errorf("invalid value for TimePeriodType: %v", v) + } +} + +// InputOptions - Controls which data-sources and what time-range to include in scans. +type InputOptions struct { + // list of url regex matching documents excluded from report + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + URLGreenlist []string `json:"urlGreenlist,omitempty"` + // The types of datasource for which to run the report/policy. + DatasourcesType *DatasourcesType `json:"datasourcesType,omitempty"` + // List of datasources to consider for report. DEPRECATED - use datasourceInstances instead. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Datasources []string `json:"datasources,omitempty"` + // List of datasource instances to consider for report/policy. + DatasourceInstances []string `json:"datasourceInstances,omitempty"` + // Type of time period for which to run the report/policy. PAST_DAY is deprecated. + TimePeriodType *TimePeriodType `json:"timePeriodType,omitempty"` + CustomTimeRange *TimeRange `json:"customTimeRange,omitempty"` +} + +func (o *InputOptions) GetURLGreenlist() []string { + if o == nil { + return nil + } + return o.URLGreenlist +} + +func (o *InputOptions) GetDatasourcesType() *DatasourcesType { + if o == nil { + return nil + } + return o.DatasourcesType +} + +func (o *InputOptions) GetDatasources() []string { + if o == nil { + return nil + } + return o.Datasources +} + +func (o *InputOptions) GetDatasourceInstances() []string { + if o == nil { + return nil + } + return o.DatasourceInstances +} + +func (o *InputOptions) GetTimePeriodType() *TimePeriodType { + if o == nil { + return nil + } + return o.TimePeriodType +} + +func (o *InputOptions) GetCustomTimeRange() *TimeRange { + if o == nil { + return nil + } + return o.CustomTimeRange +} diff --git a/tests/mockserver/internal/sdk/models/components/insightsagentsrequestoptions.go b/tests/mockserver/internal/sdk/models/components/insightsagentsrequestoptions.go new file mode 100644 index 00000000..6b825aec --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/insightsagentsrequestoptions.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type InsightsAgentsRequestOptions struct { + // IDs of the Agents for which Insights should be returned. An empty array signifies all. + AgentIds []string `json:"agentIds,omitempty"` +} + +func (o *InsightsAgentsRequestOptions) GetAgentIds() []string { + if o == nil { + return nil + } + return o.AgentIds +} diff --git a/tests/mockserver/internal/sdk/models/components/insightsaiapprequestoptions.go b/tests/mockserver/internal/sdk/models/components/insightsaiapprequestoptions.go new file mode 100644 index 00000000..7275316c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/insightsaiapprequestoptions.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type InsightsAiAppRequestOptions struct { + // IDs of the AI Apps for which Insights should be returned. An empty array signifies all. + AiAppIds []string `json:"aiAppIds,omitempty"` +} + +func (o *InsightsAiAppRequestOptions) GetAiAppIds() []string { + if o == nil { + return nil + } + return o.AiAppIds +} diff --git a/tests/mockserver/internal/sdk/models/components/insightsrequest.go b/tests/mockserver/internal/sdk/models/components/insightsrequest.go new file mode 100644 index 00000000..0cd7481b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/insightsrequest.go @@ -0,0 +1,156 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type InsightsRequestCategory string + +const ( + InsightsRequestCategoryAgents InsightsRequestCategory = "AGENTS" + InsightsRequestCategoryAi InsightsRequestCategory = "AI" + InsightsRequestCategoryAiApps InsightsRequestCategory = "AI_APPS" + InsightsRequestCategoryAnnouncements InsightsRequestCategory = "ANNOUNCEMENTS" + InsightsRequestCategoryAnswers InsightsRequestCategory = "ANSWERS" + InsightsRequestCategoryCollections InsightsRequestCategory = "COLLECTIONS" + InsightsRequestCategoryContent InsightsRequestCategory = "CONTENT" + InsightsRequestCategoryGleanAssist InsightsRequestCategory = "GLEAN_ASSIST" + InsightsRequestCategoryQueries InsightsRequestCategory = "QUERIES" + InsightsRequestCategoryShortcuts InsightsRequestCategory = "SHORTCUTS" + InsightsRequestCategoryUsers InsightsRequestCategory = "USERS" +) + +func (e InsightsRequestCategory) ToPointer() *InsightsRequestCategory { + return &e +} +func (e *InsightsRequestCategory) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "AGENTS": + fallthrough + case "AI": + fallthrough + case "AI_APPS": + fallthrough + case "ANNOUNCEMENTS": + fallthrough + case "ANSWERS": + fallthrough + case "COLLECTIONS": + fallthrough + case "CONTENT": + fallthrough + case "GLEAN_ASSIST": + fallthrough + case "QUERIES": + fallthrough + case "SHORTCUTS": + fallthrough + case "USERS": + *e = InsightsRequestCategory(v) + return nil + default: + return fmt.Errorf("invalid value for InsightsRequestCategory: %v", v) + } +} + +type AssistantActivityType string + +const ( + AssistantActivityTypeGleanChat AssistantActivityType = "GLEAN_CHAT" + AssistantActivityTypeAiSummary AssistantActivityType = "AI_SUMMARY" + AssistantActivityTypeAiAnswer AssistantActivityType = "AI_ANSWER" + AssistantActivityTypeGleanbotResponse AssistantActivityType = "GLEANBOT_RESPONSE" +) + +func (e AssistantActivityType) ToPointer() *AssistantActivityType { + return &e +} +func (e *AssistantActivityType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "GLEAN_CHAT": + fallthrough + case "AI_SUMMARY": + fallthrough + case "AI_ANSWER": + fallthrough + case "GLEANBOT_RESPONSE": + *e = AssistantActivityType(v) + return nil + default: + return fmt.Errorf("invalid value for AssistantActivityType: %v", v) + } +} + +type InsightsRequest struct { + // Categories of data requested. Request can include single or multiple types. + Categories []InsightsRequestCategory `json:"categories"` + // Departments that the data is requested for. If this is empty, corresponds to whole company. + Departments []string `json:"departments,omitempty"` + DayRange *Period `json:"dayRange,omitempty"` + AiAppRequestOptions *InsightsAiAppRequestOptions `json:"aiAppRequestOptions,omitempty"` + AgentsRequestOptions *InsightsAgentsRequestOptions `json:"agentsRequestOptions,omitempty"` + // Types of activity that should count in the definition of an Assistant Active User. Affects only insights for AI category. + AssistantActivityTypes []AssistantActivityType `json:"assistantActivityTypes,omitempty"` + // If true, suppresses the generation of per-user Insights in the response. Default is false. + DisablePerUserInsights *bool `json:"disablePerUserInsights,omitempty"` +} + +func (o *InsightsRequest) GetCategories() []InsightsRequestCategory { + if o == nil { + return []InsightsRequestCategory{} + } + return o.Categories +} + +func (o *InsightsRequest) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} + +func (o *InsightsRequest) GetDayRange() *Period { + if o == nil { + return nil + } + return o.DayRange +} + +func (o *InsightsRequest) GetAiAppRequestOptions() *InsightsAiAppRequestOptions { + if o == nil { + return nil + } + return o.AiAppRequestOptions +} + +func (o *InsightsRequest) GetAgentsRequestOptions() *InsightsAgentsRequestOptions { + if o == nil { + return nil + } + return o.AgentsRequestOptions +} + +func (o *InsightsRequest) GetAssistantActivityTypes() []AssistantActivityType { + if o == nil { + return nil + } + return o.AssistantActivityTypes +} + +func (o *InsightsRequest) GetDisablePerUserInsights() *bool { + if o == nil { + return nil + } + return o.DisablePerUserInsights +} diff --git a/tests/mockserver/internal/sdk/models/components/insightsresponse.go b/tests/mockserver/internal/sdk/models/components/insightsresponse.go new file mode 100644 index 00000000..fe65a737 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/insightsresponse.go @@ -0,0 +1,112 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type InsightsResponse struct { + // List of timeseries to make charts (if applicable). + Timeseries []LabeledCountInfo `json:"timeseries,omitempty"` + Users *UserInsightsResponse `json:"users,omitempty"` + Content *ContentInsightsResponse `json:"content,omitempty"` + Queries *QueryInsightsResponse `json:"queries,omitempty"` + Collections *ContentInsightsResponse `json:"collections,omitempty"` + CollectionsV2 *ContentInsightsResponse `json:"collectionsV2,omitempty"` + Shortcuts *ShortcutInsightsResponse `json:"shortcuts,omitempty"` + Announcements *ContentInsightsResponse `json:"announcements,omitempty"` + Answers *ContentInsightsResponse `json:"answers,omitempty"` + Ai *AiInsightsResponse `json:"ai,omitempty"` + AiApps *AiAppsInsightsResponse `json:"aiApps,omitempty"` + GleanAssist *GleanAssistInsightsResponse `json:"gleanAssist,omitempty"` + // list of all departments. + Departments []string `json:"departments,omitempty"` +} + +func (o *InsightsResponse) GetTimeseries() []LabeledCountInfo { + if o == nil { + return nil + } + return o.Timeseries +} + +func (o *InsightsResponse) GetUsers() *UserInsightsResponse { + if o == nil { + return nil + } + return o.Users +} + +func (o *InsightsResponse) GetContent() *ContentInsightsResponse { + if o == nil { + return nil + } + return o.Content +} + +func (o *InsightsResponse) GetQueries() *QueryInsightsResponse { + if o == nil { + return nil + } + return o.Queries +} + +func (o *InsightsResponse) GetCollections() *ContentInsightsResponse { + if o == nil { + return nil + } + return o.Collections +} + +func (o *InsightsResponse) GetCollectionsV2() *ContentInsightsResponse { + if o == nil { + return nil + } + return o.CollectionsV2 +} + +func (o *InsightsResponse) GetShortcuts() *ShortcutInsightsResponse { + if o == nil { + return nil + } + return o.Shortcuts +} + +func (o *InsightsResponse) GetAnnouncements() *ContentInsightsResponse { + if o == nil { + return nil + } + return o.Announcements +} + +func (o *InsightsResponse) GetAnswers() *ContentInsightsResponse { + if o == nil { + return nil + } + return o.Answers +} + +func (o *InsightsResponse) GetAi() *AiInsightsResponse { + if o == nil { + return nil + } + return o.Ai +} + +func (o *InsightsResponse) GetAiApps() *AiAppsInsightsResponse { + if o == nil { + return nil + } + return o.AiApps +} + +func (o *InsightsResponse) GetGleanAssist() *GleanAssistInsightsResponse { + if o == nil { + return nil + } + return o.GleanAssist +} + +func (o *InsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} diff --git a/tests/mockserver/internal/sdk/models/components/invalidoperatorvalueerror.go b/tests/mockserver/internal/sdk/models/components/invalidoperatorvalueerror.go new file mode 100644 index 00000000..a59e0100 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/invalidoperatorvalueerror.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type InvalidOperatorValueError struct { + // The operator key that has an invalid value. + Key *string `json:"key,omitempty"` + // The invalid operator value. + Value *string `json:"value,omitempty"` +} + +func (o *InvalidOperatorValueError) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *InvalidOperatorValueError) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} diff --git a/tests/mockserver/internal/sdk/models/components/inviteinfo.go b/tests/mockserver/internal/sdk/models/components/inviteinfo.go new file mode 100644 index 00000000..1a540ca9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/inviteinfo.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// InviteInfo - Information regarding the invite status of a person. +type InviteInfo struct { + // The time this person signed up in ISO format (ISO 8601). + SignUpTime *time.Time `json:"signUpTime,omitempty"` + // Latest invites received by the user for each channel + Invites []ChannelInviteInfo `json:"invites,omitempty"` + Inviter *Person `json:"inviter,omitempty"` + // The time this person was invited in ISO format (ISO 8601). + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + InviteTime *time.Time `json:"inviteTime,omitempty"` + // The time this person was reminded in ISO format (ISO 8601) if a reminder was sent. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + ReminderTime *time.Time `json:"reminderTime,omitempty"` +} + +func (i InviteInfo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *InviteInfo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { + return err + } + return nil +} + +func (o *InviteInfo) GetSignUpTime() *time.Time { + if o == nil { + return nil + } + return o.SignUpTime +} + +func (o *InviteInfo) GetInvites() []ChannelInviteInfo { + if o == nil { + return nil + } + return o.Invites +} + +func (o *InviteInfo) GetInviter() *Person { + if o == nil { + return nil + } + return o.Inviter +} + +func (o *InviteInfo) GetInviteTime() *time.Time { + if o == nil { + return nil + } + return o.InviteTime +} + +func (o *InviteInfo) GetReminderTime() *time.Time { + if o == nil { + return nil + } + return o.ReminderTime +} diff --git a/tests/mockserver/internal/sdk/models/components/labeledcountinfo.go b/tests/mockserver/internal/sdk/models/components/labeledcountinfo.go new file mode 100644 index 00000000..6ddd153c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/labeledcountinfo.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type LabeledCountInfo struct { + // Label for the included count information. + Label string `json:"label"` + // List of data points for counts for a given date period. + CountInfo []CountInfo `json:"countInfo,omitempty"` +} + +func (o *LabeledCountInfo) GetLabel() string { + if o == nil { + return "" + } + return o.Label +} + +func (o *LabeledCountInfo) GetCountInfo() []CountInfo { + if o == nil { + return nil + } + return o.CountInfo +} diff --git a/tests/mockserver/internal/sdk/models/components/listanswersrequest.go b/tests/mockserver/internal/sdk/models/components/listanswersrequest.go new file mode 100644 index 00000000..04f62de3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listanswersrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListAnswersRequest struct { + // The Answer Board Id to list answers on. + BoardID *int64 `json:"boardId,omitempty"` +} + +func (o *ListAnswersRequest) GetBoardID() *int64 { + if o == nil { + return nil + } + return o.BoardID +} diff --git a/tests/mockserver/internal/sdk/models/components/listanswersresponse.go b/tests/mockserver/internal/sdk/models/components/listanswersresponse.go new file mode 100644 index 00000000..fe8dd286 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listanswersresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListAnswersResponse struct { + // List of answers with tracking tokens. + AnswerResults []AnswerResult `json:"answerResults"` +} + +func (o *ListAnswersResponse) GetAnswerResults() []AnswerResult { + if o == nil { + return []AnswerResult{} + } + return o.AnswerResults +} diff --git a/tests/mockserver/internal/sdk/models/components/listchatsresponse.go b/tests/mockserver/internal/sdk/models/components/listchatsresponse.go new file mode 100644 index 00000000..9a646b6b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listchatsresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListChatsResponse struct { + ChatResults []ChatMetadataResult `json:"chatResults,omitempty"` +} + +func (o *ListChatsResponse) GetChatResults() []ChatMetadataResult { + if o == nil { + return nil + } + return o.ChatResults +} diff --git a/tests/mockserver/internal/sdk/models/components/listcollectionsrequest.go b/tests/mockserver/internal/sdk/models/components/listcollectionsrequest.go new file mode 100644 index 00000000..3dec9559 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listcollectionsrequest.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListCollectionsRequest struct { + // Whether to include the audience filters with the listed Collections. + IncludeAudience *bool `json:"includeAudience,omitempty"` + // Whether to include the editor roles with the listed Collections. + IncludeRoles *bool `json:"includeRoles,omitempty"` + // The datasource type this Collection can hold. + // ANSWERS - for Collections representing answer boards + AllowedDatasource *string `json:"allowedDatasource,omitempty"` +} + +func (o *ListCollectionsRequest) GetIncludeAudience() *bool { + if o == nil { + return nil + } + return o.IncludeAudience +} + +func (o *ListCollectionsRequest) GetIncludeRoles() *bool { + if o == nil { + return nil + } + return o.IncludeRoles +} + +func (o *ListCollectionsRequest) GetAllowedDatasource() *string { + if o == nil { + return nil + } + return o.AllowedDatasource +} diff --git a/tests/mockserver/internal/sdk/models/components/listcollectionsresponse.go b/tests/mockserver/internal/sdk/models/components/listcollectionsresponse.go new file mode 100644 index 00000000..77a9eaff --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listcollectionsresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListCollectionsResponse struct { + // List of all Collections, no Collection items are fetched. + Collections []Collection `json:"collections"` +} + +func (o *ListCollectionsResponse) GetCollections() []Collection { + if o == nil { + return []Collection{} + } + return o.Collections +} diff --git a/tests/mockserver/internal/sdk/models/components/listdlpreportsresponse.go b/tests/mockserver/internal/sdk/models/components/listdlpreportsresponse.go new file mode 100644 index 00000000..25f297b5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listdlpreportsresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListDlpReportsResponse struct { + Reports []DlpReport `json:"reports,omitempty"` +} + +func (o *ListDlpReportsResponse) GetReports() []DlpReport { + if o == nil { + return nil + } + return o.Reports +} diff --git a/tests/mockserver/internal/sdk/models/components/listentitiesrequest.go b/tests/mockserver/internal/sdk/models/components/listentitiesrequest.go new file mode 100644 index 00000000..9e5f76d4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listentitiesrequest.go @@ -0,0 +1,214 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +type ListEntitiesRequestEntityType string + +const ( + ListEntitiesRequestEntityTypePeople ListEntitiesRequestEntityType = "PEOPLE" + ListEntitiesRequestEntityTypeTeams ListEntitiesRequestEntityType = "TEAMS" + ListEntitiesRequestEntityTypeCustomEntities ListEntitiesRequestEntityType = "CUSTOM_ENTITIES" +) + +func (e ListEntitiesRequestEntityType) ToPointer() *ListEntitiesRequestEntityType { + return &e +} +func (e *ListEntitiesRequestEntityType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PEOPLE": + fallthrough + case "TEAMS": + fallthrough + case "CUSTOM_ENTITIES": + *e = ListEntitiesRequestEntityType(v) + return nil + default: + return fmt.Errorf("invalid value for ListEntitiesRequestEntityType: %v", v) + } +} + +type ListEntitiesRequestIncludeField string + +const ( + ListEntitiesRequestIncludeFieldPeople ListEntitiesRequestIncludeField = "PEOPLE" + ListEntitiesRequestIncludeFieldTeams ListEntitiesRequestIncludeField = "TEAMS" + ListEntitiesRequestIncludeFieldPeopleDistance ListEntitiesRequestIncludeField = "PEOPLE_DISTANCE" + ListEntitiesRequestIncludeFieldPermissions ListEntitiesRequestIncludeField = "PERMISSIONS" + ListEntitiesRequestIncludeFieldFacets ListEntitiesRequestIncludeField = "FACETS" + ListEntitiesRequestIncludeFieldInviteInfo ListEntitiesRequestIncludeField = "INVITE_INFO" + ListEntitiesRequestIncludeFieldLastExtensionUse ListEntitiesRequestIncludeField = "LAST_EXTENSION_USE" + ListEntitiesRequestIncludeFieldManagementDetails ListEntitiesRequestIncludeField = "MANAGEMENT_DETAILS" + ListEntitiesRequestIncludeFieldUnprocessedTeams ListEntitiesRequestIncludeField = "UNPROCESSED_TEAMS" +) + +func (e ListEntitiesRequestIncludeField) ToPointer() *ListEntitiesRequestIncludeField { + return &e +} +func (e *ListEntitiesRequestIncludeField) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PEOPLE": + fallthrough + case "TEAMS": + fallthrough + case "PEOPLE_DISTANCE": + fallthrough + case "PERMISSIONS": + fallthrough + case "FACETS": + fallthrough + case "INVITE_INFO": + fallthrough + case "LAST_EXTENSION_USE": + fallthrough + case "MANAGEMENT_DETAILS": + fallthrough + case "UNPROCESSED_TEAMS": + *e = ListEntitiesRequestIncludeField(v) + return nil + default: + return fmt.Errorf("invalid value for ListEntitiesRequestIncludeField: %v", v) + } +} + +// RequestType - The type of request being made. +type RequestType string + +const ( + RequestTypeStandard RequestType = "STANDARD" + RequestTypeFullDirectory RequestType = "FULL_DIRECTORY" +) + +func (e RequestType) ToPointer() *RequestType { + return &e +} +func (e *RequestType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "STANDARD": + fallthrough + case "FULL_DIRECTORY": + *e = RequestType(v) + return nil + default: + return fmt.Errorf("invalid value for RequestType: %v", v) + } +} + +type ListEntitiesRequest struct { + Filter []FacetFilter `json:"filter,omitempty"` + // Use EntitiesSortOrder enum for SortOptions.sortBy + Sort []SortOptions `json:"sort,omitempty"` + EntityType *ListEntitiesRequestEntityType `default:"PEOPLE" json:"entityType"` + // The datasource associated with the entity type, most commonly used with CUSTOM_ENTITIES + Datasource *string `json:"datasource,omitempty"` + // A query string to search for entities that each entity in the response must conform to. An empty query does not filter any entities. + Query *string `json:"query,omitempty"` + // List of entity fields to return (that aren't returned by default) + IncludeFields []ListEntitiesRequestIncludeField `json:"includeFields,omitempty"` + // Hint to the server about how many results to send back. Server may return less. + PageSize *int64 `json:"pageSize,omitempty"` + // Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + Cursor *string `json:"cursor,omitempty"` + // A string denoting the search surface from which the endpoint is called. + Source *string `json:"source,omitempty"` + // The type of request being made. + RequestType *RequestType `default:"STANDARD" json:"requestType"` +} + +func (l ListEntitiesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListEntitiesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListEntitiesRequest) GetFilter() []FacetFilter { + if o == nil { + return nil + } + return o.Filter +} + +func (o *ListEntitiesRequest) GetSort() []SortOptions { + if o == nil { + return nil + } + return o.Sort +} + +func (o *ListEntitiesRequest) GetEntityType() *ListEntitiesRequestEntityType { + if o == nil { + return nil + } + return o.EntityType +} + +func (o *ListEntitiesRequest) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *ListEntitiesRequest) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +func (o *ListEntitiesRequest) GetIncludeFields() []ListEntitiesRequestIncludeField { + if o == nil { + return nil + } + return o.IncludeFields +} + +func (o *ListEntitiesRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ListEntitiesRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListEntitiesRequest) GetSource() *string { + if o == nil { + return nil + } + return o.Source +} + +func (o *ListEntitiesRequest) GetRequestType() *RequestType { + if o == nil { + return nil + } + return o.RequestType +} diff --git a/tests/mockserver/internal/sdk/models/components/listentitiesresponse.go b/tests/mockserver/internal/sdk/models/components/listentitiesresponse.go new file mode 100644 index 00000000..fdfcc5a4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listentitiesresponse.go @@ -0,0 +1,83 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListEntitiesResponse struct { + Results []Person `json:"results,omitempty"` + TeamResults []Team `json:"teamResults,omitempty"` + CustomEntityResults []CustomEntity `json:"customEntityResults,omitempty"` + FacetResults []FacetResult `json:"facetResults,omitempty"` + // Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + Cursor *string `json:"cursor,omitempty"` + // The total number of entities available + TotalCount *int64 `json:"totalCount,omitempty"` + // Whether or not more entities can be fetched. + HasMoreResults *bool `json:"hasMoreResults,omitempty"` + // Sort options from EntitiesSortOrder supported for this response. Default is empty list. + SortOptions []EntitiesSortOrder `json:"sortOptions,omitempty"` + // list of Person attributes that are custom setup by deployment + CustomFacetNames []string `json:"customFacetNames,omitempty"` +} + +func (o *ListEntitiesResponse) GetResults() []Person { + if o == nil { + return nil + } + return o.Results +} + +func (o *ListEntitiesResponse) GetTeamResults() []Team { + if o == nil { + return nil + } + return o.TeamResults +} + +func (o *ListEntitiesResponse) GetCustomEntityResults() []CustomEntity { + if o == nil { + return nil + } + return o.CustomEntityResults +} + +func (o *ListEntitiesResponse) GetFacetResults() []FacetResult { + if o == nil { + return nil + } + return o.FacetResults +} + +func (o *ListEntitiesResponse) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListEntitiesResponse) GetTotalCount() *int64 { + if o == nil { + return nil + } + return o.TotalCount +} + +func (o *ListEntitiesResponse) GetHasMoreResults() *bool { + if o == nil { + return nil + } + return o.HasMoreResults +} + +func (o *ListEntitiesResponse) GetSortOptions() []EntitiesSortOrder { + if o == nil { + return nil + } + return o.SortOptions +} + +func (o *ListEntitiesResponse) GetCustomFacetNames() []string { + if o == nil { + return nil + } + return o.CustomFacetNames +} diff --git a/tests/mockserver/internal/sdk/models/components/listpinsresponse.go b/tests/mockserver/internal/sdk/models/components/listpinsresponse.go new file mode 100644 index 00000000..cbf8b276 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listpinsresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListPinsResponse struct { + // List of pinned documents. + Pins []PinDocument `json:"pins"` +} + +func (o *ListPinsResponse) GetPins() []PinDocument { + if o == nil { + return []PinDocument{} + } + return o.Pins +} diff --git a/tests/mockserver/internal/sdk/models/components/listshortcutspaginatedrequest.go b/tests/mockserver/internal/sdk/models/components/listshortcutspaginatedrequest.go new file mode 100644 index 00000000..40562b5b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listshortcutspaginatedrequest.go @@ -0,0 +1,89 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type ListShortcutsPaginatedRequestIncludeField string + +const ( + ListShortcutsPaginatedRequestIncludeFieldFacets ListShortcutsPaginatedRequestIncludeField = "FACETS" + ListShortcutsPaginatedRequestIncludeFieldPeopleDetails ListShortcutsPaginatedRequestIncludeField = "PEOPLE_DETAILS" +) + +func (e ListShortcutsPaginatedRequestIncludeField) ToPointer() *ListShortcutsPaginatedRequestIncludeField { + return &e +} +func (e *ListShortcutsPaginatedRequestIncludeField) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "FACETS": + fallthrough + case "PEOPLE_DETAILS": + *e = ListShortcutsPaginatedRequestIncludeField(v) + return nil + default: + return fmt.Errorf("invalid value for ListShortcutsPaginatedRequestIncludeField: %v", v) + } +} + +type ListShortcutsPaginatedRequest struct { + // Array of fields/data to be included in response that are not included by default + IncludeFields []ListShortcutsPaginatedRequestIncludeField `json:"includeFields,omitempty"` + PageSize int64 `json:"pageSize"` + // A token specifying the position in the overall results to start at. Received from the endpoint and iterated back. Currently being used as page no (as we implement offset pagination) + Cursor *string `json:"cursor,omitempty"` + // A list of filters for the query. An AND is assumed between different filters. We support filters on Go Link name, author, department and type. + Filters []FacetFilter `json:"filters,omitempty"` + Sort *SortOptions `json:"sort,omitempty"` + // Search query that should be a substring in atleast one of the fields (alias , inputAlias, destinationUrl, description). Empty query does not filter shortcuts. + Query *string `json:"query,omitempty"` +} + +func (o *ListShortcutsPaginatedRequest) GetIncludeFields() []ListShortcutsPaginatedRequestIncludeField { + if o == nil { + return nil + } + return o.IncludeFields +} + +func (o *ListShortcutsPaginatedRequest) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *ListShortcutsPaginatedRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ListShortcutsPaginatedRequest) GetFilters() []FacetFilter { + if o == nil { + return nil + } + return o.Filters +} + +func (o *ListShortcutsPaginatedRequest) GetSort() *SortOptions { + if o == nil { + return nil + } + return o.Sort +} + +func (o *ListShortcutsPaginatedRequest) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} diff --git a/tests/mockserver/internal/sdk/models/components/listshortcutspaginatedresponse.go b/tests/mockserver/internal/sdk/models/components/listshortcutspaginatedresponse.go new file mode 100644 index 00000000..49944966 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/listshortcutspaginatedresponse.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListShortcutsPaginatedResponse struct { + // List of all shortcuts accessible to the user + Shortcuts []Shortcut `json:"shortcuts"` + FacetResults []FacetResult `json:"facetResults,omitempty"` + Meta ShortcutsPaginationMetadata `json:"meta"` +} + +func (o *ListShortcutsPaginatedResponse) GetShortcuts() []Shortcut { + if o == nil { + return []Shortcut{} + } + return o.Shortcuts +} + +func (o *ListShortcutsPaginatedResponse) GetFacetResults() []FacetResult { + if o == nil { + return nil + } + return o.FacetResults +} + +func (o *ListShortcutsPaginatedResponse) GetMeta() ShortcutsPaginationMetadata { + if o == nil { + return ShortcutsPaginationMetadata{} + } + return o.Meta +} diff --git a/tests/mockserver/internal/sdk/models/components/manualfeedbackinfo.go b/tests/mockserver/internal/sdk/models/components/manualfeedbackinfo.go new file mode 100644 index 00000000..26a64603 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/manualfeedbackinfo.go @@ -0,0 +1,324 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ManualFeedbackInfoSource - The source associated with the Feedback.event.MANUAL_FEEDBACK event. +type ManualFeedbackInfoSource string + +const ( + ManualFeedbackInfoSourceAutocomplete ManualFeedbackInfoSource = "AUTOCOMPLETE" + ManualFeedbackInfoSourceCalendar ManualFeedbackInfoSource = "CALENDAR" + ManualFeedbackInfoSourceChat ManualFeedbackInfoSource = "CHAT" + ManualFeedbackInfoSourceChatGeneral ManualFeedbackInfoSource = "CHAT_GENERAL" + ManualFeedbackInfoSourceConceptCard ManualFeedbackInfoSource = "CONCEPT_CARD" + ManualFeedbackInfoSourceDesktopApp ManualFeedbackInfoSource = "DESKTOP_APP" + ManualFeedbackInfoSourceDisambiguationCard ManualFeedbackInfoSource = "DISAMBIGUATION_CARD" + ManualFeedbackInfoSourceExpertDetection ManualFeedbackInfoSource = "EXPERT_DETECTION" + ManualFeedbackInfoSourceFeed ManualFeedbackInfoSource = "FEED" + ManualFeedbackInfoSourceGeneratedQAndA ManualFeedbackInfoSource = "GENERATED_Q_AND_A" + ManualFeedbackInfoSourceInlineMenu ManualFeedbackInfoSource = "INLINE_MENU" + ManualFeedbackInfoSourceNativeResult ManualFeedbackInfoSource = "NATIVE_RESULT" + ManualFeedbackInfoSourceQAndA ManualFeedbackInfoSource = "Q_AND_A" + ManualFeedbackInfoSourceRelatedQuestions ManualFeedbackInfoSource = "RELATED_QUESTIONS" + ManualFeedbackInfoSourceReportIssue ManualFeedbackInfoSource = "REPORT_ISSUE" + ManualFeedbackInfoSourceSciobot ManualFeedbackInfoSource = "SCIOBOT" + ManualFeedbackInfoSourceSearch ManualFeedbackInfoSource = "SEARCH" + ManualFeedbackInfoSourceSidebar ManualFeedbackInfoSource = "SIDEBAR" + ManualFeedbackInfoSourceSummary ManualFeedbackInfoSource = "SUMMARY" +) + +func (e ManualFeedbackInfoSource) ToPointer() *ManualFeedbackInfoSource { + return &e +} +func (e *ManualFeedbackInfoSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "AUTOCOMPLETE": + fallthrough + case "CALENDAR": + fallthrough + case "CHAT": + fallthrough + case "CHAT_GENERAL": + fallthrough + case "CONCEPT_CARD": + fallthrough + case "DESKTOP_APP": + fallthrough + case "DISAMBIGUATION_CARD": + fallthrough + case "EXPERT_DETECTION": + fallthrough + case "FEED": + fallthrough + case "GENERATED_Q_AND_A": + fallthrough + case "INLINE_MENU": + fallthrough + case "NATIVE_RESULT": + fallthrough + case "Q_AND_A": + fallthrough + case "RELATED_QUESTIONS": + fallthrough + case "REPORT_ISSUE": + fallthrough + case "SCIOBOT": + fallthrough + case "SEARCH": + fallthrough + case "SIDEBAR": + fallthrough + case "SUMMARY": + *e = ManualFeedbackInfoSource(v) + return nil + default: + return fmt.Errorf("invalid value for ManualFeedbackInfoSource: %v", v) + } +} + +type Issue string + +const ( + IssueInaccurateResponse Issue = "INACCURATE_RESPONSE" + IssueIncompleteOrNoAnswer Issue = "INCOMPLETE_OR_NO_ANSWER" + IssueIncorrectCitation Issue = "INCORRECT_CITATION" + IssueMissingCitation Issue = "MISSING_CITATION" + IssueOther Issue = "OTHER" + IssueOutdatedResponse Issue = "OUTDATED_RESPONSE" + IssueResultMissing Issue = "RESULT_MISSING" + IssueResultShouldNotAppear Issue = "RESULT_SHOULD_NOT_APPEAR" + IssueResultsHelpful Issue = "RESULTS_HELPFUL" + IssueResultsPoorOrder Issue = "RESULTS_POOR_ORDER" + IssueTooMuchOneKind Issue = "TOO_MUCH_ONE_KIND" +) + +func (e Issue) ToPointer() *Issue { + return &e +} +func (e *Issue) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "INACCURATE_RESPONSE": + fallthrough + case "INCOMPLETE_OR_NO_ANSWER": + fallthrough + case "INCORRECT_CITATION": + fallthrough + case "MISSING_CITATION": + fallthrough + case "OTHER": + fallthrough + case "OUTDATED_RESPONSE": + fallthrough + case "RESULT_MISSING": + fallthrough + case "RESULT_SHOULD_NOT_APPEAR": + fallthrough + case "RESULTS_HELPFUL": + fallthrough + case "RESULTS_POOR_ORDER": + fallthrough + case "TOO_MUCH_ONE_KIND": + *e = Issue(v) + return nil + default: + return fmt.Errorf("invalid value for Issue: %v", v) + } +} + +// Vote - The vote associated with the Feedback.event.MANUAL_FEEDBACK event. +type Vote string + +const ( + VoteUpvote Vote = "UPVOTE" + VoteDownvote Vote = "DOWNVOTE" +) + +func (e Vote) ToPointer() *Vote { + return &e +} +func (e *Vote) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UPVOTE": + fallthrough + case "DOWNVOTE": + *e = Vote(v) + return nil + default: + return fmt.Errorf("invalid value for Vote: %v", v) + } +} + +type ManualFeedbackInfo struct { + // The email address of the user who submitted the Feedback.event.MANUAL_FEEDBACK event. + Email *string `json:"email,omitempty"` + // The source associated with the Feedback.event.MANUAL_FEEDBACK event. + Source *ManualFeedbackInfoSource `json:"source,omitempty"` + // The issue the user indicated in the feedback. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Issue *string `json:"issue,omitempty"` + // The issue(s) the user indicated in the feedback. + Issues []Issue `json:"issues,omitempty"` + // URLs of images uploaded by user when providing feedback + ImageUrls []string `json:"imageUrls,omitempty"` + // The query associated with the Feedback.event.MANUAL_FEEDBACK event. + Query *string `json:"query,omitempty"` + // The query associated with the Feedback.event.MANUAL_FEEDBACK event, but obscured such that the vowels are replaced with special characters. For search feedback events only. + ObscuredQuery *string `json:"obscuredQuery,omitempty"` + // Which tabs the user had chosen at the time of the Feedback.event.MANUAL_FEEDBACK event. For search feedback events only. + ActiveTab *string `json:"activeTab,omitempty"` + // The comments users can optionally add to the Feedback.event.MANUAL_FEEDBACK events. + Comments *string `json:"comments,omitempty"` + // The array of search result Glean Document IDs, ordered by top to bottom result. + SearchResults []string `json:"searchResults,omitempty"` + // The array of previous messages in a chat session, ordered by oldest to newest. + PreviousMessages []string `json:"previousMessages,omitempty"` + // Array of previous request/response exchanges, ordered by oldest to newest. + ChatTranscript []FeedbackChatExchange `json:"chatTranscript,omitempty"` + // How many times this query has been run in the past. + NumQueriesFromFirstRun *int64 `json:"numQueriesFromFirstRun,omitempty"` + // The vote associated with the Feedback.event.MANUAL_FEEDBACK event. + Vote *Vote `json:"vote,omitempty"` + // A rating associated with the user feedback. The value will be between one and the maximum given by ratingScale, inclusive. + Rating *int64 `json:"rating,omitempty"` + // A description of the rating that contextualizes how it appeared to the user, e.g. "satisfied". + RatingKey *string `json:"ratingKey,omitempty"` + // The scale of comparison for a rating associated with the feedback. Rating values start from one and go up to the maximum specified by ratingScale. For example, a five-option satisfaction rating will have a ratingScale of 5 and a thumbs-up/thumbs-down rating will have a ratingScale of 2. + RatingScale *int64 `json:"ratingScale,omitempty"` +} + +func (o *ManualFeedbackInfo) GetEmail() *string { + if o == nil { + return nil + } + return o.Email +} + +func (o *ManualFeedbackInfo) GetSource() *ManualFeedbackInfoSource { + if o == nil { + return nil + } + return o.Source +} + +func (o *ManualFeedbackInfo) GetIssue() *string { + if o == nil { + return nil + } + return o.Issue +} + +func (o *ManualFeedbackInfo) GetIssues() []Issue { + if o == nil { + return nil + } + return o.Issues +} + +func (o *ManualFeedbackInfo) GetImageUrls() []string { + if o == nil { + return nil + } + return o.ImageUrls +} + +func (o *ManualFeedbackInfo) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +func (o *ManualFeedbackInfo) GetObscuredQuery() *string { + if o == nil { + return nil + } + return o.ObscuredQuery +} + +func (o *ManualFeedbackInfo) GetActiveTab() *string { + if o == nil { + return nil + } + return o.ActiveTab +} + +func (o *ManualFeedbackInfo) GetComments() *string { + if o == nil { + return nil + } + return o.Comments +} + +func (o *ManualFeedbackInfo) GetSearchResults() []string { + if o == nil { + return nil + } + return o.SearchResults +} + +func (o *ManualFeedbackInfo) GetPreviousMessages() []string { + if o == nil { + return nil + } + return o.PreviousMessages +} + +func (o *ManualFeedbackInfo) GetChatTranscript() []FeedbackChatExchange { + if o == nil { + return nil + } + return o.ChatTranscript +} + +func (o *ManualFeedbackInfo) GetNumQueriesFromFirstRun() *int64 { + if o == nil { + return nil + } + return o.NumQueriesFromFirstRun +} + +func (o *ManualFeedbackInfo) GetVote() *Vote { + if o == nil { + return nil + } + return o.Vote +} + +func (o *ManualFeedbackInfo) GetRating() *int64 { + if o == nil { + return nil + } + return o.Rating +} + +func (o *ManualFeedbackInfo) GetRatingKey() *string { + if o == nil { + return nil + } + return o.RatingKey +} + +func (o *ManualFeedbackInfo) GetRatingScale() *int64 { + if o == nil { + return nil + } + return o.RatingScale +} diff --git a/tests/mockserver/internal/sdk/models/components/meeting.go b/tests/mockserver/internal/sdk/models/components/meeting.go new file mode 100644 index 00000000..7f1bd14d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/meeting.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type Meeting struct { + ID *string `json:"id,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + URL *string `json:"url,omitempty"` + StartTime *time.Time `json:"startTime,omitempty"` + EndTime *time.Time `json:"endTime,omitempty"` + Attendees *CalendarAttendees `json:"attendees,omitempty"` +} + +func (m Meeting) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *Meeting) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Meeting) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Meeting) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Meeting) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *Meeting) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *Meeting) GetStartTime() *time.Time { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *Meeting) GetEndTime() *time.Time { + if o == nil { + return nil + } + return o.EndTime +} + +func (o *Meeting) GetAttendees() *CalendarAttendees { + if o == nil { + return nil + } + return o.Attendees +} diff --git a/tests/mockserver/internal/sdk/models/components/message.go b/tests/mockserver/internal/sdk/models/components/message.go new file mode 100644 index 00000000..5972aa33 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/message.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type MessageTextBlock struct { + Text string `json:"text"` + Type ContentType `json:"type"` +} + +func (o *MessageTextBlock) GetText() string { + if o == nil { + return "" + } + return o.Text +} + +func (o *MessageTextBlock) GetType() ContentType { + if o == nil { + return ContentType("") + } + return o.Type +} + +type Message struct { + // The role of the message. + Role *string `json:"role,omitempty"` + // The content of the message. + Content []MessageTextBlock `json:"content,omitempty"` +} + +func (o *Message) GetRole() *string { + if o == nil { + return nil + } + return o.Role +} + +func (o *Message) GetContent() []MessageTextBlock { + if o == nil { + return nil + } + return o.Content +} diff --git a/tests/mockserver/internal/sdk/models/components/messagesrequest.go b/tests/mockserver/internal/sdk/models/components/messagesrequest.go new file mode 100644 index 00000000..e7c80836 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/messagesrequest.go @@ -0,0 +1,170 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// IDType - Type of the id in the incoming request. +type IDType string + +const ( + IDTypeChannelName IDType = "CHANNEL_NAME" + IDTypeThreadID IDType = "THREAD_ID" + IDTypeConversationID IDType = "CONVERSATION_ID" +) + +func (e IDType) ToPointer() *IDType { + return &e +} +func (e *IDType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "CHANNEL_NAME": + fallthrough + case "THREAD_ID": + fallthrough + case "CONVERSATION_ID": + *e = IDType(v) + return nil + default: + return fmt.Errorf("invalid value for IDType: %v", v) + } +} + +// Direction - The direction of the results asked with respect to the reference timestamp. Missing field defaults to OLDER. Only applicable when using a message_id. +type Direction string + +const ( + DirectionOlder Direction = "OLDER" + DirectionNewer Direction = "NEWER" +) + +func (e Direction) ToPointer() *Direction { + return &e +} +func (e *Direction) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "OLDER": + fallthrough + case "NEWER": + *e = Direction(v) + return nil + default: + return fmt.Errorf("invalid value for Direction: %v", v) + } +} + +// Datasource - The type of the data source. Missing field defaults to SLACK. +type Datasource string + +const ( + DatasourceSlack Datasource = "SLACK" + DatasourceMicrosoftteams Datasource = "MICROSOFTTEAMS" + DatasourceFacebookworkplace Datasource = "FACEBOOKWORKPLACE" +) + +func (e Datasource) ToPointer() *Datasource { + return &e +} +func (e *Datasource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "SLACK": + fallthrough + case "MICROSOFTTEAMS": + fallthrough + case "FACEBOOKWORKPLACE": + *e = Datasource(v) + return nil + default: + return fmt.Errorf("invalid value for Datasource: %v", v) + } +} + +type MessagesRequest struct { + // Type of the id in the incoming request. + IDType IDType `json:"idType"` + // ID corresponding to the requested idType. Note that channel and threads are represented by the underlying datasource's ID and conversations are represented by their document's ID. + ID string `json:"id"` + // Id for the for the workspace in case of multiple workspaces. + WorkspaceID *string `json:"workspaceId,omitempty"` + // The direction of the results asked with respect to the reference timestamp. Missing field defaults to OLDER. Only applicable when using a message_id. + Direction *Direction `json:"direction,omitempty"` + // Timestamp in millis of the reference message. Only applicable when using a message_id. + TimestampMillis *int64 `json:"timestampMillis,omitempty"` + // Whether to include root message in response. + IncludeRootMessage *bool `json:"includeRootMessage,omitempty"` + // The type of the data source. Missing field defaults to SLACK. + Datasource *Datasource `json:"datasource,omitempty"` + // The datasource instance display name from which the document was extracted. This is used for appinstance facet filter for datasources that support multiple instances. + DatasourceInstanceDisplayName *string `json:"datasourceInstanceDisplayName,omitempty"` +} + +func (o *MessagesRequest) GetIDType() IDType { + if o == nil { + return IDType("") + } + return o.IDType +} + +func (o *MessagesRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *MessagesRequest) GetWorkspaceID() *string { + if o == nil { + return nil + } + return o.WorkspaceID +} + +func (o *MessagesRequest) GetDirection() *Direction { + if o == nil { + return nil + } + return o.Direction +} + +func (o *MessagesRequest) GetTimestampMillis() *int64 { + if o == nil { + return nil + } + return o.TimestampMillis +} + +func (o *MessagesRequest) GetIncludeRootMessage() *bool { + if o == nil { + return nil + } + return o.IncludeRootMessage +} + +func (o *MessagesRequest) GetDatasource() *Datasource { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *MessagesRequest) GetDatasourceInstanceDisplayName() *string { + if o == nil { + return nil + } + return o.DatasourceInstanceDisplayName +} diff --git a/tests/mockserver/internal/sdk/models/components/messagesresponse.go b/tests/mockserver/internal/sdk/models/components/messagesresponse.go new file mode 100644 index 00000000..6d8bb063 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/messagesresponse.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type MessagesResponse struct { + // Whether there are more results for client to continue requesting. + HasMore bool `json:"hasMore"` + SearchResponse *SearchResponse `json:"searchResponse,omitempty"` + RootMessage *SearchResult `json:"rootMessage,omitempty"` +} + +func (o *MessagesResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *MessagesResponse) GetSearchResponse() *SearchResponse { + if o == nil { + return nil + } + return o.SearchResponse +} + +func (o *MessagesResponse) GetRootMessage() *SearchResult { + if o == nil { + return nil + } + return o.RootMessage +} diff --git a/tests/mockserver/internal/sdk/models/components/objectdefinition.go b/tests/mockserver/internal/sdk/models/components/objectdefinition.go new file mode 100644 index 00000000..4c33e759 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/objectdefinition.go @@ -0,0 +1,137 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DocCategory - The document category of this object type. +type DocCategory string + +const ( + DocCategoryUncategorized DocCategory = "UNCATEGORIZED" + DocCategoryTickets DocCategory = "TICKETS" + DocCategoryCrm DocCategory = "CRM" + DocCategoryPublishedContent DocCategory = "PUBLISHED_CONTENT" + DocCategoryCollaborativeContent DocCategory = "COLLABORATIVE_CONTENT" + DocCategoryQuestionAnswer DocCategory = "QUESTION_ANSWER" + DocCategoryMessaging DocCategory = "MESSAGING" + DocCategoryCodeRepository DocCategory = "CODE_REPOSITORY" + DocCategoryChangeManagement DocCategory = "CHANGE_MANAGEMENT" + DocCategoryPeople DocCategory = "PEOPLE" + DocCategoryEmail DocCategory = "EMAIL" + DocCategorySso DocCategory = "SSO" + DocCategoryAts DocCategory = "ATS" + DocCategoryKnowledgeHub DocCategory = "KNOWLEDGE_HUB" + DocCategoryExternalShortcut DocCategory = "EXTERNAL_SHORTCUT" + DocCategoryEntity DocCategory = "ENTITY" + DocCategoryCalendar DocCategory = "CALENDAR" +) + +func (e DocCategory) ToPointer() *DocCategory { + return &e +} +func (e *DocCategory) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UNCATEGORIZED": + fallthrough + case "TICKETS": + fallthrough + case "CRM": + fallthrough + case "PUBLISHED_CONTENT": + fallthrough + case "COLLABORATIVE_CONTENT": + fallthrough + case "QUESTION_ANSWER": + fallthrough + case "MESSAGING": + fallthrough + case "CODE_REPOSITORY": + fallthrough + case "CHANGE_MANAGEMENT": + fallthrough + case "PEOPLE": + fallthrough + case "EMAIL": + fallthrough + case "SSO": + fallthrough + case "ATS": + fallthrough + case "KNOWLEDGE_HUB": + fallthrough + case "EXTERNAL_SHORTCUT": + fallthrough + case "ENTITY": + fallthrough + case "CALENDAR": + *e = DocCategory(v) + return nil + default: + return fmt.Errorf("invalid value for DocCategory: %v", v) + } +} + +// ObjectDefinition - The definition for an `DocumentMetadata.objectType` within a datasource. +type ObjectDefinition struct { + // Unique identifier for this `DocumentMetadata.objectType`. If omitted, this definition is used as a default for all unmatched `DocumentMetadata.objectType`s in this datasource. + Name *string `json:"name,omitempty"` + // The user-friendly name of the object for display. + DisplayLabel *string `json:"displayLabel,omitempty"` + // The document category of this object type. + DocCategory *DocCategory `json:"docCategory,omitempty"` + PropertyDefinitions []PropertyDefinition `json:"propertyDefinitions,omitempty"` + // A list of `PropertyGroup`s belonging to this object type, which will group properties to be displayed together in the UI. + PropertyGroups []PropertyGroup `json:"propertyGroups,omitempty"` + // Whether or not the object is summarizable + Summarizable *bool `json:"summarizable,omitempty"` +} + +func (o *ObjectDefinition) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObjectDefinition) GetDisplayLabel() *string { + if o == nil { + return nil + } + return o.DisplayLabel +} + +func (o *ObjectDefinition) GetDocCategory() *DocCategory { + if o == nil { + return nil + } + return o.DocCategory +} + +func (o *ObjectDefinition) GetPropertyDefinitions() []PropertyDefinition { + if o == nil { + return nil + } + return o.PropertyDefinitions +} + +func (o *ObjectDefinition) GetPropertyGroups() []PropertyGroup { + if o == nil { + return nil + } + return o.PropertyGroups +} + +func (o *ObjectDefinition) GetSummarizable() *bool { + if o == nil { + return nil + } + return o.Summarizable +} diff --git a/tests/mockserver/internal/sdk/models/components/objectpermissions.go b/tests/mockserver/internal/sdk/models/components/objectpermissions.go new file mode 100644 index 00000000..0988ab8f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/objectpermissions.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ObjectPermissions struct { + // Describes the write permissions levels that a user has for a specific feature + Write *WritePermission `json:"write,omitempty"` +} + +func (o *ObjectPermissions) GetWrite() *WritePermission { + if o == nil { + return nil + } + return o.Write +} diff --git a/tests/mockserver/internal/sdk/models/components/operatormetadata.go b/tests/mockserver/internal/sdk/models/components/operatormetadata.go new file mode 100644 index 00000000..01e632cd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/operatormetadata.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type OperatorType string + +const ( + OperatorTypeText OperatorType = "TEXT" + OperatorTypeDouble OperatorType = "DOUBLE" + OperatorTypeDate OperatorType = "DATE" + OperatorTypeUser OperatorType = "USER" +) + +func (e OperatorType) ToPointer() *OperatorType { + return &e +} +func (e *OperatorType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + fallthrough + case "DOUBLE": + fallthrough + case "DATE": + fallthrough + case "USER": + *e = OperatorType(v) + return nil + default: + return fmt.Errorf("invalid value for OperatorType: %v", v) + } +} + +type OperatorMetadata struct { + Name string `json:"name"` + // Whether this operator is supported by default or something that was created within a workplace app (e.g. custom jira field). + IsCustom *bool `json:"isCustom,omitempty"` + OperatorType *OperatorType `json:"operatorType,omitempty"` + HelpText *string `json:"helpText,omitempty"` + Scopes []OperatorScope `json:"scopes,omitempty"` + // Raw/canonical value of the operator. Only applies when result is an operator value. + Value *string `json:"value,omitempty"` + // Human readable value of the operator that can be shown to the user. Only applies when result is an operator value. + DisplayValue *string `json:"displayValue,omitempty"` +} + +func (o *OperatorMetadata) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *OperatorMetadata) GetIsCustom() *bool { + if o == nil { + return nil + } + return o.IsCustom +} + +func (o *OperatorMetadata) GetOperatorType() *OperatorType { + if o == nil { + return nil + } + return o.OperatorType +} + +func (o *OperatorMetadata) GetHelpText() *string { + if o == nil { + return nil + } + return o.HelpText +} + +func (o *OperatorMetadata) GetScopes() []OperatorScope { + if o == nil { + return nil + } + return o.Scopes +} + +func (o *OperatorMetadata) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} + +func (o *OperatorMetadata) GetDisplayValue() *string { + if o == nil { + return nil + } + return o.DisplayValue +} diff --git a/tests/mockserver/internal/sdk/models/components/operatorscope.go b/tests/mockserver/internal/sdk/models/components/operatorscope.go new file mode 100644 index 00000000..1432e9dd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/operatorscope.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type OperatorScope struct { + Datasource *string `json:"datasource,omitempty"` + DocType *string `json:"docType,omitempty"` +} + +func (o *OperatorScope) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *OperatorScope) GetDocType() *string { + if o == nil { + return nil + } + return o.DocType +} diff --git a/tests/mockserver/internal/sdk/models/components/peoplerequest.go b/tests/mockserver/internal/sdk/models/components/peoplerequest.go new file mode 100644 index 00000000..1240c00e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/peoplerequest.go @@ -0,0 +1,141 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type PeopleRequestIncludeField string + +const ( + PeopleRequestIncludeFieldBadges PeopleRequestIncludeField = "BADGES" + PeopleRequestIncludeFieldBusyEvents PeopleRequestIncludeField = "BUSY_EVENTS" + PeopleRequestIncludeFieldDocumentActivity PeopleRequestIncludeField = "DOCUMENT_ACTIVITY" + PeopleRequestIncludeFieldInviteInfo PeopleRequestIncludeField = "INVITE_INFO" + PeopleRequestIncludeFieldPeopleDistance PeopleRequestIncludeField = "PEOPLE_DISTANCE" + PeopleRequestIncludeFieldPermissions PeopleRequestIncludeField = "PERMISSIONS" + PeopleRequestIncludeFieldPeopleDetails PeopleRequestIncludeField = "PEOPLE_DETAILS" + PeopleRequestIncludeFieldManagementDetails PeopleRequestIncludeField = "MANAGEMENT_DETAILS" + PeopleRequestIncludeFieldPeopleProfileSettings PeopleRequestIncludeField = "PEOPLE_PROFILE_SETTINGS" + PeopleRequestIncludeFieldPeopleWithoutManager PeopleRequestIncludeField = "PEOPLE_WITHOUT_MANAGER" +) + +func (e PeopleRequestIncludeField) ToPointer() *PeopleRequestIncludeField { + return &e +} +func (e *PeopleRequestIncludeField) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "BADGES": + fallthrough + case "BUSY_EVENTS": + fallthrough + case "DOCUMENT_ACTIVITY": + fallthrough + case "INVITE_INFO": + fallthrough + case "PEOPLE_DISTANCE": + fallthrough + case "PERMISSIONS": + fallthrough + case "PEOPLE_DETAILS": + fallthrough + case "MANAGEMENT_DETAILS": + fallthrough + case "PEOPLE_PROFILE_SETTINGS": + fallthrough + case "PEOPLE_WITHOUT_MANAGER": + *e = PeopleRequestIncludeField(v) + return nil + default: + return fmt.Errorf("invalid value for PeopleRequestIncludeField: %v", v) + } +} + +type IncludeType string + +const ( + IncludeTypePeopleWithoutManager IncludeType = "PEOPLE_WITHOUT_MANAGER" + IncludeTypeInvalidEntities IncludeType = "INVALID_ENTITIES" +) + +func (e IncludeType) ToPointer() *IncludeType { + return &e +} +func (e *IncludeType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PEOPLE_WITHOUT_MANAGER": + fallthrough + case "INVALID_ENTITIES": + *e = IncludeType(v) + return nil + default: + return fmt.Errorf("invalid value for IncludeType: %v", v) + } +} + +type PeopleRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `json:"timezoneOffset,omitempty"` + // The Person IDs to retrieve. If no IDs are requested, the current user's details are returned. + ObfuscatedIds []string `json:"obfuscatedIds,omitempty"` + // The email IDs to retrieve. The result is the deduplicated union of emailIds and obfuscatedIds. + EmailIds []string `json:"emailIds,omitempty"` + // List of PersonMetadata fields to return (that aren't returned by default) + IncludeFields []PeopleRequestIncludeField `json:"includeFields,omitempty"` + // The types of people entities to include in the response in addition to those returned by default. + IncludeTypes []IncludeType `json:"includeTypes,omitempty"` + // A string denoting the search surface from which the endpoint is called. + Source *string `json:"source,omitempty"` +} + +func (o *PeopleRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *PeopleRequest) GetObfuscatedIds() []string { + if o == nil { + return nil + } + return o.ObfuscatedIds +} + +func (o *PeopleRequest) GetEmailIds() []string { + if o == nil { + return nil + } + return o.EmailIds +} + +func (o *PeopleRequest) GetIncludeFields() []PeopleRequestIncludeField { + if o == nil { + return nil + } + return o.IncludeFields +} + +func (o *PeopleRequest) GetIncludeTypes() []IncludeType { + if o == nil { + return nil + } + return o.IncludeTypes +} + +func (o *PeopleRequest) GetSource() *string { + if o == nil { + return nil + } + return o.Source +} diff --git a/tests/mockserver/internal/sdk/models/components/peopleresponse.go b/tests/mockserver/internal/sdk/models/components/peopleresponse.go new file mode 100644 index 00000000..45267148 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/peopleresponse.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PeopleResponse struct { + // A Person for each ID in the request, each with PersonMetadata populated. + Results []Person `json:"results,omitempty"` + // A list of documents related to this people response. This is only included if DOCUMENT_ACTIVITY is requested and only 1 person is included in the request. + RelatedDocuments []RelatedDocuments `json:"relatedDocuments,omitempty"` + // A list of IDs that could not be found. + Errors []string `json:"errors,omitempty"` +} + +func (o *PeopleResponse) GetResults() []Person { + if o == nil { + return nil + } + return o.Results +} + +func (o *PeopleResponse) GetRelatedDocuments() []RelatedDocuments { + if o == nil { + return nil + } + return o.RelatedDocuments +} + +func (o *PeopleResponse) GetErrors() []string { + if o == nil { + return nil + } + return o.Errors +} diff --git a/tests/mockserver/internal/sdk/models/components/period.go b/tests/mockserver/internal/sdk/models/components/period.go new file mode 100644 index 00000000..b91dda4d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/period.go @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Period struct { + // DEPRECATED - The number of days from now in the past to define upper boundary of time period. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + MinDaysFromNow *int64 `json:"minDaysFromNow,omitempty"` + // DEPRECATED - The number of days from now in the past to define lower boundary of time period. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + MaxDaysFromNow *int64 `json:"maxDaysFromNow,omitempty"` + Start *TimePoint `json:"start,omitempty"` + End *TimePoint `json:"end,omitempty"` +} + +func (o *Period) GetMinDaysFromNow() *int64 { + if o == nil { + return nil + } + return o.MinDaysFromNow +} + +func (o *Period) GetMaxDaysFromNow() *int64 { + if o == nil { + return nil + } + return o.MaxDaysFromNow +} + +func (o *Period) GetStart() *TimePoint { + if o == nil { + return nil + } + return o.Start +} + +func (o *Period) GetEnd() *TimePoint { + if o == nil { + return nil + } + return o.End +} diff --git a/tests/mockserver/internal/sdk/models/components/permissions.go b/tests/mockserver/internal/sdk/models/components/permissions.go new file mode 100644 index 00000000..7e80832a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/permissions.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Permissions - Describes the permissions levels that a user has for permissioned features. When the client sends this, Permissions.read and Permissions.write are the additional permissions granted to a user on top of what they have via their roles. +// When the server sends this, Permissions.read and Permissions.write are the complete (merged) set of permissions the user has, and Permissions.roles is just for display purposes. +type Permissions struct { + // TODO--deprecate in favor of the read and write properties. True if the user has access to /adminsearch + CanAdminSearch *bool `json:"canAdminSearch,omitempty"` + // TODO--deprecate in favor of the read and write properties. True if the user can administrate client API tokens with global scope + CanAdminClientAPIGlobalTokens *bool `json:"canAdminClientApiGlobalTokens,omitempty"` + // TODO--deprecate in favor of the read and write properties. True if the user has access to data loss prevention (DLP) features + CanDlp *bool `json:"canDlp,omitempty"` + // Describes the read permission levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject + Read map[string][]ReadPermission `json:"read,omitempty"` + // Describes the write permissions levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject + Write map[string][]WritePermission `json:"write,omitempty"` + // Describes the grant permission levels that a user has for permissioned features. Key must be PermissionedFeatureOrObject + Grant map[string][]GrantPermission `json:"grant,omitempty"` + // The roleId of the canonical role a user has. The displayName is equal to the roleId. + Role *string `json:"role,omitempty"` + // The roleIds of the roles a user has. + Roles []string `json:"roles,omitempty"` +} + +func (o *Permissions) GetCanAdminSearch() *bool { + if o == nil { + return nil + } + return o.CanAdminSearch +} + +func (o *Permissions) GetCanAdminClientAPIGlobalTokens() *bool { + if o == nil { + return nil + } + return o.CanAdminClientAPIGlobalTokens +} + +func (o *Permissions) GetCanDlp() *bool { + if o == nil { + return nil + } + return o.CanDlp +} + +func (o *Permissions) GetRead() map[string][]ReadPermission { + if o == nil { + return nil + } + return o.Read +} + +func (o *Permissions) GetWrite() map[string][]WritePermission { + if o == nil { + return nil + } + return o.Write +} + +func (o *Permissions) GetGrant() map[string][]GrantPermission { + if o == nil { + return nil + } + return o.Grant +} + +func (o *Permissions) GetRole() *string { + if o == nil { + return nil + } + return o.Role +} + +func (o *Permissions) GetRoles() []string { + if o == nil { + return nil + } + return o.Roles +} diff --git a/tests/mockserver/internal/sdk/models/components/permissionsgroupintersectiondefinition.go b/tests/mockserver/internal/sdk/models/components/permissionsgroupintersectiondefinition.go new file mode 100644 index 00000000..f9056e4f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/permissionsgroupintersectiondefinition.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PermissionsGroupIntersectionDefinition - describes a list of groups that are all required in a permissions constraint +type PermissionsGroupIntersectionDefinition struct { + RequiredGroups []string `json:"requiredGroups,omitempty"` +} + +func (o *PermissionsGroupIntersectionDefinition) GetRequiredGroups() []string { + if o == nil { + return nil + } + return o.RequiredGroups +} diff --git a/tests/mockserver/internal/sdk/models/components/person.go b/tests/mockserver/internal/sdk/models/components/person.go new file mode 100644 index 00000000..3715fbc0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/person.go @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Person struct { + // The display name. + Name string `json:"name"` + // An opaque identifier that can be used to request metadata for a Person. + ObfuscatedID string `json:"obfuscatedId"` + // A list of documents related to this person. + RelatedDocuments []RelatedDocuments `json:"relatedDocuments,omitempty"` + Metadata *PersonMetadata `json:"metadata,omitempty"` +} + +func (o *Person) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Person) GetObfuscatedID() string { + if o == nil { + return "" + } + return o.ObfuscatedID +} + +func (o *Person) GetRelatedDocuments() []RelatedDocuments { + if o == nil { + return nil + } + return o.RelatedDocuments +} + +func (o *Person) GetMetadata() *PersonMetadata { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/tests/mockserver/internal/sdk/models/components/persondistance.go b/tests/mockserver/internal/sdk/models/components/persondistance.go new file mode 100644 index 00000000..6a6a9807 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/persondistance.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PersonDistance struct { + // The display name. + Name string `json:"name"` + // An opaque identifier that can be used to request metadata for a Person. + ObfuscatedID string `json:"obfuscatedId"` + // Distance to person, refer to PeopleDistance pipeline on interpretation of the value. + Distance float32 `json:"distance"` +} + +func (o *PersonDistance) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *PersonDistance) GetObfuscatedID() string { + if o == nil { + return "" + } + return o.ObfuscatedID +} + +func (o *PersonDistance) GetDistance() float32 { + if o == nil { + return 0.0 + } + return o.Distance +} diff --git a/tests/mockserver/internal/sdk/models/components/personmetadata.go b/tests/mockserver/internal/sdk/models/components/personmetadata.go new file mode 100644 index 00000000..1752664d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/personmetadata.go @@ -0,0 +1,450 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "time" +) + +type PersonMetadataType string + +const ( + PersonMetadataTypeFullTime PersonMetadataType = "FULL_TIME" + PersonMetadataTypeContractor PersonMetadataType = "CONTRACTOR" + PersonMetadataTypeNonEmployee PersonMetadataType = "NON_EMPLOYEE" + PersonMetadataTypeFormerEmployee PersonMetadataType = "FORMER_EMPLOYEE" +) + +func (e PersonMetadataType) ToPointer() *PersonMetadataType { + return &e +} +func (e *PersonMetadataType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "FULL_TIME": + fallthrough + case "CONTRACTOR": + fallthrough + case "NON_EMPLOYEE": + fallthrough + case "FORMER_EMPLOYEE": + *e = PersonMetadataType(v) + return nil + default: + return fmt.Errorf("invalid value for PersonMetadataType: %v", v) + } +} + +type PersonMetadata struct { + Type *PersonMetadataType `json:"type,omitempty"` + // The first name of the person + FirstName *string `json:"firstName,omitempty"` + // The last name of the person + LastName *string `json:"lastName,omitempty"` + // Job title. + Title *string `json:"title,omitempty"` + // Typically the highest level organizational unit; generally applies to bigger companies with multiple distinct businesses. + BusinessUnit *string `json:"businessUnit,omitempty"` + // An organizational unit where everyone has a similar task, e.g. `Engineering`. + Department *string `json:"department,omitempty"` + // Info about the employee's team(s). + Teams []PersonTeam `json:"teams,omitempty"` + // The number of people in this person's department. + DepartmentCount *int64 `json:"departmentCount,omitempty"` + // The user's primary email address + Email *string `json:"email,omitempty"` + // Additional email addresses of this user beyond the primary, if any. + AliasEmails []string `json:"aliasEmails,omitempty"` + // User facing string representing the person's location. + Location *string `json:"location,omitempty"` + // Detailed location with information about country, state, city etc. + StructuredLocation *StructuredLocation `json:"structuredLocation,omitempty"` + // Link to a customer's internal profile page. This is set to '#' when no link is desired. + ExternalProfileLink *string `json:"externalProfileLink,omitempty"` + Manager *Person `json:"manager,omitempty"` + // The chain of reporting in the company as far up as it goes. The last entry is this person's direct manager. + ManagementChain []Person `json:"managementChain,omitempty"` + // Phone number as a number string. + Phone *string `json:"phone,omitempty"` + // The timezone of the person. E.g. "Pacific Daylight Time". + Timezone *string `json:"timezone,omitempty"` + // The offset of the person's timezone in seconds from UTC. + TimezoneOffset *int64 `json:"timezoneOffset,omitempty"` + // The URL of the person's avatar. Public, glean-authenticated and Base64 encoded data URLs are all valid (but not third-party-authenticated URLs). + PhotoURL *string `json:"photoUrl,omitempty"` + // The original photo URL of the person's avatar before any edits they made are applied + UneditedPhotoURL *string `json:"uneditedPhotoUrl,omitempty"` + // The URL of the person's banner photo. + BannerURL *string `json:"bannerUrl,omitempty"` + Reports []Person `json:"reports,omitempty"` + // The date when the employee started. + StartDate *types.Date `json:"startDate,omitempty"` + // If a former employee, the last date of employment. + EndDate *types.Date `json:"endDate,omitempty"` + // Short biography or mission statement of the employee. + Bio *string `json:"bio,omitempty"` + // She/her, He/his or other pronoun. + Pronoun *string `json:"pronoun,omitempty"` + // The total recursive size of the people reporting to this person, or 1 + OrgSizeCount *int64 `json:"orgSizeCount,omitempty"` + // The total number of people who directly report to this person, or 0 + DirectReportsCount *int64 `json:"directReportsCount,omitempty"` + // The preferred name of the person, or a nickname. + PreferredName *string `json:"preferredName,omitempty"` + // List of social network profiles. + SocialNetwork []SocialNetwork `json:"socialNetwork,omitempty"` + // List of profiles this user has in different datasources / tools that they use. + DatasourceProfile []DatasourceProfile `json:"datasourceProfile,omitempty"` + QuerySuggestions *QuerySuggestionList `json:"querySuggestions,omitempty"` + // List of people and distances to those people from this person. Optionally with metadata. + PeopleDistance []PersonDistance `json:"peopleDistance,omitempty"` + // Information regarding the invite status of a person. + InviteInfo *InviteInfo `json:"inviteInfo,omitempty"` + // Whether the user has signed into Glean at least once. + IsSignedUp *bool `json:"isSignedUp,omitempty"` + // The last time the user has used the Glean extension in ISO 8601 format. + LastExtensionUse *time.Time `json:"lastExtensionUse,omitempty"` + // Describes the permissions levels that a user has for permissioned features. When the client sends this, Permissions.read and Permissions.write are the additional permissions granted to a user on top of what they have via their roles. + // When the server sends this, Permissions.read and Permissions.write are the complete (merged) set of permissions the user has, and Permissions.roles is just for display purposes. + Permissions *Permissions `json:"permissions,omitempty"` + // User customizable fields for additional people information. + CustomFields []CustomFieldData `json:"customFields,omitempty"` + // The logging id of the person used in scrubbed logs, tracking GA metrics. + LoggingID *string `json:"loggingId,omitempty"` + // Percentage of the company that started strictly after this person. Between [0,100). + StartDatePercentile *float32 `json:"startDatePercentile,omitempty"` + // Intervals of busy time for this person, along with the type of event they're busy with. + BusyEvents []AnonymousEvent `json:"busyEvents,omitempty"` + // flag settings to indicate user profile settings for certain items + ProfileBoolSettings map[string]bool `json:"profileBoolSettings,omitempty"` + // The badges that a user has earned over their lifetime. + Badges []Badge `json:"badges,omitempty"` + // Whether this person is a "root" node in their organization's hierarchy. + IsOrgRoot *bool `json:"isOrgRoot,omitempty"` +} + +func (p PersonMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PersonMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PersonMetadata) GetType() *PersonMetadataType { + if o == nil { + return nil + } + return o.Type +} + +func (o *PersonMetadata) GetFirstName() *string { + if o == nil { + return nil + } + return o.FirstName +} + +func (o *PersonMetadata) GetLastName() *string { + if o == nil { + return nil + } + return o.LastName +} + +func (o *PersonMetadata) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *PersonMetadata) GetBusinessUnit() *string { + if o == nil { + return nil + } + return o.BusinessUnit +} + +func (o *PersonMetadata) GetDepartment() *string { + if o == nil { + return nil + } + return o.Department +} + +func (o *PersonMetadata) GetTeams() []PersonTeam { + if o == nil { + return nil + } + return o.Teams +} + +func (o *PersonMetadata) GetDepartmentCount() *int64 { + if o == nil { + return nil + } + return o.DepartmentCount +} + +func (o *PersonMetadata) GetEmail() *string { + if o == nil { + return nil + } + return o.Email +} + +func (o *PersonMetadata) GetAliasEmails() []string { + if o == nil { + return nil + } + return o.AliasEmails +} + +func (o *PersonMetadata) GetLocation() *string { + if o == nil { + return nil + } + return o.Location +} + +func (o *PersonMetadata) GetStructuredLocation() *StructuredLocation { + if o == nil { + return nil + } + return o.StructuredLocation +} + +func (o *PersonMetadata) GetExternalProfileLink() *string { + if o == nil { + return nil + } + return o.ExternalProfileLink +} + +func (o *PersonMetadata) GetManager() *Person { + if o == nil { + return nil + } + return o.Manager +} + +func (o *PersonMetadata) GetManagementChain() []Person { + if o == nil { + return nil + } + return o.ManagementChain +} + +func (o *PersonMetadata) GetPhone() *string { + if o == nil { + return nil + } + return o.Phone +} + +func (o *PersonMetadata) GetTimezone() *string { + if o == nil { + return nil + } + return o.Timezone +} + +func (o *PersonMetadata) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *PersonMetadata) GetPhotoURL() *string { + if o == nil { + return nil + } + return o.PhotoURL +} + +func (o *PersonMetadata) GetUneditedPhotoURL() *string { + if o == nil { + return nil + } + return o.UneditedPhotoURL +} + +func (o *PersonMetadata) GetBannerURL() *string { + if o == nil { + return nil + } + return o.BannerURL +} + +func (o *PersonMetadata) GetReports() []Person { + if o == nil { + return nil + } + return o.Reports +} + +func (o *PersonMetadata) GetStartDate() *types.Date { + if o == nil { + return nil + } + return o.StartDate +} + +func (o *PersonMetadata) GetEndDate() *types.Date { + if o == nil { + return nil + } + return o.EndDate +} + +func (o *PersonMetadata) GetBio() *string { + if o == nil { + return nil + } + return o.Bio +} + +func (o *PersonMetadata) GetPronoun() *string { + if o == nil { + return nil + } + return o.Pronoun +} + +func (o *PersonMetadata) GetOrgSizeCount() *int64 { + if o == nil { + return nil + } + return o.OrgSizeCount +} + +func (o *PersonMetadata) GetDirectReportsCount() *int64 { + if o == nil { + return nil + } + return o.DirectReportsCount +} + +func (o *PersonMetadata) GetPreferredName() *string { + if o == nil { + return nil + } + return o.PreferredName +} + +func (o *PersonMetadata) GetSocialNetwork() []SocialNetwork { + if o == nil { + return nil + } + return o.SocialNetwork +} + +func (o *PersonMetadata) GetDatasourceProfile() []DatasourceProfile { + if o == nil { + return nil + } + return o.DatasourceProfile +} + +func (o *PersonMetadata) GetQuerySuggestions() *QuerySuggestionList { + if o == nil { + return nil + } + return o.QuerySuggestions +} + +func (o *PersonMetadata) GetPeopleDistance() []PersonDistance { + if o == nil { + return nil + } + return o.PeopleDistance +} + +func (o *PersonMetadata) GetInviteInfo() *InviteInfo { + if o == nil { + return nil + } + return o.InviteInfo +} + +func (o *PersonMetadata) GetIsSignedUp() *bool { + if o == nil { + return nil + } + return o.IsSignedUp +} + +func (o *PersonMetadata) GetLastExtensionUse() *time.Time { + if o == nil { + return nil + } + return o.LastExtensionUse +} + +func (o *PersonMetadata) GetPermissions() *Permissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *PersonMetadata) GetCustomFields() []CustomFieldData { + if o == nil { + return nil + } + return o.CustomFields +} + +func (o *PersonMetadata) GetLoggingID() *string { + if o == nil { + return nil + } + return o.LoggingID +} + +func (o *PersonMetadata) GetStartDatePercentile() *float32 { + if o == nil { + return nil + } + return o.StartDatePercentile +} + +func (o *PersonMetadata) GetBusyEvents() []AnonymousEvent { + if o == nil { + return nil + } + return o.BusyEvents +} + +func (o *PersonMetadata) GetProfileBoolSettings() map[string]bool { + if o == nil { + return nil + } + return o.ProfileBoolSettings +} + +func (o *PersonMetadata) GetBadges() []Badge { + if o == nil { + return nil + } + return o.Badges +} + +func (o *PersonMetadata) GetIsOrgRoot() *bool { + if o == nil { + return nil + } + return o.IsOrgRoot +} diff --git a/tests/mockserver/internal/sdk/models/components/personobject.go b/tests/mockserver/internal/sdk/models/components/personobject.go new file mode 100644 index 00000000..cc403952 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/personobject.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PersonObject struct { + // The display name. + Name string `json:"name"` + // An opaque identifier that can be used to request metadata for a Person. + ObfuscatedID string `json:"obfuscatedId"` +} + +func (o *PersonObject) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *PersonObject) GetObfuscatedID() string { + if o == nil { + return "" + } + return o.ObfuscatedID +} diff --git a/tests/mockserver/internal/sdk/models/components/personteam.go b/tests/mockserver/internal/sdk/models/components/personteam.go new file mode 100644 index 00000000..bcc96612 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/personteam.go @@ -0,0 +1,106 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// PersonTeamRelationship - The team member's relationship to the team. This defaults to MEMBER if not set. +type PersonTeamRelationship string + +const ( + PersonTeamRelationshipMember PersonTeamRelationship = "MEMBER" + PersonTeamRelationshipManager PersonTeamRelationship = "MANAGER" + PersonTeamRelationshipLead PersonTeamRelationship = "LEAD" + PersonTeamRelationshipPointOfContact PersonTeamRelationship = "POINT_OF_CONTACT" + PersonTeamRelationshipOther PersonTeamRelationship = "OTHER" +) + +func (e PersonTeamRelationship) ToPointer() *PersonTeamRelationship { + return &e +} +func (e *PersonTeamRelationship) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MEMBER": + fallthrough + case "MANAGER": + fallthrough + case "LEAD": + fallthrough + case "POINT_OF_CONTACT": + fallthrough + case "OTHER": + *e = PersonTeamRelationship(v) + return nil + default: + return fmt.Errorf("invalid value for PersonTeamRelationship: %v", v) + } +} + +// PersonTeam - Use `id` if you index teams via Glean, and use `name` and `externalLink` if you want to use your own team pages +type PersonTeam struct { + // Unique identifier + ID *string `json:"id,omitempty"` + // Team name + Name *string `json:"name,omitempty"` + // Link to a team page on the internet or your company's intranet + ExternalLink *string `json:"externalLink,omitempty"` + // The team member's relationship to the team. This defaults to MEMBER if not set. + Relationship *PersonTeamRelationship `default:"MEMBER" json:"relationship"` + // The team member's start date + JoinDate *time.Time `json:"joinDate,omitempty"` +} + +func (p PersonTeam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PersonTeam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PersonTeam) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *PersonTeam) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *PersonTeam) GetExternalLink() *string { + if o == nil { + return nil + } + return o.ExternalLink +} + +func (o *PersonTeam) GetRelationship() *PersonTeamRelationship { + if o == nil { + return nil + } + return o.Relationship +} + +func (o *PersonTeam) GetJoinDate() *time.Time { + if o == nil { + return nil + } + return o.JoinDate +} diff --git a/tests/mockserver/internal/sdk/models/components/persontoteamrelationship.go b/tests/mockserver/internal/sdk/models/components/persontoteamrelationship.go new file mode 100644 index 00000000..f4a2bda2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/persontoteamrelationship.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// PersonToTeamRelationshipRelationship - The team member's relationship to the team. This defaults to MEMBER if not set. +type PersonToTeamRelationshipRelationship string + +const ( + PersonToTeamRelationshipRelationshipMember PersonToTeamRelationshipRelationship = "MEMBER" + PersonToTeamRelationshipRelationshipManager PersonToTeamRelationshipRelationship = "MANAGER" + PersonToTeamRelationshipRelationshipLead PersonToTeamRelationshipRelationship = "LEAD" + PersonToTeamRelationshipRelationshipPointOfContact PersonToTeamRelationshipRelationship = "POINT_OF_CONTACT" + PersonToTeamRelationshipRelationshipOther PersonToTeamRelationshipRelationship = "OTHER" +) + +func (e PersonToTeamRelationshipRelationship) ToPointer() *PersonToTeamRelationshipRelationship { + return &e +} +func (e *PersonToTeamRelationshipRelationship) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MEMBER": + fallthrough + case "MANAGER": + fallthrough + case "LEAD": + fallthrough + case "POINT_OF_CONTACT": + fallthrough + case "OTHER": + *e = PersonToTeamRelationshipRelationship(v) + return nil + default: + return fmt.Errorf("invalid value for PersonToTeamRelationshipRelationship: %v", v) + } +} + +// PersonToTeamRelationship - Metadata about the relationship of a person to a team. +type PersonToTeamRelationship struct { + Person Person `json:"person"` + // The team member's relationship to the team. This defaults to MEMBER if not set. + Relationship *PersonToTeamRelationshipRelationship `default:"MEMBER" json:"relationship"` + // Displayed name for the relationship if relationship is set to `OTHER`. + CustomRelationshipStr *string `json:"customRelationshipStr,omitempty"` + // The team member's start date + JoinDate *time.Time `json:"joinDate,omitempty"` +} + +func (p PersonToTeamRelationship) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PersonToTeamRelationship) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PersonToTeamRelationship) GetPerson() Person { + if o == nil { + return Person{} + } + return o.Person +} + +func (o *PersonToTeamRelationship) GetRelationship() *PersonToTeamRelationshipRelationship { + if o == nil { + return nil + } + return o.Relationship +} + +func (o *PersonToTeamRelationship) GetCustomRelationshipStr() *string { + if o == nil { + return nil + } + return o.CustomRelationshipStr +} + +func (o *PersonToTeamRelationship) GetJoinDate() *time.Time { + if o == nil { + return nil + } + return o.JoinDate +} diff --git a/tests/mockserver/internal/sdk/models/components/pindocument.go b/tests/mockserver/internal/sdk/models/components/pindocument.go new file mode 100644 index 00000000..76189f4d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/pindocument.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type PinDocument struct { + // The query strings for which the pinned result will show. + Queries []string `json:"queries,omitempty"` + // Filters which restrict who should see the pinned document. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The opaque id of the pin. + ID *string `json:"id,omitempty"` + // The document which should be a pinned result. + DocumentID string `json:"documentId"` + Attribution *Person `json:"attribution,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + CreateTime *time.Time `json:"createTime,omitempty"` + UpdateTime *time.Time `json:"updateTime,omitempty"` +} + +func (p PinDocument) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PinDocument) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PinDocument) GetQueries() []string { + if o == nil { + return nil + } + return o.Queries +} + +func (o *PinDocument) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *PinDocument) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *PinDocument) GetDocumentID() string { + if o == nil { + return "" + } + return o.DocumentID +} + +func (o *PinDocument) GetAttribution() *Person { + if o == nil { + return nil + } + return o.Attribution +} + +func (o *PinDocument) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *PinDocument) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *PinDocument) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} diff --git a/tests/mockserver/internal/sdk/models/components/pinrequest.go b/tests/mockserver/internal/sdk/models/components/pinrequest.go new file mode 100644 index 00000000..7ef8d8e6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/pinrequest.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PinRequest struct { + // The query strings for which the pinned result will show. + Queries []string `json:"queries,omitempty"` + // Filters which restrict who should see the pinned document. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The document to be pinned. + DocumentID *string `json:"documentId,omitempty"` +} + +func (o *PinRequest) GetQueries() []string { + if o == nil { + return nil + } + return o.Queries +} + +func (o *PinRequest) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *PinRequest) GetDocumentID() *string { + if o == nil { + return nil + } + return o.DocumentID +} diff --git a/tests/mockserver/internal/sdk/models/components/possiblevalue.go b/tests/mockserver/internal/sdk/models/components/possiblevalue.go new file mode 100644 index 00000000..a2238c72 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/possiblevalue.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PossibleValue - Possible value of a specific parameter +type PossibleValue struct { + // Possible value + Value *string `json:"value,omitempty"` + // User-friendly label associated with the value + Label *string `json:"label,omitempty"` +} + +func (o *PossibleValue) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} + +func (o *PossibleValue) GetLabel() *string { + if o == nil { + return nil + } + return o.Label +} diff --git a/tests/mockserver/internal/sdk/models/components/processalldocumentsrequest.go b/tests/mockserver/internal/sdk/models/components/processalldocumentsrequest.go new file mode 100644 index 00000000..3da693ea --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/processalldocumentsrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ProcessAllDocumentsRequest - Describes the request body of the /processalldocuments API call +type ProcessAllDocumentsRequest struct { + // If provided, process documents only for this custom datasource. Otherwise all uploaded documents are processed. + Datasource *string `json:"datasource,omitempty"` +} + +func (o *ProcessAllDocumentsRequest) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} diff --git a/tests/mockserver/internal/sdk/models/components/processallmembershipsrequest.go b/tests/mockserver/internal/sdk/models/components/processallmembershipsrequest.go new file mode 100644 index 00000000..baaa3e15 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/processallmembershipsrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ProcessAllMembershipsRequest - Describes the request body of the /processallmemberships API call +type ProcessAllMembershipsRequest struct { + // If provided, process group memberships only for this custom datasource. Otherwise all uploaded memberships are processed. + Datasource *string `json:"datasource,omitempty"` +} + +func (o *ProcessAllMembershipsRequest) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} diff --git a/tests/mockserver/internal/sdk/models/components/processinghistoryevent.go b/tests/mockserver/internal/sdk/models/components/processinghistoryevent.go new file mode 100644 index 00000000..e808139c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/processinghistoryevent.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ProcessingHistoryEvent - Processing history event for a datasource +type ProcessingHistoryEvent struct { + // The start time of the processing in ISO 8601 format + StartTime *string `json:"startTime,omitempty"` + // The end time of the processing in ISO 8601 format, 'NA' if still in progress + EndTime *string `json:"endTime,omitempty"` +} + +func (o *ProcessingHistoryEvent) GetStartTime() *string { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *ProcessingHistoryEvent) GetEndTime() *string { + if o == nil { + return nil + } + return o.EndTime +} diff --git a/tests/mockserver/internal/sdk/models/components/prompttemplate.go b/tests/mockserver/internal/sdk/models/components/prompttemplate.go new file mode 100644 index 00000000..ad65ceb6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/prompttemplate.go @@ -0,0 +1,119 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PromptTemplate struct { + // The user-given identifier for this prompt template. + Name *string `json:"name,omitempty"` + // The actual template string. + Template string `json:"template"` + // The Application Id the prompt template should be created under. Empty for default assistant. + ApplicationID *string `json:"applicationId,omitempty"` + Inclusions *ChatRestrictionFilters `json:"inclusions,omitempty"` + // A list of added user roles for the Workflow. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of removed user roles for the Workflow. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // Opaque id for this prompt template + ID *string `json:"id,omitempty"` + Author *Person `json:"author,omitempty"` + // Server Unix timestamp of the creation time. + CreateTimestamp *int64 `json:"createTimestamp,omitempty"` + // Server Unix timestamp of the last update time. + LastUpdateTimestamp *int64 `json:"lastUpdateTimestamp,omitempty"` + LastUpdatedBy *Person `json:"lastUpdatedBy,omitempty"` + // A list of roles for this prompt template explicitly granted. + Roles []UserRoleSpecification `json:"roles,omitempty"` +} + +func (o *PromptTemplate) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *PromptTemplate) GetTemplate() string { + if o == nil { + return "" + } + return o.Template +} + +func (o *PromptTemplate) GetApplicationID() *string { + if o == nil { + return nil + } + return o.ApplicationID +} + +func (o *PromptTemplate) GetInclusions() *ChatRestrictionFilters { + if o == nil { + return nil + } + return o.Inclusions +} + +func (o *PromptTemplate) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *PromptTemplate) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *PromptTemplate) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *PromptTemplate) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *PromptTemplate) GetAuthor() *Person { + if o == nil { + return nil + } + return o.Author +} + +func (o *PromptTemplate) GetCreateTimestamp() *int64 { + if o == nil { + return nil + } + return o.CreateTimestamp +} + +func (o *PromptTemplate) GetLastUpdateTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastUpdateTimestamp +} + +func (o *PromptTemplate) GetLastUpdatedBy() *Person { + if o == nil { + return nil + } + return o.LastUpdatedBy +} + +func (o *PromptTemplate) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} diff --git a/tests/mockserver/internal/sdk/models/components/prompttemplateresult.go b/tests/mockserver/internal/sdk/models/components/prompttemplateresult.go new file mode 100644 index 00000000..9ef3447d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/prompttemplateresult.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PromptTemplateResult struct { + PromptTemplate *PromptTemplate `json:"promptTemplate,omitempty"` + // An opaque token that represents this prompt template + TrackingToken *string `json:"trackingToken,omitempty"` + FavoriteInfo *FavoriteInfo `json:"favoriteInfo,omitempty"` + RunCount *CountInfo `json:"runCount,omitempty"` +} + +func (o *PromptTemplateResult) GetPromptTemplate() *PromptTemplate { + if o == nil { + return nil + } + return o.PromptTemplate +} + +func (o *PromptTemplateResult) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *PromptTemplateResult) GetFavoriteInfo() *FavoriteInfo { + if o == nil { + return nil + } + return o.FavoriteInfo +} + +func (o *PromptTemplateResult) GetRunCount() *CountInfo { + if o == nil { + return nil + } + return o.RunCount +} diff --git a/tests/mockserver/internal/sdk/models/components/propertydefinition.go b/tests/mockserver/internal/sdk/models/components/propertydefinition.go new file mode 100644 index 00000000..d1631c91 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/propertydefinition.go @@ -0,0 +1,162 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PropertyType - The type of custom property - this governs the search and faceting behavior. Note that MULTIPICKLIST is not yet supported. +type PropertyType string + +const ( + PropertyTypeText PropertyType = "TEXT" + PropertyTypeDate PropertyType = "DATE" + PropertyTypeInt PropertyType = "INT" + PropertyTypeUserid PropertyType = "USERID" + PropertyTypePicklist PropertyType = "PICKLIST" + PropertyTypeTextlist PropertyType = "TEXTLIST" + PropertyTypeMultipicklist PropertyType = "MULTIPICKLIST" +) + +func (e PropertyType) ToPointer() *PropertyType { + return &e +} +func (e *PropertyType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + fallthrough + case "DATE": + fallthrough + case "INT": + fallthrough + case "USERID": + fallthrough + case "PICKLIST": + fallthrough + case "TEXTLIST": + fallthrough + case "MULTIPICKLIST": + *e = PropertyType(v) + return nil + default: + return fmt.Errorf("invalid value for PropertyType: %v", v) + } +} + +type UIOptions string + +const ( + UIOptionsNone UIOptions = "NONE" + UIOptionsSearchResult UIOptions = "SEARCH_RESULT" + UIOptionsDocHovercard UIOptions = "DOC_HOVERCARD" +) + +func (e UIOptions) ToPointer() *UIOptions { + return &e +} +func (e *UIOptions) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NONE": + fallthrough + case "SEARCH_RESULT": + fallthrough + case "DOC_HOVERCARD": + *e = UIOptions(v) + return nil + default: + return fmt.Errorf("invalid value for UIOptions: %v", v) + } +} + +type PropertyDefinition struct { + // The name of the property in the `DocumentMetadata` (e.g. 'createTime', 'updateTime', 'author', 'container'). In the future, this will support custom properties too. + Name *string `json:"name,omitempty"` + // The user friendly label for the property. + DisplayLabel *string `json:"displayLabel,omitempty"` + // The user friendly label for the property that will be used if a plural context. + DisplayLabelPlural *string `json:"displayLabelPlural,omitempty"` + // The type of custom property - this governs the search and faceting behavior. Note that MULTIPICKLIST is not yet supported. + PropertyType *PropertyType `json:"propertyType,omitempty"` + UIOptions *UIOptions `json:"uiOptions,omitempty"` + // If true then the property will not show up as a facet in the UI. + HideUIFacet *bool `json:"hideUiFacet,omitempty"` + // Will be used to set the order of facets in the UI, if present. If set for one facet, must be set for all non-hidden UI facets. Must take on an integer value from 1 (shown at the top) to N (shown last), where N is the number of non-hidden UI facets. These facets will be ordered below the built-in "Type" and "Tag" operators. + UIFacetOrder *int64 `json:"uiFacetOrder,omitempty"` + // If true then the property will not be indexed for retrieval and ranking. + SkipIndexing *bool `json:"skipIndexing,omitempty"` + // The unique identifier of the `PropertyGroup` to which this property belongs. + Group *string `json:"group,omitempty"` +} + +func (o *PropertyDefinition) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *PropertyDefinition) GetDisplayLabel() *string { + if o == nil { + return nil + } + return o.DisplayLabel +} + +func (o *PropertyDefinition) GetDisplayLabelPlural() *string { + if o == nil { + return nil + } + return o.DisplayLabelPlural +} + +func (o *PropertyDefinition) GetPropertyType() *PropertyType { + if o == nil { + return nil + } + return o.PropertyType +} + +func (o *PropertyDefinition) GetUIOptions() *UIOptions { + if o == nil { + return nil + } + return o.UIOptions +} + +func (o *PropertyDefinition) GetHideUIFacet() *bool { + if o == nil { + return nil + } + return o.HideUIFacet +} + +func (o *PropertyDefinition) GetUIFacetOrder() *int64 { + if o == nil { + return nil + } + return o.UIFacetOrder +} + +func (o *PropertyDefinition) GetSkipIndexing() *bool { + if o == nil { + return nil + } + return o.SkipIndexing +} + +func (o *PropertyDefinition) GetGroup() *string { + if o == nil { + return nil + } + return o.Group +} diff --git a/tests/mockserver/internal/sdk/models/components/propertygroup.go b/tests/mockserver/internal/sdk/models/components/propertygroup.go new file mode 100644 index 00000000..173332a5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/propertygroup.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PropertyGroup - A grouping for multiple PropertyDefinition. Grouped properties will be displayed together in the UI. +type PropertyGroup struct { + // The unique identifier of the group. + Name *string `json:"name,omitempty"` + // The user-friendly group label to display. + DisplayLabel *string `json:"displayLabel,omitempty"` +} + +func (o *PropertyGroup) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *PropertyGroup) GetDisplayLabel() *string { + if o == nil { + return nil + } + return o.DisplayLabel +} diff --git a/tests/mockserver/internal/sdk/models/components/queryinsight.go b/tests/mockserver/internal/sdk/models/components/queryinsight.go new file mode 100644 index 00000000..faaa01fb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/queryinsight.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type QueryInsight struct { + // The query string the information is about. + Query string `json:"query"` + SearchCount *CountInfo `json:"searchCount,omitempty"` + SearchorCount *CountInfo `json:"searchorCount,omitempty"` + SearchWithClickCount *CountInfo `json:"searchWithClickCount,omitempty"` + ClickCount *CountInfo `json:"clickCount,omitempty"` + // list of similar queries to current one. + SimilarQueries []QueryInsight `json:"similarQueries,omitempty"` +} + +func (o *QueryInsight) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +func (o *QueryInsight) GetSearchCount() *CountInfo { + if o == nil { + return nil + } + return o.SearchCount +} + +func (o *QueryInsight) GetSearchorCount() *CountInfo { + if o == nil { + return nil + } + return o.SearchorCount +} + +func (o *QueryInsight) GetSearchWithClickCount() *CountInfo { + if o == nil { + return nil + } + return o.SearchWithClickCount +} + +func (o *QueryInsight) GetClickCount() *CountInfo { + if o == nil { + return nil + } + return o.ClickCount +} + +func (o *QueryInsight) GetSimilarQueries() []QueryInsight { + if o == nil { + return nil + } + return o.SimilarQueries +} diff --git a/tests/mockserver/internal/sdk/models/components/queryinsightsresponse.go b/tests/mockserver/internal/sdk/models/components/queryinsightsresponse.go new file mode 100644 index 00000000..6f6c8ef2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/queryinsightsresponse.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type QueryInsightsResponse struct { + // Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). + LastLogTimestamp *int64 `json:"lastLogTimestamp,omitempty"` + // Insights for queries. + QueryInsights []QueryInsight `json:"queryInsights,omitempty"` + // Insights for low performing queries without good results. + LowPerformingQueryInsights []QueryInsight `json:"lowPerformingQueryInsights,omitempty"` + // list of departments applicable for queries tab. + Departments []string `json:"departments,omitempty"` + // Min threshold in number of visitors while populating results, otherwise 0. + MinVisitorThreshold *int64 `json:"minVisitorThreshold,omitempty"` +} + +func (o *QueryInsightsResponse) GetLastLogTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastLogTimestamp +} + +func (o *QueryInsightsResponse) GetQueryInsights() []QueryInsight { + if o == nil { + return nil + } + return o.QueryInsights +} + +func (o *QueryInsightsResponse) GetLowPerformingQueryInsights() []QueryInsight { + if o == nil { + return nil + } + return o.LowPerformingQueryInsights +} + +func (o *QueryInsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} + +func (o *QueryInsightsResponse) GetMinVisitorThreshold() *int64 { + if o == nil { + return nil + } + return o.MinVisitorThreshold +} diff --git a/tests/mockserver/internal/sdk/models/components/querysuggestion.go b/tests/mockserver/internal/sdk/models/components/querysuggestion.go new file mode 100644 index 00000000..68f95f2a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/querysuggestion.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type QuerySuggestion struct { + // A query term missing from the original query on which this suggestion is based. + MissingTerm *string `json:"missingTerm,omitempty"` + // The query being suggested (e.g. enforcing the missing term from the original query). + Query string `json:"query"` + SearchProviderInfo *SearchProviderInfo `json:"searchProviderInfo,omitempty"` + // A user-facing description to display for the suggestion. + Label *string `json:"label,omitempty"` + // The datasource associated with the suggestion. + Datasource *string `json:"datasource,omitempty"` + RequestOptions *SearchRequestOptions `json:"requestOptions,omitempty"` + // The bolded ranges within the query of the QuerySuggestion. + Ranges []TextRange `json:"ranges,omitempty"` + InputDetails *SearchRequestInputDetails `json:"inputDetails,omitempty"` +} + +func (o *QuerySuggestion) GetMissingTerm() *string { + if o == nil { + return nil + } + return o.MissingTerm +} + +func (o *QuerySuggestion) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +func (o *QuerySuggestion) GetSearchProviderInfo() *SearchProviderInfo { + if o == nil { + return nil + } + return o.SearchProviderInfo +} + +func (o *QuerySuggestion) GetLabel() *string { + if o == nil { + return nil + } + return o.Label +} + +func (o *QuerySuggestion) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *QuerySuggestion) GetRequestOptions() *SearchRequestOptions { + if o == nil { + return nil + } + return o.RequestOptions +} + +func (o *QuerySuggestion) GetRanges() []TextRange { + if o == nil { + return nil + } + return o.Ranges +} + +func (o *QuerySuggestion) GetInputDetails() *SearchRequestInputDetails { + if o == nil { + return nil + } + return o.InputDetails +} diff --git a/tests/mockserver/internal/sdk/models/components/querysuggestionlist.go b/tests/mockserver/internal/sdk/models/components/querysuggestionlist.go new file mode 100644 index 00000000..899a9aed --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/querysuggestionlist.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type QuerySuggestionList struct { + Suggestions []QuerySuggestion `json:"suggestions,omitempty"` + Person *Person `json:"person,omitempty"` +} + +func (o *QuerySuggestionList) GetSuggestions() []QuerySuggestion { + if o == nil { + return nil + } + return o.Suggestions +} + +func (o *QuerySuggestionList) GetPerson() *Person { + if o == nil { + return nil + } + return o.Person +} diff --git a/tests/mockserver/internal/sdk/models/components/quicklink.go b/tests/mockserver/internal/sdk/models/components/quicklink.go new file mode 100644 index 00000000..7387d909 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/quicklink.go @@ -0,0 +1,101 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type Scope string + +const ( + ScopeAppCard Scope = "APP_CARD" + ScopeAutocompleteExactMatch Scope = "AUTOCOMPLETE_EXACT_MATCH" + ScopeAutocompleteFuzzyMatch Scope = "AUTOCOMPLETE_FUZZY_MATCH" + ScopeAutocompleteZeroQuery Scope = "AUTOCOMPLETE_ZERO_QUERY" + ScopeNewTabPage Scope = "NEW_TAB_PAGE" +) + +func (e Scope) ToPointer() *Scope { + return &e +} +func (e *Scope) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "APP_CARD": + fallthrough + case "AUTOCOMPLETE_EXACT_MATCH": + fallthrough + case "AUTOCOMPLETE_FUZZY_MATCH": + fallthrough + case "AUTOCOMPLETE_ZERO_QUERY": + fallthrough + case "NEW_TAB_PAGE": + *e = Scope(v) + return nil + default: + return fmt.Errorf("invalid value for Scope: %v", v) + } +} + +// Quicklink - An action for a specific datasource that will show up in autocomplete and app card, e.g. "Create new issue" for jira. +type Quicklink struct { + // Full action name. Used in autocomplete. + Name *string `json:"name,omitempty"` + // Shortened name. Used in app cards. + ShortName *string `json:"shortName,omitempty"` + // The URL of the action. + URL *string `json:"url,omitempty"` + // Defines how to render an icon + IconConfig *IconConfig `json:"iconConfig,omitempty"` + // Unique identifier of this quicklink + ID *string `json:"id,omitempty"` + // The scopes for which this quicklink is applicable + Scopes []Scope `json:"scopes,omitempty"` +} + +func (o *Quicklink) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *Quicklink) GetShortName() *string { + if o == nil { + return nil + } + return o.ShortName +} + +func (o *Quicklink) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *Quicklink) GetIconConfig() *IconConfig { + if o == nil { + return nil + } + return o.IconConfig +} + +func (o *Quicklink) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *Quicklink) GetScopes() []Scope { + if o == nil { + return nil + } + return o.Scopes +} diff --git a/tests/mockserver/internal/sdk/models/components/reaction.go b/tests/mockserver/internal/sdk/models/components/reaction.go new file mode 100644 index 00000000..173018e6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/reaction.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Reaction struct { + Type *string `json:"type,omitempty"` + // The count of the reaction type on the document. + Count *int64 `json:"count,omitempty"` + Reactors []Person `json:"reactors,omitempty"` + // Whether the user in context reacted with this type to the document. + ReactedByViewer *bool `json:"reactedByViewer,omitempty"` +} + +func (o *Reaction) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *Reaction) GetCount() *int64 { + if o == nil { + return nil + } + return o.Count +} + +func (o *Reaction) GetReactors() []Person { + if o == nil { + return nil + } + return o.Reactors +} + +func (o *Reaction) GetReactedByViewer() *bool { + if o == nil { + return nil + } + return o.ReactedByViewer +} diff --git a/tests/mockserver/internal/sdk/models/components/readpermission.go b/tests/mockserver/internal/sdk/models/components/readpermission.go new file mode 100644 index 00000000..3c19d6f0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/readpermission.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ReadPermission - Describes the read permission level that a user has for a specific feature +type ReadPermission struct { + // Describes the scope for a ReadPermission, WritePermission, or GrantPermission object + ScopeType *ScopeType `json:"scopeType,omitempty"` +} + +func (o *ReadPermission) GetScopeType() *ScopeType { + if o == nil { + return nil + } + return o.ScopeType +} diff --git a/tests/mockserver/internal/sdk/models/components/recommendationsrequest.go b/tests/mockserver/internal/sdk/models/components/recommendationsrequest.go new file mode 100644 index 00000000..707ad547 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/recommendationsrequest.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type RecommendationsRequest struct { + // The ISO 8601 timestamp associated with the client request. + Timestamp *time.Time `json:"timestamp,omitempty"` + // A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + TrackingToken *string `json:"trackingToken,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + SourceDocument *Document `json:"sourceDocument,omitempty"` + // Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + PageSize *int64 `json:"pageSize,omitempty"` + // Hint to the server about how many characters long a snippet may be. Server may return less or more. + MaxSnippetSize *int64 `json:"maxSnippetSize,omitempty"` + RecommendationDocumentSpec *DocumentSpecUnion `json:"recommendationDocumentSpec,omitempty"` + RequestOptions *RecommendationsRequestOptions `json:"requestOptions,omitempty"` +} + +func (r RecommendationsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RecommendationsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil +} + +func (o *RecommendationsRequest) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} + +func (o *RecommendationsRequest) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *RecommendationsRequest) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *RecommendationsRequest) GetSourceDocument() *Document { + if o == nil { + return nil + } + return o.SourceDocument +} + +func (o *RecommendationsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *RecommendationsRequest) GetMaxSnippetSize() *int64 { + if o == nil { + return nil + } + return o.MaxSnippetSize +} + +func (o *RecommendationsRequest) GetRecommendationDocumentSpec() *DocumentSpecUnion { + if o == nil { + return nil + } + return o.RecommendationDocumentSpec +} + +func (o *RecommendationsRequest) GetRequestOptions() *RecommendationsRequestOptions { + if o == nil { + return nil + } + return o.RequestOptions +} diff --git a/tests/mockserver/internal/sdk/models/components/recommendationsrequestoptions.go b/tests/mockserver/internal/sdk/models/components/recommendationsrequestoptions.go new file mode 100644 index 00000000..15fd1bbd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/recommendationsrequestoptions.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RecommendationsRequestOptions struct { + // Filter results to a single datasource name (e.g. gmail, slack). All results are returned if missing. + DatasourceFilter *string `json:"datasourceFilter,omitempty"` + // Filter results to only those relevant to one or more datasources (e.g. jira, gdrive). All results are returned if missing. + DatasourcesFilter []string `json:"datasourcesFilter,omitempty"` + // A list of facet filter sets that will be OR'ed together. + FacetFilterSets []FacetFilterSet `json:"facetFilterSets,omitempty"` + Context *Document `json:"context,omitempty"` + // The types of prominence wanted in results returned. Default is any type. + ResultProminence []SearchResultProminenceEnum `json:"resultProminence,omitempty"` +} + +func (o *RecommendationsRequestOptions) GetDatasourceFilter() *string { + if o == nil { + return nil + } + return o.DatasourceFilter +} + +func (o *RecommendationsRequestOptions) GetDatasourcesFilter() []string { + if o == nil { + return nil + } + return o.DatasourcesFilter +} + +func (o *RecommendationsRequestOptions) GetFacetFilterSets() []FacetFilterSet { + if o == nil { + return nil + } + return o.FacetFilterSets +} + +func (o *RecommendationsRequestOptions) GetContext() *Document { + if o == nil { + return nil + } + return o.Context +} + +func (o *RecommendationsRequestOptions) GetResultProminence() []SearchResultProminenceEnum { + if o == nil { + return nil + } + return o.ResultProminence +} diff --git a/tests/mockserver/internal/sdk/models/components/referencerange.go b/tests/mockserver/internal/sdk/models/components/referencerange.go new file mode 100644 index 00000000..7fe5e73a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/referencerange.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ReferenceRange - Each text range from the response can correspond to an array of snippets from the citation source. +type ReferenceRange struct { + // A subsection of a given string to which some special formatting should be applied. + TextRange *TextRange `json:"textRange,omitempty"` + Snippets []SearchResultSnippet `json:"snippets,omitempty"` +} + +func (o *ReferenceRange) GetTextRange() *TextRange { + if o == nil { + return nil + } + return o.TextRange +} + +func (o *ReferenceRange) GetSnippets() []SearchResultSnippet { + if o == nil { + return nil + } + return o.Snippets +} diff --git a/tests/mockserver/internal/sdk/models/components/relateddocuments.go b/tests/mockserver/internal/sdk/models/components/relateddocuments.go new file mode 100644 index 00000000..8ba764b3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/relateddocuments.go @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// Relation - How this document relates to the including entity. +type Relation string + +const ( + RelationAttachment Relation = "ATTACHMENT" + RelationCanonical Relation = "CANONICAL" + RelationCase Relation = "CASE" + RelationContactLower Relation = "contact" + RelationContactUpper Relation = "CONTACT" + RelationConversationMessages Relation = "CONVERSATION_MESSAGES" + RelationExpert Relation = "EXPERT" + RelationFrom Relation = "FROM" + RelationHighlight Relation = "HIGHLIGHT" + RelationOpportunityLower Relation = "opportunity" + RelationOpportunityUpper Relation = "OPPORTUNITY" + RelationRecent Relation = "RECENT" + RelationSource Relation = "SOURCE" + RelationTicket Relation = "TICKET" + RelationTranscript Relation = "TRANSCRIPT" + RelationWith Relation = "WITH" +) + +func (e Relation) ToPointer() *Relation { + return &e +} +func (e *Relation) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ATTACHMENT": + fallthrough + case "CANONICAL": + fallthrough + case "CASE": + fallthrough + case "contact": + fallthrough + case "CONTACT": + fallthrough + case "CONVERSATION_MESSAGES": + fallthrough + case "EXPERT": + fallthrough + case "FROM": + fallthrough + case "HIGHLIGHT": + fallthrough + case "opportunity": + fallthrough + case "OPPORTUNITY": + fallthrough + case "RECENT": + fallthrough + case "SOURCE": + fallthrough + case "TICKET": + fallthrough + case "TRANSCRIPT": + fallthrough + case "WITH": + *e = Relation(v) + return nil + default: + return fmt.Errorf("invalid value for Relation: %v", v) + } +} + +type RelatedDocuments struct { + // How this document relates to the including entity. + Relation *Relation `json:"relation,omitempty"` + // Which entity in the response that this entity relates to. Relevant when there are multiple entities associated with the response (such as merged customers) + AssociatedEntityID *string `json:"associatedEntityId,omitempty"` + QuerySuggestion *QuerySuggestion `json:"querySuggestion,omitempty"` + // A truncated list of documents with this relation. TO BE DEPRECATED. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Documents []Document `json:"documents,omitempty"` + // A truncated list of documents associated with this relation. To be used in favor of `documents` because it contains a trackingToken. + Results []SearchResult `json:"results,omitempty"` +} + +func (o *RelatedDocuments) GetRelation() *Relation { + if o == nil { + return nil + } + return o.Relation +} + +func (o *RelatedDocuments) GetAssociatedEntityID() *string { + if o == nil { + return nil + } + return o.AssociatedEntityID +} + +func (o *RelatedDocuments) GetQuerySuggestion() *QuerySuggestion { + if o == nil { + return nil + } + return o.QuerySuggestion +} + +func (o *RelatedDocuments) GetDocuments() []Document { + if o == nil { + return nil + } + return o.Documents +} + +func (o *RelatedDocuments) GetResults() []SearchResult { + if o == nil { + return nil + } + return o.Results +} diff --git a/tests/mockserver/internal/sdk/models/components/relatedobject.go b/tests/mockserver/internal/sdk/models/components/relatedobject.go new file mode 100644 index 00000000..0a02c754 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/relatedobject.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// RelatedObjectMetadata - Some metadata of the object which can be displayed, while not having the actual object. +type RelatedObjectMetadata struct { + // Placeholder name of the object, not the relationship. + Name *string `json:"name,omitempty"` +} + +func (o *RelatedObjectMetadata) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +type RelatedObject struct { + // The ID of the related object + ID string `json:"id"` + // Some metadata of the object which can be displayed, while not having the actual object. + Metadata *RelatedObjectMetadata `json:"metadata,omitempty"` +} + +func (o *RelatedObject) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *RelatedObject) GetMetadata() *RelatedObjectMetadata { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/tests/mockserver/internal/sdk/models/components/relatedobjectedge.go b/tests/mockserver/internal/sdk/models/components/relatedobjectedge.go new file mode 100644 index 00000000..a261a4a0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/relatedobjectedge.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RelatedObjectEdge struct { + Objects []RelatedObject `json:"objects,omitempty"` +} + +func (o *RelatedObjectEdge) GetObjects() []RelatedObject { + if o == nil { + return nil + } + return o.Objects +} diff --git a/tests/mockserver/internal/sdk/models/components/relatedquestion.go b/tests/mockserver/internal/sdk/models/components/relatedquestion.go new file mode 100644 index 00000000..79f2219e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/relatedquestion.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RelatedQuestion struct { + // The text of the related question + Question *string `json:"question,omitempty"` + // The answer for the related question + Answer *string `json:"answer,omitempty"` + // Subsections of the answer string to which some special formatting should be applied (eg. bold) + Ranges []TextRange `json:"ranges,omitempty"` +} + +func (o *RelatedQuestion) GetQuestion() *string { + if o == nil { + return nil + } + return o.Question +} + +func (o *RelatedQuestion) GetAnswer() *string { + if o == nil { + return nil + } + return o.Answer +} + +func (o *RelatedQuestion) GetRanges() []TextRange { + if o == nil { + return nil + } + return o.Ranges +} diff --git a/tests/mockserver/internal/sdk/models/components/reminder.go b/tests/mockserver/internal/sdk/models/components/reminder.go new file mode 100644 index 00000000..74162aa4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/reminder.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Reminder struct { + Assignee Person `json:"assignee"` + Requestor *Person `json:"requestor,omitempty"` + // Unix timestamp for when the reminder should trigger (in seconds since epoch UTC). + RemindAt int64 `json:"remindAt"` + // Unix timestamp for when the reminder was first created (in seconds since epoch UTC). + CreatedAt *int64 `json:"createdAt,omitempty"` + // An optional free-text reason for the reminder. This is particularly useful when a reminder is used to ask for verification from another user (for example, "Duplicate", "Incomplete", "Incorrect"). + Reason *string `json:"reason,omitempty"` +} + +func (o *Reminder) GetAssignee() Person { + if o == nil { + return Person{} + } + return o.Assignee +} + +func (o *Reminder) GetRequestor() *Person { + if o == nil { + return nil + } + return o.Requestor +} + +func (o *Reminder) GetRemindAt() int64 { + if o == nil { + return 0 + } + return o.RemindAt +} + +func (o *Reminder) GetCreatedAt() *int64 { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *Reminder) GetReason() *string { + if o == nil { + return nil + } + return o.Reason +} diff --git a/tests/mockserver/internal/sdk/models/components/reminderrequest.go b/tests/mockserver/internal/sdk/models/components/reminderrequest.go new file mode 100644 index 00000000..d501a754 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/reminderrequest.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ReminderRequest struct { + // The document which the verification is for new reminders and/or update. + DocumentID string `json:"documentId"` + // The obfuscated id of the person this verification is assigned to. + Assignee *string `json:"assignee,omitempty"` + // Reminder for the next verifications in terms of days. For deletion, this will be omitted. + RemindInDays *int64 `json:"remindInDays,omitempty"` + // An optional free-text reason for the reminder. This is particularly useful when a reminder is used to ask for verification from another user (for example, "Duplicate", "Incomplete", "Incorrect"). + Reason *string `json:"reason,omitempty"` +} + +func (o *ReminderRequest) GetDocumentID() string { + if o == nil { + return "" + } + return o.DocumentID +} + +func (o *ReminderRequest) GetAssignee() *string { + if o == nil { + return nil + } + return o.Assignee +} + +func (o *ReminderRequest) GetRemindInDays() *int64 { + if o == nil { + return nil + } + return o.RemindInDays +} + +func (o *ReminderRequest) GetReason() *string { + if o == nil { + return nil + } + return o.Reason +} diff --git a/tests/mockserver/internal/sdk/models/components/reportstatusresponse.go b/tests/mockserver/internal/sdk/models/components/reportstatusresponse.go new file mode 100644 index 00000000..e2603ee4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/reportstatusresponse.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type ReportStatusResponseStatus string + +const ( + ReportStatusResponseStatusPending ReportStatusResponseStatus = "PENDING" + ReportStatusResponseStatusSuccess ReportStatusResponseStatus = "SUCCESS" + ReportStatusResponseStatusFailure ReportStatusResponseStatus = "FAILURE" + ReportStatusResponseStatusCancelled ReportStatusResponseStatus = "CANCELLED" + ReportStatusResponseStatusCancelling ReportStatusResponseStatus = "CANCELLING" + ReportStatusResponseStatusActive ReportStatusResponseStatus = "ACTIVE" +) + +func (e ReportStatusResponseStatus) ToPointer() *ReportStatusResponseStatus { + return &e +} +func (e *ReportStatusResponseStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PENDING": + fallthrough + case "SUCCESS": + fallthrough + case "FAILURE": + fallthrough + case "CANCELLED": + fallthrough + case "CANCELLING": + fallthrough + case "ACTIVE": + *e = ReportStatusResponseStatus(v) + return nil + default: + return fmt.Errorf("invalid value for ReportStatusResponseStatus: %v", v) + } +} + +type ReportStatusResponse struct { + Status *ReportStatusResponseStatus `json:"status,omitempty"` + // The timestamp at which the report's run/scan began. + StartTime *string `json:"startTime,omitempty"` +} + +func (o *ReportStatusResponse) GetStatus() *ReportStatusResponseStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *ReportStatusResponse) GetStartTime() *string { + if o == nil { + return nil + } + return o.StartTime +} diff --git a/tests/mockserver/internal/sdk/models/components/restrictionfilters.go b/tests/mockserver/internal/sdk/models/components/restrictionfilters.go new file mode 100644 index 00000000..2befcce9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/restrictionfilters.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RestrictionFilters struct { + // Specifications for containers that should be used as part of the restriction (include/exclude). Memberships are recursively defined for a subset of datasources (currently: SharePoint, OneDrive, Google Drive, and Confluence). Please contact the Glean team to enable this for more datasources. Recursive memberships do not apply for Collections. + ContainerSpecs []DocumentSpecUnion `json:"containerSpecs,omitempty"` +} + +func (o *RestrictionFilters) GetContainerSpecs() []DocumentSpecUnion { + if o == nil { + return nil + } + return o.ContainerSpecs +} diff --git a/tests/mockserver/internal/sdk/models/components/resultsdescription.go b/tests/mockserver/internal/sdk/models/components/resultsdescription.go new file mode 100644 index 00000000..4b626663 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/resultsdescription.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ResultsDescription struct { + // Textual description of the results. Can be shown at the top of SERP, e.g. 'People who write about this topic' for experts in people tab. + Text *string `json:"text,omitempty"` + // Defines how to render an icon + IconConfig *IconConfig `json:"iconConfig,omitempty"` +} + +func (o *ResultsDescription) GetText() *string { + if o == nil { + return nil + } + return o.Text +} + +func (o *ResultsDescription) GetIconConfig() *IconConfig { + if o == nil { + return nil + } + return o.IconConfig +} diff --git a/tests/mockserver/internal/sdk/models/components/resultsresponse.go b/tests/mockserver/internal/sdk/models/components/resultsresponse.go new file mode 100644 index 00000000..903402c8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/resultsresponse.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ResultsResponse struct { + // A token that should be passed for additional requests related to this request (such as more results requests). + TrackingToken *string `json:"trackingToken,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + Results []SearchResult `json:"results,omitempty"` + StructuredResults []StructuredResult `json:"structuredResults,omitempty"` + GeneratedQnaResult *GeneratedQna `json:"generatedQnaResult,omitempty"` + GleanDataError *GleanDataError `json:"errorInfo,omitempty"` + // A platform-generated request ID to correlate backend logs. + RequestID *string `json:"requestID,omitempty"` + // Time in milliseconds the backend took to respond to the request. + BackendTimeMillis *int64 `json:"backendTimeMillis,omitempty"` +} + +func (o *ResultsResponse) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *ResultsResponse) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *ResultsResponse) GetResults() []SearchResult { + if o == nil { + return nil + } + return o.Results +} + +func (o *ResultsResponse) GetStructuredResults() []StructuredResult { + if o == nil { + return nil + } + return o.StructuredResults +} + +func (o *ResultsResponse) GetGeneratedQnaResult() *GeneratedQna { + if o == nil { + return nil + } + return o.GeneratedQnaResult +} + +func (o *ResultsResponse) GetGleanDataError() *GleanDataError { + if o == nil { + return nil + } + return o.GleanDataError +} + +func (o *ResultsResponse) GetRequestID() *string { + if o == nil { + return nil + } + return o.RequestID +} + +func (o *ResultsResponse) GetBackendTimeMillis() *int64 { + if o == nil { + return nil + } + return o.BackendTimeMillis +} diff --git a/tests/mockserver/internal/sdk/models/components/resulttab.go b/tests/mockserver/internal/sdk/models/components/resulttab.go new file mode 100644 index 00000000..4f2d94ff --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/resulttab.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ResultTab struct { + // The unique ID of the tab. Can be passed in a search request to get results for that tab. + ID *string `json:"id,omitempty"` + // The number of results in this tab for the current query. + Count *int64 `json:"count,omitempty"` + // The datasource associated with the tab, if any. + Datasource *string `json:"datasource,omitempty"` + // The datasource instance associated with the tab, if any. + DatasourceInstance *string `json:"datasourceInstance,omitempty"` +} + +func (o *ResultTab) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *ResultTab) GetCount() *int64 { + if o == nil { + return nil + } + return o.Count +} + +func (o *ResultTab) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *ResultTab) GetDatasourceInstance() *string { + if o == nil { + return nil + } + return o.DatasourceInstance +} diff --git a/tests/mockserver/internal/sdk/models/components/rotatetokenresponse.go b/tests/mockserver/internal/sdk/models/components/rotatetokenresponse.go new file mode 100644 index 00000000..7c751f25 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/rotatetokenresponse.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// RotateTokenResponse - Describes the response body of the /rotatetoken API call +type RotateTokenResponse struct { + // New raw secret + RawSecret *string `json:"rawSecret,omitempty"` + // Unix timestamp in seconds when the new secret value is assigned to the token. The token needs to be rotated before `rotationPeriodMinutes` past the createdAt timestamp otherwise it would be rendered unusable. + CreatedAt *int64 `json:"createdAt,omitempty"` + // Refers to the time period in minutes before which this token needs to be rotated. It is required to rotate the token within the specified `rotationPeriodMinutes` after each `/rotatetoken` call, otherwise the tokens would expire. Note that the token would still expire at `expiresAt` timestamp provided during token creation even if the token is being regularly rotated. `rotationPeriodMinutes` property is inherited from the parent token being rotated + RotationPeriodMinutes *int64 `json:"rotationPeriodMinutes,omitempty"` +} + +func (o *RotateTokenResponse) GetRawSecret() *string { + if o == nil { + return nil + } + return o.RawSecret +} + +func (o *RotateTokenResponse) GetCreatedAt() *int64 { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *RotateTokenResponse) GetRotationPeriodMinutes() *int64 { + if o == nil { + return nil + } + return o.RotationPeriodMinutes +} diff --git a/tests/mockserver/internal/sdk/models/components/scopetype.go b/tests/mockserver/internal/sdk/models/components/scopetype.go new file mode 100644 index 00000000..b0f9c8a4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/scopetype.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ScopeType - Describes the scope for a ReadPermission, WritePermission, or GrantPermission object +type ScopeType string + +const ( + ScopeTypeGlobal ScopeType = "GLOBAL" + ScopeTypeOwn ScopeType = "OWN" +) + +func (e ScopeType) ToPointer() *ScopeType { + return &e +} +func (e *ScopeType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "GLOBAL": + fallthrough + case "OWN": + *e = ScopeType(v) + return nil + default: + return fmt.Errorf("invalid value for ScopeType: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/searchagentsrequest.go b/tests/mockserver/internal/sdk/models/components/searchagentsrequest.go new file mode 100644 index 00000000..121e0c7b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchagentsrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchAgentsRequest struct { + // Filters on the name of the agent. The keyword search is case-insensitive. If search string is ommited or empty, acts as no filter. + Name *string `json:"name,omitempty"` +} + +func (o *SearchAgentsRequest) GetName() *string { + if o == nil { + return nil + } + return o.Name +} diff --git a/tests/mockserver/internal/sdk/models/components/searchagentsresponse.go b/tests/mockserver/internal/sdk/models/components/searchagentsresponse.go new file mode 100644 index 00000000..7c26e614 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchagentsresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchAgentsResponse struct { + Agents []Agent `json:"agents,omitempty"` +} + +func (o *SearchAgentsResponse) GetAgents() []Agent { + if o == nil { + return nil + } + return o.Agents +} diff --git a/tests/mockserver/internal/sdk/models/components/searchproviderinfo.go b/tests/mockserver/internal/sdk/models/components/searchproviderinfo.go new file mode 100644 index 00000000..f2aca559 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchproviderinfo.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchProviderInfo struct { + // Name of the search provider. + Name *string `json:"name,omitempty"` + // URL to the provider's logo. + LogoURL *string `json:"logoUrl,omitempty"` + // URL template that can be used to perform the suggested search by replacing the {query} placeholder with the query suggestion. + SearchLinkURLTemplate *string `json:"searchLinkUrlTemplate,omitempty"` +} + +func (o *SearchProviderInfo) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *SearchProviderInfo) GetLogoURL() *string { + if o == nil { + return nil + } + return o.LogoURL +} + +func (o *SearchProviderInfo) GetSearchLinkURLTemplate() *string { + if o == nil { + return nil + } + return o.SearchLinkURLTemplate +} diff --git a/tests/mockserver/internal/sdk/models/components/searchrequest.go b/tests/mockserver/internal/sdk/models/components/searchrequest.go new file mode 100644 index 00000000..322f0bf8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchrequest.go @@ -0,0 +1,144 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type SearchRequest struct { + // The ISO 8601 timestamp associated with the client request. + Timestamp *time.Time `json:"timestamp,omitempty"` + // A previously received trackingToken for a search associated with the same query. Useful for more requests and requests for other tabs. + TrackingToken *string `json:"trackingToken,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + SourceDocument *Document `json:"sourceDocument,omitempty"` + // Hint to the server about how many results to send back. Server may return less or more. Structured results and clustered results don't count towards pageSize. + PageSize *int64 `json:"pageSize,omitempty"` + // Hint to the server about how many characters long a snippet may be. Server may return less or more. + MaxSnippetSize *int64 `json:"maxSnippetSize,omitempty"` + // The search terms. + Query string `json:"query"` + // Pagination cursor. A previously received opaque token representing the position in the overall results at which to start. + Cursor *string `json:"cursor,omitempty"` + // The unique IDs of the result tabs for which to fetch results. This will have precedence over datasource filters if both are specified and in conflict. + ResultTabIds []string `json:"resultTabIds,omitempty"` + InputDetails *SearchRequestInputDetails `json:"inputDetails,omitempty"` + RequestOptions *SearchRequestOptions `json:"requestOptions,omitempty"` + // Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer. + TimeoutMillis *int64 `json:"timeoutMillis,omitempty"` + // People associated with the search request. Hints to the server to fetch additional information for these people. Note that in this request, an email may be used as a person's obfuscatedId value. + People []Person `json:"people,omitempty"` + // Whether or not to disable spellcheck. + DisableSpellcheck *bool `json:"disableSpellcheck,omitempty"` +} + +func (s SearchRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SearchRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + return err + } + return nil +} + +func (o *SearchRequest) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} + +func (o *SearchRequest) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *SearchRequest) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *SearchRequest) GetSourceDocument() *Document { + if o == nil { + return nil + } + return o.SourceDocument +} + +func (o *SearchRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *SearchRequest) GetMaxSnippetSize() *int64 { + if o == nil { + return nil + } + return o.MaxSnippetSize +} + +func (o *SearchRequest) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +func (o *SearchRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *SearchRequest) GetResultTabIds() []string { + if o == nil { + return nil + } + return o.ResultTabIds +} + +func (o *SearchRequest) GetInputDetails() *SearchRequestInputDetails { + if o == nil { + return nil + } + return o.InputDetails +} + +func (o *SearchRequest) GetRequestOptions() *SearchRequestOptions { + if o == nil { + return nil + } + return o.RequestOptions +} + +func (o *SearchRequest) GetTimeoutMillis() *int64 { + if o == nil { + return nil + } + return o.TimeoutMillis +} + +func (o *SearchRequest) GetPeople() []Person { + if o == nil { + return nil + } + return o.People +} + +func (o *SearchRequest) GetDisableSpellcheck() *bool { + if o == nil { + return nil + } + return o.DisableSpellcheck +} diff --git a/tests/mockserver/internal/sdk/models/components/searchrequestinputdetails.go b/tests/mockserver/internal/sdk/models/components/searchrequestinputdetails.go new file mode 100644 index 00000000..a5e098fd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchrequestinputdetails.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchRequestInputDetails struct { + // Whether the associated query was at least partially copy-pasted. If subsequent requests are issued after a copy-pasted query is constructed (e.g. with facet modifications), this bit should continue to be set for those requests. + HasCopyPaste *bool `json:"hasCopyPaste,omitempty"` +} + +func (o *SearchRequestInputDetails) GetHasCopyPaste() *bool { + if o == nil { + return nil + } + return o.HasCopyPaste +} diff --git a/tests/mockserver/internal/sdk/models/components/searchrequestoptions.go b/tests/mockserver/internal/sdk/models/components/searchrequestoptions.go new file mode 100644 index 00000000..748f820e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchrequestoptions.go @@ -0,0 +1,197 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ResponseHint - Hints for the response content. +type ResponseHint string + +const ( + ResponseHintAllResultCounts ResponseHint = "ALL_RESULT_COUNTS" + ResponseHintFacetResults ResponseHint = "FACET_RESULTS" + ResponseHintQueryMetadata ResponseHint = "QUERY_METADATA" + ResponseHintResults ResponseHint = "RESULTS" + ResponseHintSpellcheckMetadata ResponseHint = "SPELLCHECK_METADATA" +) + +func (e ResponseHint) ToPointer() *ResponseHint { + return &e +} +func (e *ResponseHint) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ALL_RESULT_COUNTS": + fallthrough + case "FACET_RESULTS": + fallthrough + case "QUERY_METADATA": + fallthrough + case "RESULTS": + fallthrough + case "SPELLCHECK_METADATA": + *e = ResponseHint(v) + return nil + default: + return fmt.Errorf("invalid value for ResponseHint: %v", v) + } +} + +type SearchRequestOptions struct { + // Filter results to a single datasource name (e.g. gmail, slack). All results are returned if missing. + DatasourceFilter *string `json:"datasourceFilter,omitempty"` + // Filter results to one or more datasources (e.g. gmail, slack). All results are returned if missing. + DatasourcesFilter []string `json:"datasourcesFilter,omitempty"` + // If true, the operators in the query are taken to override any operators in facetFilters in the case of conflict. This is used to correctly set rewrittenFacetFilters and rewrittenQuery. + QueryOverridesFacetFilters *bool `json:"queryOverridesFacetFilters,omitempty"` + // A list of filters for the query. An AND is assumed between different facetFilters. For example, owner Sumeet and type Spreadsheet shows documents that are by Sumeet AND are Spreadsheets. + FacetFilters []FacetFilter `json:"facetFilters,omitempty"` + // A list of facet filter sets that will be OR'ed together. SearchRequestOptions where both facetFilterSets and facetFilters set are considered as bad request. Callers should set only one of these fields. + FacetFilterSets []FacetFilterSet `json:"facetFilterSets,omitempty"` + FacetBucketFilter *FacetBucketFilter `json:"facetBucketFilter,omitempty"` + // The maximum number of FacetBuckets to return in each FacetResult. + FacetBucketSize int64 `json:"facetBucketSize"` + // Facets for which FacetResults should be fetched and that don't apply to a particular datasource. If specified, these values will replace the standard default facets (last_updated_at, from, etc.). The requested facets will be returned alongside datasource-specific facets if searching a single datasource. + DefaultFacets []string `json:"defaultFacets,omitempty"` + // Auth tokens which may be used for non-indexed, federated results (e.g. Gmail). + AuthTokens []AuthToken `json:"authTokens,omitempty"` + // Hints that the QE should return result counts (via the datasource facet result) for all supported datasources, rather than just those specified in the datasource[s]Filter + FetchAllDatasourceCounts *bool `json:"fetchAllDatasourceCounts,omitempty"` + // Array of hints containing which fields should be populated in the response. + ResponseHints []ResponseHint `json:"responseHints,omitempty"` + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `json:"timezoneOffset,omitempty"` + // Whether or not to disable spellcheck. + DisableSpellcheck *bool `json:"disableSpellcheck,omitempty"` + // Disables automatic adjustment of the input query for spelling corrections or other reasons. + DisableQueryAutocorrect *bool `json:"disableQueryAutocorrect,omitempty"` + // [beta] Enables expanded content to be returned for LLM usage. The size of content per result returned should be modified using maxSnippetSize. Server may return less or more than what is specified in maxSnippetSize. For more details, https://docs.google.com/document/d/1CTOLSxWWT9WDEnHVLoCUaxbGYyXYP8kctPRF-RluSQY/edit. Requires sufficient permissions. + ReturnLlmContentOverSnippets *bool `json:"returnLlmContentOverSnippets,omitempty"` + Inclusions *RestrictionFilters `json:"inclusions,omitempty"` + Exclusions *RestrictionFilters `json:"exclusions,omitempty"` +} + +func (o *SearchRequestOptions) GetDatasourceFilter() *string { + if o == nil { + return nil + } + return o.DatasourceFilter +} + +func (o *SearchRequestOptions) GetDatasourcesFilter() []string { + if o == nil { + return nil + } + return o.DatasourcesFilter +} + +func (o *SearchRequestOptions) GetQueryOverridesFacetFilters() *bool { + if o == nil { + return nil + } + return o.QueryOverridesFacetFilters +} + +func (o *SearchRequestOptions) GetFacetFilters() []FacetFilter { + if o == nil { + return nil + } + return o.FacetFilters +} + +func (o *SearchRequestOptions) GetFacetFilterSets() []FacetFilterSet { + if o == nil { + return nil + } + return o.FacetFilterSets +} + +func (o *SearchRequestOptions) GetFacetBucketFilter() *FacetBucketFilter { + if o == nil { + return nil + } + return o.FacetBucketFilter +} + +func (o *SearchRequestOptions) GetFacetBucketSize() int64 { + if o == nil { + return 0 + } + return o.FacetBucketSize +} + +func (o *SearchRequestOptions) GetDefaultFacets() []string { + if o == nil { + return nil + } + return o.DefaultFacets +} + +func (o *SearchRequestOptions) GetAuthTokens() []AuthToken { + if o == nil { + return nil + } + return o.AuthTokens +} + +func (o *SearchRequestOptions) GetFetchAllDatasourceCounts() *bool { + if o == nil { + return nil + } + return o.FetchAllDatasourceCounts +} + +func (o *SearchRequestOptions) GetResponseHints() []ResponseHint { + if o == nil { + return nil + } + return o.ResponseHints +} + +func (o *SearchRequestOptions) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *SearchRequestOptions) GetDisableSpellcheck() *bool { + if o == nil { + return nil + } + return o.DisableSpellcheck +} + +func (o *SearchRequestOptions) GetDisableQueryAutocorrect() *bool { + if o == nil { + return nil + } + return o.DisableQueryAutocorrect +} + +func (o *SearchRequestOptions) GetReturnLlmContentOverSnippets() *bool { + if o == nil { + return nil + } + return o.ReturnLlmContentOverSnippets +} + +func (o *SearchRequestOptions) GetInclusions() *RestrictionFilters { + if o == nil { + return nil + } + return o.Inclusions +} + +func (o *SearchRequestOptions) GetExclusions() *RestrictionFilters { + if o == nil { + return nil + } + return o.Exclusions +} diff --git a/tests/mockserver/internal/sdk/models/components/searchresponse.go b/tests/mockserver/internal/sdk/models/components/searchresponse.go new file mode 100644 index 00000000..7da8d59a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchresponse.go @@ -0,0 +1,151 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchResponse struct { + // A token that should be passed for additional requests related to this request (such as more results requests). + TrackingToken *string `json:"trackingToken,omitempty"` + SessionInfo *SessionInfo `json:"sessionInfo,omitempty"` + Results []SearchResult `json:"results,omitempty"` + StructuredResults []StructuredResult `json:"structuredResults,omitempty"` + GeneratedQnaResult *GeneratedQna `json:"generatedQnaResult,omitempty"` + GleanDataError *GleanDataError `json:"errorInfo,omitempty"` + // A platform-generated request ID to correlate backend logs. + RequestID *string `json:"requestID,omitempty"` + // Time in milliseconds the backend took to respond to the request. + BackendTimeMillis *int64 `json:"backendTimeMillis,omitempty"` + // List of experiment ids for the corresponding request. + ExperimentIds []int64 `json:"experimentIds,omitempty"` + Metadata *SearchResponseMetadata `json:"metadata,omitempty"` + FacetResults []FacetResult `json:"facetResults,omitempty"` + // All result tabs available for the current query. Populated if QUERY_METADATA is specified in the request. + ResultTabs []ResultTab `json:"resultTabs,omitempty"` + // The unique IDs of the result tabs to which this response belongs. + ResultTabIds []string `json:"resultTabIds,omitempty"` + ResultsDescription *ResultsDescription `json:"resultsDescription,omitempty"` + // The actual applied facet filters based on the operators and facetFilters in the query. Useful for mapping typed operators to visual facets. + RewrittenFacetFilters []FacetFilter `json:"rewrittenFacetFilters,omitempty"` + // Cursor that indicates the start of the next page of results. To be passed in "more" requests for this query. + Cursor *string `json:"cursor,omitempty"` + // Whether more results are available. Use cursor to retrieve them. + HasMoreResults *bool `json:"hasMoreResults,omitempty"` +} + +func (o *SearchResponse) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *SearchResponse) GetSessionInfo() *SessionInfo { + if o == nil { + return nil + } + return o.SessionInfo +} + +func (o *SearchResponse) GetResults() []SearchResult { + if o == nil { + return nil + } + return o.Results +} + +func (o *SearchResponse) GetStructuredResults() []StructuredResult { + if o == nil { + return nil + } + return o.StructuredResults +} + +func (o *SearchResponse) GetGeneratedQnaResult() *GeneratedQna { + if o == nil { + return nil + } + return o.GeneratedQnaResult +} + +func (o *SearchResponse) GetGleanDataError() *GleanDataError { + if o == nil { + return nil + } + return o.GleanDataError +} + +func (o *SearchResponse) GetRequestID() *string { + if o == nil { + return nil + } + return o.RequestID +} + +func (o *SearchResponse) GetBackendTimeMillis() *int64 { + if o == nil { + return nil + } + return o.BackendTimeMillis +} + +func (o *SearchResponse) GetExperimentIds() []int64 { + if o == nil { + return nil + } + return o.ExperimentIds +} + +func (o *SearchResponse) GetMetadata() *SearchResponseMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *SearchResponse) GetFacetResults() []FacetResult { + if o == nil { + return nil + } + return o.FacetResults +} + +func (o *SearchResponse) GetResultTabs() []ResultTab { + if o == nil { + return nil + } + return o.ResultTabs +} + +func (o *SearchResponse) GetResultTabIds() []string { + if o == nil { + return nil + } + return o.ResultTabIds +} + +func (o *SearchResponse) GetResultsDescription() *ResultsDescription { + if o == nil { + return nil + } + return o.ResultsDescription +} + +func (o *SearchResponse) GetRewrittenFacetFilters() []FacetFilter { + if o == nil { + return nil + } + return o.RewrittenFacetFilters +} + +func (o *SearchResponse) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *SearchResponse) GetHasMoreResults() *bool { + if o == nil { + return nil + } + return o.HasMoreResults +} diff --git a/tests/mockserver/internal/sdk/models/components/searchresponsemetadata.go b/tests/mockserver/internal/sdk/models/components/searchresponsemetadata.go new file mode 100644 index 00000000..0d64b4b3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchresponsemetadata.go @@ -0,0 +1,111 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchResponseMetadata struct { + // A cleaned up or updated version of the query to be displayed in the query box. Useful for mapping visual facets to search operators. + RewrittenQuery *string `json:"rewrittenQuery,omitempty"` + // The actual query used to perform search and return results. + SearchedQuery *string `json:"searchedQuery,omitempty"` + // The bolded ranges within the searched query. + SearchedQueryRanges []TextRange `json:"searchedQueryRanges,omitempty"` + // The query text sent by the client in the request. + OriginalQuery *string `json:"originalQuery,omitempty"` + QuerySuggestion *QuerySuggestion `json:"querySuggestion,omitempty"` + AdditionalQuerySuggestions *QuerySuggestionList `json:"additionalQuerySuggestions,omitempty"` + // A list of terms that were negated when processing the query. + NegatedTerms []string `json:"negatedTerms,omitempty"` + // A different query was performed than the one requested. + ModifiedQueryWasUsed *bool `json:"modifiedQueryWasUsed,omitempty"` + // No results were found for the original query. The usage of this bit in conjunction with modifiedQueryWasUsed will dictate whether the full page replacement is 0-result or few-result based. + OriginalQueryHadNoResults *bool `json:"originalQueryHadNoResults,omitempty"` + SearchWarning *SearchWarning `json:"searchWarning,omitempty"` + // Whether the query triggered expert detection results in the People tab. + TriggeredExpertDetection *bool `json:"triggeredExpertDetection,omitempty"` + // Whether the query was modified to remove quotes + IsNoQuotesSuggestion *bool `json:"isNoQuotesSuggestion,omitempty"` +} + +func (o *SearchResponseMetadata) GetRewrittenQuery() *string { + if o == nil { + return nil + } + return o.RewrittenQuery +} + +func (o *SearchResponseMetadata) GetSearchedQuery() *string { + if o == nil { + return nil + } + return o.SearchedQuery +} + +func (o *SearchResponseMetadata) GetSearchedQueryRanges() []TextRange { + if o == nil { + return nil + } + return o.SearchedQueryRanges +} + +func (o *SearchResponseMetadata) GetOriginalQuery() *string { + if o == nil { + return nil + } + return o.OriginalQuery +} + +func (o *SearchResponseMetadata) GetQuerySuggestion() *QuerySuggestion { + if o == nil { + return nil + } + return o.QuerySuggestion +} + +func (o *SearchResponseMetadata) GetAdditionalQuerySuggestions() *QuerySuggestionList { + if o == nil { + return nil + } + return o.AdditionalQuerySuggestions +} + +func (o *SearchResponseMetadata) GetNegatedTerms() []string { + if o == nil { + return nil + } + return o.NegatedTerms +} + +func (o *SearchResponseMetadata) GetModifiedQueryWasUsed() *bool { + if o == nil { + return nil + } + return o.ModifiedQueryWasUsed +} + +func (o *SearchResponseMetadata) GetOriginalQueryHadNoResults() *bool { + if o == nil { + return nil + } + return o.OriginalQueryHadNoResults +} + +func (o *SearchResponseMetadata) GetSearchWarning() *SearchWarning { + if o == nil { + return nil + } + return o.SearchWarning +} + +func (o *SearchResponseMetadata) GetTriggeredExpertDetection() *bool { + if o == nil { + return nil + } + return o.TriggeredExpertDetection +} + +func (o *SearchResponseMetadata) GetIsNoQuotesSuggestion() *bool { + if o == nil { + return nil + } + return o.IsNoQuotesSuggestion +} diff --git a/tests/mockserver/internal/sdk/models/components/searchresult.go b/tests/mockserver/internal/sdk/models/components/searchresult.go new file mode 100644 index 00000000..074430df --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchresult.go @@ -0,0 +1,191 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchResult struct { + // An array of entities in the work graph retrieved via a data request. + StructuredResults []StructuredResult `json:"structuredResults,omitempty"` + // An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` + Document *Document `json:"document,omitempty"` + Title *string `json:"title,omitempty"` + URL string `json:"url"` + // A deep link, if available, into the datasource's native application for the user's platform (e.g. slack://...). + NativeAppURL *string `json:"nativeAppUrl,omitempty"` + // Text content from the result document which contains search query terms, if available. + Snippets []SearchResultSnippet `json:"snippets,omitempty"` + // The full body text of the result if not already contained in the snippets. Only populated for conversation results (e.g. results from a messaging app such as Slack). + FullText *string `json:"fullText,omitempty"` + // The full body text of the result if not already contained in the snippets; each item in the array represents a separate line in the original text. Only populated for conversation results (e.g. results from a messaging app such as Slack). + FullTextList []string `json:"fullTextList,omitempty"` + // A list of results related to this search result. Eg. for conversation results it contains individual messages from the conversation document which will be shown on SERP. + RelatedResults []RelatedDocuments `json:"relatedResults,omitempty"` + // A list of results that should be displayed as associated with this result. + ClusteredResults []SearchResult `json:"clusteredResults,omitempty"` + // A list of results that should be displayed as associated with this result. + AllClusteredResults []ClusterGroup `json:"allClusteredResults,omitempty"` + // The total number of attachments. + AttachmentCount *int64 `json:"attachmentCount,omitempty"` + // A (potentially partial) list of results representing documents attached to the main result document. + Attachments []SearchResult `json:"attachments,omitempty"` + // A list of results that should be displayed as backlinks of this result in reverse chronological order. + BacklinkResults []SearchResult `json:"backlinkResults,omitempty"` + // The reason for inclusion of clusteredResults. + ClusterType *ClusterTypeEnum `json:"clusterType,omitempty"` + MustIncludeSuggestions *QuerySuggestionList `json:"mustIncludeSuggestions,omitempty"` + QuerySuggestion *QuerySuggestion `json:"querySuggestion,omitempty"` + // The level of visual distinction that should be given to a result. + // + Prominence *SearchResultProminenceEnum `json:"prominence,omitempty"` + // Additional context for the relationship between the result and the document it's attached to. + AttachmentContext *string `json:"attachmentContext,omitempty"` + // A list of pins associated with this search result. + Pins []PinDocument `json:"pins,omitempty"` +} + +func (o *SearchResult) GetStructuredResults() []StructuredResult { + if o == nil { + return nil + } + return o.StructuredResults +} + +func (o *SearchResult) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *SearchResult) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} + +func (o *SearchResult) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *SearchResult) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +func (o *SearchResult) GetNativeAppURL() *string { + if o == nil { + return nil + } + return o.NativeAppURL +} + +func (o *SearchResult) GetSnippets() []SearchResultSnippet { + if o == nil { + return nil + } + return o.Snippets +} + +func (o *SearchResult) GetFullText() *string { + if o == nil { + return nil + } + return o.FullText +} + +func (o *SearchResult) GetFullTextList() []string { + if o == nil { + return nil + } + return o.FullTextList +} + +func (o *SearchResult) GetRelatedResults() []RelatedDocuments { + if o == nil { + return nil + } + return o.RelatedResults +} + +func (o *SearchResult) GetClusteredResults() []SearchResult { + if o == nil { + return nil + } + return o.ClusteredResults +} + +func (o *SearchResult) GetAllClusteredResults() []ClusterGroup { + if o == nil { + return nil + } + return o.AllClusteredResults +} + +func (o *SearchResult) GetAttachmentCount() *int64 { + if o == nil { + return nil + } + return o.AttachmentCount +} + +func (o *SearchResult) GetAttachments() []SearchResult { + if o == nil { + return nil + } + return o.Attachments +} + +func (o *SearchResult) GetBacklinkResults() []SearchResult { + if o == nil { + return nil + } + return o.BacklinkResults +} + +func (o *SearchResult) GetClusterType() *ClusterTypeEnum { + if o == nil { + return nil + } + return o.ClusterType +} + +func (o *SearchResult) GetMustIncludeSuggestions() *QuerySuggestionList { + if o == nil { + return nil + } + return o.MustIncludeSuggestions +} + +func (o *SearchResult) GetQuerySuggestion() *QuerySuggestion { + if o == nil { + return nil + } + return o.QuerySuggestion +} + +func (o *SearchResult) GetProminence() *SearchResultProminenceEnum { + if o == nil { + return nil + } + return o.Prominence +} + +func (o *SearchResult) GetAttachmentContext() *string { + if o == nil { + return nil + } + return o.AttachmentContext +} + +func (o *SearchResult) GetPins() []PinDocument { + if o == nil { + return nil + } + return o.Pins +} diff --git a/tests/mockserver/internal/sdk/models/components/searchresultprominenceenum.go b/tests/mockserver/internal/sdk/models/components/searchresultprominenceenum.go new file mode 100644 index 00000000..789b4f27 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchresultprominenceenum.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// SearchResultProminenceEnum - The level of visual distinction that should be given to a result. +type SearchResultProminenceEnum string + +const ( + SearchResultProminenceEnumHero SearchResultProminenceEnum = "HERO" + SearchResultProminenceEnumPromoted SearchResultProminenceEnum = "PROMOTED" + SearchResultProminenceEnumStandard SearchResultProminenceEnum = "STANDARD" +) + +func (e SearchResultProminenceEnum) ToPointer() *SearchResultProminenceEnum { + return &e +} +func (e *SearchResultProminenceEnum) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "HERO": + fallthrough + case "PROMOTED": + fallthrough + case "STANDARD": + *e = SearchResultProminenceEnum(v) + return nil + default: + return fmt.Errorf("invalid value for SearchResultProminenceEnum: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/searchresultsnippet.go b/tests/mockserver/internal/sdk/models/components/searchresultsnippet.go new file mode 100644 index 00000000..02eeda63 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchresultsnippet.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SearchResultSnippet struct { + // A matching snippet from the document. Query term matches are marked by the unicode characters uE006 and uE007. + Snippet string `json:"snippet"` + // The mime type of the snippets, currently either text/plain or text/html. + MimeType *string `json:"mimeType,omitempty"` + // A matching snippet from the document with no highlights. + Text *string `json:"text,omitempty"` + // Used for sorting based off the snippet's location within all_snippetable_text + SnippetTextOrdering *int64 `json:"snippetTextOrdering,omitempty"` + // The bolded ranges within text. + Ranges []TextRange `json:"ranges,omitempty"` + // A URL, generated based on availability, that links to the position of the snippet text or to the nearest header above the snippet text. + URL *string `json:"url,omitempty"` +} + +func (o *SearchResultSnippet) GetSnippet() string { + if o == nil { + return "" + } + return o.Snippet +} + +func (o *SearchResultSnippet) GetMimeType() *string { + if o == nil { + return nil + } + return o.MimeType +} + +func (o *SearchResultSnippet) GetText() *string { + if o == nil { + return nil + } + return o.Text +} + +func (o *SearchResultSnippet) GetSnippetTextOrdering() *int64 { + if o == nil { + return nil + } + return o.SnippetTextOrdering +} + +func (o *SearchResultSnippet) GetRanges() []TextRange { + if o == nil { + return nil + } + return o.Ranges +} + +func (o *SearchResultSnippet) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} diff --git a/tests/mockserver/internal/sdk/models/components/searchwarning.go b/tests/mockserver/internal/sdk/models/components/searchwarning.go new file mode 100644 index 00000000..131f65a7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/searchwarning.go @@ -0,0 +1,89 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// WarningType - The type of the warning. +type WarningType string + +const ( + WarningTypeLongQuery WarningType = "LONG_QUERY" + WarningTypeQuotedPunctuation WarningType = "QUOTED_PUNCTUATION" + WarningTypePunctuationOnly WarningType = "PUNCTUATION_ONLY" + WarningTypeCopypastedQuotes WarningType = "COPYPASTED_QUOTES" + WarningTypeInvalidOperator WarningType = "INVALID_OPERATOR" + WarningTypeMaybeInvalidFacetQuery WarningType = "MAYBE_INVALID_FACET_QUERY" + WarningTypeTooManyDatasourceGroups WarningType = "TOO_MANY_DATASOURCE_GROUPS" +) + +func (e WarningType) ToPointer() *WarningType { + return &e +} +func (e *WarningType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "LONG_QUERY": + fallthrough + case "QUOTED_PUNCTUATION": + fallthrough + case "PUNCTUATION_ONLY": + fallthrough + case "COPYPASTED_QUOTES": + fallthrough + case "INVALID_OPERATOR": + fallthrough + case "MAYBE_INVALID_FACET_QUERY": + fallthrough + case "TOO_MANY_DATASOURCE_GROUPS": + *e = WarningType(v) + return nil + default: + return fmt.Errorf("invalid value for WarningType: %v", v) + } +} + +type SearchWarning struct { + // The type of the warning. + WarningType WarningType `json:"warningType"` + // The last term we considered in the user's long query. + LastUsedTerm *string `json:"lastUsedTerm,omitempty"` + // The query after ignoring/removing quotes. + QuotesIgnoredQuery *string `json:"quotesIgnoredQuery,omitempty"` + // A list of query terms that were ignored when generating search results, if any. For example, terms containing invalid filters such as "updated:invalid_date" will be ignored. + IgnoredTerms []string `json:"ignoredTerms,omitempty"` +} + +func (o *SearchWarning) GetWarningType() WarningType { + if o == nil { + return WarningType("") + } + return o.WarningType +} + +func (o *SearchWarning) GetLastUsedTerm() *string { + if o == nil { + return nil + } + return o.LastUsedTerm +} + +func (o *SearchWarning) GetQuotesIgnoredQuery() *string { + if o == nil { + return nil + } + return o.QuotesIgnoredQuery +} + +func (o *SearchWarning) GetIgnoredTerms() []string { + if o == nil { + return nil + } + return o.IgnoredTerms +} diff --git a/tests/mockserver/internal/sdk/models/components/security.go b/tests/mockserver/internal/sdk/models/components/security.go new file mode 100644 index 00000000..bc7c1954 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/security.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Security struct { + APIToken string `security:"scheme,type=http,subtype=bearer,name=Authorization"` +} + +func (o *Security) GetAPIToken() string { + if o == nil { + return "" + } + return o.APIToken +} diff --git a/tests/mockserver/internal/sdk/models/components/seenfeedbackinfo.go b/tests/mockserver/internal/sdk/models/components/seenfeedbackinfo.go new file mode 100644 index 00000000..c1aa85e9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/seenfeedbackinfo.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SeenFeedbackInfo struct { + // The confidence of the user seeing the object is high because they explicitly interacted with it e.g. answer impression in SERP with additional user interaction. + IsExplicit *bool `json:"isExplicit,omitempty"` +} + +func (o *SeenFeedbackInfo) GetIsExplicit() *bool { + if o == nil { + return nil + } + return o.IsExplicit +} diff --git a/tests/mockserver/internal/sdk/models/components/sensitivecontentoptions.go b/tests/mockserver/internal/sdk/models/components/sensitivecontentoptions.go new file mode 100644 index 00000000..d08baa0c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/sensitivecontentoptions.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// SensitiveContentOptions - Options for defining sensitive content within scanned documents. +type SensitiveContentOptions struct { + // Predefined categories of terms to consider as sensitive content. See https://cloud.google.com/dlp/docs/infotypes-reference for available types. + SensitiveInfoTypes []SensitiveInfoType `json:"sensitiveInfoTypes,omitempty"` + // list of words and phrases to consider as sensitive content + SensitiveTerms []SensitiveExpression `json:"sensitiveTerms,omitempty"` + // list of regular expressions to consider as sensitive content + SensitiveRegexes []SensitiveExpression `json:"sensitiveRegexes,omitempty"` +} + +func (o *SensitiveContentOptions) GetSensitiveInfoTypes() []SensitiveInfoType { + if o == nil { + return nil + } + return o.SensitiveInfoTypes +} + +func (o *SensitiveContentOptions) GetSensitiveTerms() []SensitiveExpression { + if o == nil { + return nil + } + return o.SensitiveTerms +} + +func (o *SensitiveContentOptions) GetSensitiveRegexes() []SensitiveExpression { + if o == nil { + return nil + } + return o.SensitiveRegexes +} diff --git a/tests/mockserver/internal/sdk/models/components/sensitiveexpression.go b/tests/mockserver/internal/sdk/models/components/sensitiveexpression.go new file mode 100644 index 00000000..a38113a3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/sensitiveexpression.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SensitiveExpression struct { + // Sensitive word, phrase, or regular expression. + Expression *string `json:"expression,omitempty"` + // Zero to three proximate regular expressions necessary to consider an expression as sensitive content. + Hotwords []Hotword `json:"hotwords,omitempty"` +} + +func (o *SensitiveExpression) GetExpression() *string { + if o == nil { + return nil + } + return o.Expression +} + +func (o *SensitiveExpression) GetHotwords() []Hotword { + if o == nil { + return nil + } + return o.Hotwords +} diff --git a/tests/mockserver/internal/sdk/models/components/sensitiveinfotype.go b/tests/mockserver/internal/sdk/models/components/sensitiveinfotype.go new file mode 100644 index 00000000..683a1e84 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/sensitiveinfotype.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// LikelihoodThreshold +// +// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. +type LikelihoodThreshold string + +const ( + LikelihoodThresholdLikely LikelihoodThreshold = "LIKELY" + LikelihoodThresholdVeryLikely LikelihoodThreshold = "VERY_LIKELY" +) + +func (e LikelihoodThreshold) ToPointer() *LikelihoodThreshold { + return &e +} +func (e *LikelihoodThreshold) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "LIKELY": + fallthrough + case "VERY_LIKELY": + *e = LikelihoodThreshold(v) + return nil + default: + return fmt.Errorf("invalid value for LikelihoodThreshold: %v", v) + } +} + +type SensitiveInfoType struct { + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + LikelihoodThreshold *LikelihoodThreshold `json:"likelihoodThreshold,omitempty"` + // Text representation of an info-type to scan for. + InfoType *string `json:"infoType,omitempty"` +} + +func (o *SensitiveInfoType) GetLikelihoodThreshold() *LikelihoodThreshold { + if o == nil { + return nil + } + return o.LikelihoodThreshold +} + +func (o *SensitiveInfoType) GetInfoType() *string { + if o == nil { + return nil + } + return o.InfoType +} diff --git a/tests/mockserver/internal/sdk/models/components/sessioninfo.go b/tests/mockserver/internal/sdk/models/components/sessioninfo.go new file mode 100644 index 00000000..769e9308 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/sessioninfo.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type SessionInfo struct { + // A unique token for this session. A new session (and token) is created when the user issues a request from a new tab or when our server hasn't seen activity for more than 10 minutes from a tab. + SessionTrackingToken *string `json:"sessionTrackingToken,omitempty"` + // A unique id for all requests a user makes from a given tab, no matter how far apart. A new tab id is only generated when a user issues a request from a new tab. + TabID *string `json:"tabId,omitempty"` + // The last time the server saw this token. + LastSeen *time.Time `json:"lastSeen,omitempty"` + // The last query seen by the server. + LastQuery *string `json:"lastQuery,omitempty"` +} + +func (s SessionInfo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SessionInfo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + return err + } + return nil +} + +func (o *SessionInfo) GetSessionTrackingToken() *string { + if o == nil { + return nil + } + return o.SessionTrackingToken +} + +func (o *SessionInfo) GetTabID() *string { + if o == nil { + return nil + } + return o.TabID +} + +func (o *SessionInfo) GetLastSeen() *time.Time { + if o == nil { + return nil + } + return o.LastSeen +} + +func (o *SessionInfo) GetLastQuery() *string { + if o == nil { + return nil + } + return o.LastQuery +} diff --git a/tests/mockserver/internal/sdk/models/components/share.go b/tests/mockserver/internal/sdk/models/components/share.go new file mode 100644 index 00000000..9473f79d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/share.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Share - Search endpoint will only fill out numDays ago since that's all we need to display shared badge; docmetadata endpoint will fill out all the fields so that we can display shared badge tooltip +type Share struct { + // The number of days that has passed since the share happened + NumDaysAgo int64 `json:"numDaysAgo"` + Sharer *Person `json:"sharer,omitempty"` + SharingDocument *Document `json:"sharingDocument,omitempty"` +} + +func (o *Share) GetNumDaysAgo() int64 { + if o == nil { + return 0 + } + return o.NumDaysAgo +} + +func (o *Share) GetSharer() *Person { + if o == nil { + return nil + } + return o.Sharer +} + +func (o *Share) GetSharingDocument() *Document { + if o == nil { + return nil + } + return o.SharingDocument +} diff --git a/tests/mockserver/internal/sdk/models/components/sharingoptions.go b/tests/mockserver/internal/sdk/models/components/sharingoptions.go new file mode 100644 index 00000000..a290b453 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/sharingoptions.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// SharingOptions - Controls how "shared" a document must be to get picked for scans. +type SharingOptions struct { + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Enabled *bool `json:"enabled,omitempty"` + // The minimum number of users the document is shared with. + Threshold *int64 `json:"threshold,omitempty"` + // Documents will be filtered based on how many people have access to it. + ThresholdEnabled *bool `json:"thresholdEnabled,omitempty"` + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + AnyoneWithLinkEnabled *bool `json:"anyoneWithLinkEnabled,omitempty"` + // Only users within the organization can access the document. + AnyoneInternalEnabled *bool `json:"anyoneInternalEnabled,omitempty"` + // Anyone on the internet can access the document. + AnonymousAccessEnabled *bool `json:"anonymousAccessEnabled,omitempty"` + // Enable user access check + UserAccessEnabled *bool `json:"userAccessEnabled,omitempty"` + // Any one of the specified users can access the document. + UserIds []string `json:"userIds,omitempty"` +} + +func (o *SharingOptions) GetEnabled() *bool { + if o == nil { + return nil + } + return o.Enabled +} + +func (o *SharingOptions) GetThreshold() *int64 { + if o == nil { + return nil + } + return o.Threshold +} + +func (o *SharingOptions) GetThresholdEnabled() *bool { + if o == nil { + return nil + } + return o.ThresholdEnabled +} + +func (o *SharingOptions) GetAnyoneWithLinkEnabled() *bool { + if o == nil { + return nil + } + return o.AnyoneWithLinkEnabled +} + +func (o *SharingOptions) GetAnyoneInternalEnabled() *bool { + if o == nil { + return nil + } + return o.AnyoneInternalEnabled +} + +func (o *SharingOptions) GetAnonymousAccessEnabled() *bool { + if o == nil { + return nil + } + return o.AnonymousAccessEnabled +} + +func (o *SharingOptions) GetUserAccessEnabled() *bool { + if o == nil { + return nil + } + return o.UserAccessEnabled +} + +func (o *SharingOptions) GetUserIds() []string { + if o == nil { + return nil + } + return o.UserIds +} diff --git a/tests/mockserver/internal/sdk/models/components/shortcut.go b/tests/mockserver/internal/sdk/models/components/shortcut.go new file mode 100644 index 00000000..625c7659 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/shortcut.go @@ -0,0 +1,216 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type Shortcut struct { + // The opaque id of the user generated content. + ID *int64 `json:"id,omitempty"` + // Link text following go/ prefix as entered by the user. + InputAlias string `json:"inputAlias"` + // Destination URL for the shortcut. + DestinationURL *string `json:"destinationUrl,omitempty"` + // Glean Document ID for the URL, if known. + DestinationDocumentID *string `json:"destinationDocumentId,omitempty"` + // A short, plain text blurb to help people understand the intent of the shortcut. + Description *string `json:"description,omitempty"` + // Whether this shortcut is unlisted or not. Unlisted shortcuts are visible to author + admins only. + Unlisted *bool `json:"unlisted,omitempty"` + // For variable shortcuts, contains the URL template; note, `destinationUrl` contains default URL. + URLTemplate *string `json:"urlTemplate,omitempty"` + // A list of user roles added for the Shortcut. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of user roles removed for the Shortcut. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + CreatedBy *Person `json:"createdBy,omitempty"` + // The time the shortcut was created in ISO format (ISO 8601). + CreateTime *time.Time `json:"createTime,omitempty"` + UpdatedBy *Person `json:"updatedBy,omitempty"` + // The time the shortcut was updated in ISO format (ISO 8601). + UpdateTime *time.Time `json:"updateTime,omitempty"` + DestinationDocument *Document `json:"destinationDocument,omitempty"` + // The URL from which the user is then redirected to the destination URL. Full replacement for https://go/. + IntermediateURL *string `json:"intermediateUrl,omitempty"` + // The part of the shortcut preceding the input alias when used for showing shortcuts to users. Should end with "/". e.g. "go/" for native shortcuts. + ViewPrefix *string `json:"viewPrefix,omitempty"` + // Indicates whether a shortcut is native or external. + IsExternal *bool `json:"isExternal,omitempty"` + // The URL using which the user can access the edit page of the shortcut. + EditURL *string `json:"editUrl,omitempty"` + // canonical link text following go/ prefix where hyphen/underscore is removed. + Alias *string `json:"alias,omitempty"` + // Title for the Go Link + Title *string `json:"title,omitempty"` + // A list of user roles for the Go Link. + Roles []UserRoleSpecification `json:"roles,omitempty"` +} + +func (s Shortcut) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *Shortcut) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Shortcut) GetID() *int64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *Shortcut) GetInputAlias() string { + if o == nil { + return "" + } + return o.InputAlias +} + +func (o *Shortcut) GetDestinationURL() *string { + if o == nil { + return nil + } + return o.DestinationURL +} + +func (o *Shortcut) GetDestinationDocumentID() *string { + if o == nil { + return nil + } + return o.DestinationDocumentID +} + +func (o *Shortcut) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *Shortcut) GetUnlisted() *bool { + if o == nil { + return nil + } + return o.Unlisted +} + +func (o *Shortcut) GetURLTemplate() *string { + if o == nil { + return nil + } + return o.URLTemplate +} + +func (o *Shortcut) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *Shortcut) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} + +func (o *Shortcut) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *Shortcut) GetCreatedBy() *Person { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *Shortcut) GetCreateTime() *time.Time { + if o == nil { + return nil + } + return o.CreateTime +} + +func (o *Shortcut) GetUpdatedBy() *Person { + if o == nil { + return nil + } + return o.UpdatedBy +} + +func (o *Shortcut) GetUpdateTime() *time.Time { + if o == nil { + return nil + } + return o.UpdateTime +} + +func (o *Shortcut) GetDestinationDocument() *Document { + if o == nil { + return nil + } + return o.DestinationDocument +} + +func (o *Shortcut) GetIntermediateURL() *string { + if o == nil { + return nil + } + return o.IntermediateURL +} + +func (o *Shortcut) GetViewPrefix() *string { + if o == nil { + return nil + } + return o.ViewPrefix +} + +func (o *Shortcut) GetIsExternal() *bool { + if o == nil { + return nil + } + return o.IsExternal +} + +func (o *Shortcut) GetEditURL() *string { + if o == nil { + return nil + } + return o.EditURL +} + +func (o *Shortcut) GetAlias() *string { + if o == nil { + return nil + } + return o.Alias +} + +func (o *Shortcut) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Shortcut) GetRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.Roles +} diff --git a/tests/mockserver/internal/sdk/models/components/shortcuterror.go b/tests/mockserver/internal/sdk/models/components/shortcuterror.go new file mode 100644 index 00000000..5ecd3e9e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/shortcuterror.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type ShortcutErrorErrorType string + +const ( + ShortcutErrorErrorTypeNoPermission ShortcutErrorErrorType = "NO_PERMISSION" + ShortcutErrorErrorTypeInvalidID ShortcutErrorErrorType = "INVALID_ID" + ShortcutErrorErrorTypeExistingShortcut ShortcutErrorErrorType = "EXISTING_SHORTCUT" + ShortcutErrorErrorTypeInvalidChars ShortcutErrorErrorType = "INVALID_CHARS" +) + +func (e ShortcutErrorErrorType) ToPointer() *ShortcutErrorErrorType { + return &e +} +func (e *ShortcutErrorErrorType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NO_PERMISSION": + fallthrough + case "INVALID_ID": + fallthrough + case "EXISTING_SHORTCUT": + fallthrough + case "INVALID_CHARS": + *e = ShortcutErrorErrorType(v) + return nil + default: + return fmt.Errorf("invalid value for ShortcutErrorErrorType: %v", v) + } +} + +type ShortcutError struct { + ErrorType *ShortcutErrorErrorType `json:"errorType,omitempty"` +} + +func (o *ShortcutError) GetErrorType() *ShortcutErrorErrorType { + if o == nil { + return nil + } + return o.ErrorType +} diff --git a/tests/mockserver/internal/sdk/models/components/shortcutinsight.go b/tests/mockserver/internal/sdk/models/components/shortcutinsight.go new file mode 100644 index 00000000..e4a60038 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/shortcutinsight.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ShortcutInsight struct { + Shortcut Shortcut `json:"shortcut"` + VisitCount *CountInfo `json:"visitCount,omitempty"` + VisitorCount *CountInfo `json:"visitorCount,omitempty"` +} + +func (o *ShortcutInsight) GetShortcut() Shortcut { + if o == nil { + return Shortcut{} + } + return o.Shortcut +} + +func (o *ShortcutInsight) GetVisitCount() *CountInfo { + if o == nil { + return nil + } + return o.VisitCount +} + +func (o *ShortcutInsight) GetVisitorCount() *CountInfo { + if o == nil { + return nil + } + return o.VisitorCount +} diff --git a/tests/mockserver/internal/sdk/models/components/shortcutinsightsresponse.go b/tests/mockserver/internal/sdk/models/components/shortcutinsightsresponse.go new file mode 100644 index 00000000..b2edf8e3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/shortcutinsightsresponse.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ShortcutInsightsResponse struct { + // Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). + LastLogTimestamp *int64 `json:"lastLogTimestamp,omitempty"` + // Insights for shortcuts. + ShortcutInsights []ShortcutInsight `json:"shortcutInsights,omitempty"` + // list of departments applicable for shortcuts tab. + Departments []string `json:"departments,omitempty"` + // Min threshold in number of visitors while populating results, otherwise 0. + MinVisitorThreshold *int64 `json:"minVisitorThreshold,omitempty"` +} + +func (o *ShortcutInsightsResponse) GetLastLogTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastLogTimestamp +} + +func (o *ShortcutInsightsResponse) GetShortcutInsights() []ShortcutInsight { + if o == nil { + return nil + } + return o.ShortcutInsights +} + +func (o *ShortcutInsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} + +func (o *ShortcutInsightsResponse) GetMinVisitorThreshold() *int64 { + if o == nil { + return nil + } + return o.MinVisitorThreshold +} diff --git a/tests/mockserver/internal/sdk/models/components/shortcutmutableproperties.go b/tests/mockserver/internal/sdk/models/components/shortcutmutableproperties.go new file mode 100644 index 00000000..00cb907c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/shortcutmutableproperties.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ShortcutMutableProperties struct { + // Link text following go/ prefix as entered by the user. + InputAlias *string `json:"inputAlias,omitempty"` + // Destination URL for the shortcut. + DestinationURL *string `json:"destinationUrl,omitempty"` + // Glean Document ID for the URL, if known. + DestinationDocumentID *string `json:"destinationDocumentId,omitempty"` + // A short, plain text blurb to help people understand the intent of the shortcut. + Description *string `json:"description,omitempty"` + // Whether this shortcut is unlisted or not. Unlisted shortcuts are visible to author + admins only. + Unlisted *bool `json:"unlisted,omitempty"` + // For variable shortcuts, contains the URL template; note, `destinationUrl` contains default URL. + URLTemplate *string `json:"urlTemplate,omitempty"` + // A list of user roles added for the Shortcut. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of user roles removed for the Shortcut. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` +} + +func (o *ShortcutMutableProperties) GetInputAlias() *string { + if o == nil { + return nil + } + return o.InputAlias +} + +func (o *ShortcutMutableProperties) GetDestinationURL() *string { + if o == nil { + return nil + } + return o.DestinationURL +} + +func (o *ShortcutMutableProperties) GetDestinationDocumentID() *string { + if o == nil { + return nil + } + return o.DestinationDocumentID +} + +func (o *ShortcutMutableProperties) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *ShortcutMutableProperties) GetUnlisted() *bool { + if o == nil { + return nil + } + return o.Unlisted +} + +func (o *ShortcutMutableProperties) GetURLTemplate() *string { + if o == nil { + return nil + } + return o.URLTemplate +} + +func (o *ShortcutMutableProperties) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *ShortcutMutableProperties) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} diff --git a/tests/mockserver/internal/sdk/models/components/shortcutspaginationmetadata.go b/tests/mockserver/internal/sdk/models/components/shortcutspaginationmetadata.go new file mode 100644 index 00000000..6732831e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/shortcutspaginationmetadata.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ShortcutsPaginationMetadata struct { + // Cursor indicates the start of the next page of results + Cursor *string `json:"cursor,omitempty"` + HasNextPage *bool `json:"hasNextPage,omitempty"` + TotalItemCount *int64 `json:"totalItemCount,omitempty"` +} + +func (o *ShortcutsPaginationMetadata) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *ShortcutsPaginationMetadata) GetHasNextPage() *bool { + if o == nil { + return nil + } + return o.HasNextPage +} + +func (o *ShortcutsPaginationMetadata) GetTotalItemCount() *int64 { + if o == nil { + return nil + } + return o.TotalItemCount +} diff --git a/tests/mockserver/internal/sdk/models/components/socialnetwork.go b/tests/mockserver/internal/sdk/models/components/socialnetwork.go new file mode 100644 index 00000000..d632e406 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/socialnetwork.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type SocialNetwork struct { + // Possible values are "twitter", "linkedin". + Name string `json:"name"` + // Human-readable profile name. + ProfileName *string `json:"profileName,omitempty"` + // Link to profile. + ProfileURL string `json:"profileUrl"` +} + +func (o *SocialNetwork) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *SocialNetwork) GetProfileName() *string { + if o == nil { + return nil + } + return o.ProfileName +} + +func (o *SocialNetwork) GetProfileURL() string { + if o == nil { + return "" + } + return o.ProfileURL +} diff --git a/tests/mockserver/internal/sdk/models/components/socialnetworkdefinition.go b/tests/mockserver/internal/sdk/models/components/socialnetworkdefinition.go new file mode 100644 index 00000000..668935e3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/socialnetworkdefinition.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// SocialNetworkDefinition - Employee's social network profile +type SocialNetworkDefinition struct { + // Possible values are "twitter", "linkedin". + Name *string `json:"name,omitempty"` + // Human-readable profile name. + ProfileName *string `json:"profileName,omitempty"` + // Link to profile. + ProfileURL *string `json:"profileUrl,omitempty"` +} + +func (o *SocialNetworkDefinition) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *SocialNetworkDefinition) GetProfileName() *string { + if o == nil { + return nil + } + return o.ProfileName +} + +func (o *SocialNetworkDefinition) GetProfileURL() *string { + if o == nil { + return nil + } + return o.ProfileURL +} diff --git a/tests/mockserver/internal/sdk/models/components/sortoptions.go b/tests/mockserver/internal/sdk/models/components/sortoptions.go new file mode 100644 index 00000000..0f3949f1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/sortoptions.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type OrderBy string + +const ( + OrderByAsc OrderBy = "ASC" + OrderByDesc OrderBy = "DESC" +) + +func (e OrderBy) ToPointer() *OrderBy { + return &e +} +func (e *OrderBy) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ASC": + fallthrough + case "DESC": + *e = OrderBy(v) + return nil + default: + return fmt.Errorf("invalid value for OrderBy: %v", v) + } +} + +type SortOptions struct { + OrderBy *OrderBy `json:"orderBy,omitempty"` + SortBy *string `json:"sortBy,omitempty"` +} + +func (o *SortOptions) GetOrderBy() *OrderBy { + if o == nil { + return nil + } + return o.OrderBy +} + +func (o *SortOptions) GetSortBy() *string { + if o == nil { + return nil + } + return o.SortBy +} diff --git a/tests/mockserver/internal/sdk/models/components/structuredlink.go b/tests/mockserver/internal/sdk/models/components/structuredlink.go new file mode 100644 index 00000000..00f03620 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/structuredlink.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// StructuredLink - The display configuration for a link. +type StructuredLink struct { + // The display name for the link + Name *string `json:"name,omitempty"` + // The URL for the link. + URL *string `json:"url,omitempty"` + // Defines how to render an icon + IconConfig *IconConfig `json:"iconConfig,omitempty"` +} + +func (o *StructuredLink) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *StructuredLink) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *StructuredLink) GetIconConfig() *IconConfig { + if o == nil { + return nil + } + return o.IconConfig +} diff --git a/tests/mockserver/internal/sdk/models/components/structuredlocation.go b/tests/mockserver/internal/sdk/models/components/structuredlocation.go new file mode 100644 index 00000000..83567b11 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/structuredlocation.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// StructuredLocation - Detailed location with information about country, state, city etc. +type StructuredLocation struct { + // Desk number. + DeskLocation *string `json:"deskLocation,omitempty"` + // Location's timezone, e.g. UTC, PST. + Timezone *string `json:"timezone,omitempty"` + // Office address or name. + Address *string `json:"address,omitempty"` + // Name of the city. + City *string `json:"city,omitempty"` + // State code. + State *string `json:"state,omitempty"` + // Region information, e.g. NORAM, APAC. + Region *string `json:"region,omitempty"` + // ZIP Code for the address. + ZipCode *string `json:"zipCode,omitempty"` + // Country name. + Country *string `json:"country,omitempty"` + // Alpha-2 or Alpha-3 ISO 3166 country code, e.g. US or USA. + CountryCode *string `json:"countryCode,omitempty"` +} + +func (o *StructuredLocation) GetDeskLocation() *string { + if o == nil { + return nil + } + return o.DeskLocation +} + +func (o *StructuredLocation) GetTimezone() *string { + if o == nil { + return nil + } + return o.Timezone +} + +func (o *StructuredLocation) GetAddress() *string { + if o == nil { + return nil + } + return o.Address +} + +func (o *StructuredLocation) GetCity() *string { + if o == nil { + return nil + } + return o.City +} + +func (o *StructuredLocation) GetState() *string { + if o == nil { + return nil + } + return o.State +} + +func (o *StructuredLocation) GetRegion() *string { + if o == nil { + return nil + } + return o.Region +} + +func (o *StructuredLocation) GetZipCode() *string { + if o == nil { + return nil + } + return o.ZipCode +} + +func (o *StructuredLocation) GetCountry() *string { + if o == nil { + return nil + } + return o.Country +} + +func (o *StructuredLocation) GetCountryCode() *string { + if o == nil { + return nil + } + return o.CountryCode +} diff --git a/tests/mockserver/internal/sdk/models/components/structuredresult.go b/tests/mockserver/internal/sdk/models/components/structuredresult.go new file mode 100644 index 00000000..4d67fec7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/structuredresult.go @@ -0,0 +1,243 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// Prominence - The level of visual distinction that should be given to a result. +type Prominence string + +const ( + ProminenceHero Prominence = "HERO" + ProminencePromoted Prominence = "PROMOTED" + ProminenceStandard Prominence = "STANDARD" +) + +func (e Prominence) ToPointer() *Prominence { + return &e +} +func (e *Prominence) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "HERO": + fallthrough + case "PROMOTED": + fallthrough + case "STANDARD": + *e = Prominence(v) + return nil + default: + return fmt.Errorf("invalid value for Prominence: %v", v) + } +} + +// StructuredResultSource - Source context for this result. Possible values depend on the result type. +type StructuredResultSource string + +const ( + StructuredResultSourceExpertDetection StructuredResultSource = "EXPERT_DETECTION" + StructuredResultSourceEntityNlq StructuredResultSource = "ENTITY_NLQ" +) + +func (e StructuredResultSource) ToPointer() *StructuredResultSource { + return &e +} +func (e *StructuredResultSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "EXPERT_DETECTION": + fallthrough + case "ENTITY_NLQ": + *e = StructuredResultSource(v) + return nil + default: + return fmt.Errorf("invalid value for StructuredResultSource: %v", v) + } +} + +// StructuredResult - A single object that can support any object in the work graph. Only a single object will be populated. +type StructuredResult struct { + Document *Document `json:"document,omitempty"` + Person *Person `json:"person,omitempty"` + Customer *Customer `json:"customer,omitempty"` + Team *Team `json:"team,omitempty"` + CustomEntity *CustomEntity `json:"customEntity,omitempty"` + Answer *Answer `json:"answer,omitempty"` + ExtractedQnA *ExtractedQnA `json:"extractedQnA,omitempty"` + Meeting *Meeting `json:"meeting,omitempty"` + App *AppResult `json:"app,omitempty"` + Collection *Collection `json:"collection,omitempty"` + AnswerBoard *AnswerBoard `json:"answerBoard,omitempty"` + Code *Code `json:"code,omitempty"` + Shortcut *Shortcut `json:"shortcut,omitempty"` + QuerySuggestions *QuerySuggestionList `json:"querySuggestions,omitempty"` + // A list of documents related to this structured result. + RelatedDocuments []RelatedDocuments `json:"relatedDocuments,omitempty"` + RelatedQuestion *RelatedQuestion `json:"relatedQuestion,omitempty"` + // A disambiguation between multiple entities with the same name + Disambiguation *Disambiguation `json:"disambiguation,omitempty"` + // Any snippets associated to the populated object. + Snippets []SearchResultSnippet `json:"snippets,omitempty"` + // An opaque token that represents this particular result in this particular query. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` + // The level of visual distinction that should be given to a result. + Prominence *Prominence `json:"prominence,omitempty"` + // Source context for this result. Possible values depend on the result type. + Source *StructuredResultSource `json:"source,omitempty"` +} + +func (o *StructuredResult) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} + +func (o *StructuredResult) GetPerson() *Person { + if o == nil { + return nil + } + return o.Person +} + +func (o *StructuredResult) GetCustomer() *Customer { + if o == nil { + return nil + } + return o.Customer +} + +func (o *StructuredResult) GetTeam() *Team { + if o == nil { + return nil + } + return o.Team +} + +func (o *StructuredResult) GetCustomEntity() *CustomEntity { + if o == nil { + return nil + } + return o.CustomEntity +} + +func (o *StructuredResult) GetAnswer() *Answer { + if o == nil { + return nil + } + return o.Answer +} + +func (o *StructuredResult) GetExtractedQnA() *ExtractedQnA { + if o == nil { + return nil + } + return o.ExtractedQnA +} + +func (o *StructuredResult) GetMeeting() *Meeting { + if o == nil { + return nil + } + return o.Meeting +} + +func (o *StructuredResult) GetApp() *AppResult { + if o == nil { + return nil + } + return o.App +} + +func (o *StructuredResult) GetCollection() *Collection { + if o == nil { + return nil + } + return o.Collection +} + +func (o *StructuredResult) GetAnswerBoard() *AnswerBoard { + if o == nil { + return nil + } + return o.AnswerBoard +} + +func (o *StructuredResult) GetCode() *Code { + if o == nil { + return nil + } + return o.Code +} + +func (o *StructuredResult) GetShortcut() *Shortcut { + if o == nil { + return nil + } + return o.Shortcut +} + +func (o *StructuredResult) GetQuerySuggestions() *QuerySuggestionList { + if o == nil { + return nil + } + return o.QuerySuggestions +} + +func (o *StructuredResult) GetRelatedDocuments() []RelatedDocuments { + if o == nil { + return nil + } + return o.RelatedDocuments +} + +func (o *StructuredResult) GetRelatedQuestion() *RelatedQuestion { + if o == nil { + return nil + } + return o.RelatedQuestion +} + +func (o *StructuredResult) GetDisambiguation() *Disambiguation { + if o == nil { + return nil + } + return o.Disambiguation +} + +func (o *StructuredResult) GetSnippets() []SearchResultSnippet { + if o == nil { + return nil + } + return o.Snippets +} + +func (o *StructuredResult) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} + +func (o *StructuredResult) GetProminence() *Prominence { + if o == nil { + return nil + } + return o.Prominence +} + +func (o *StructuredResult) GetSource() *StructuredResultSource { + if o == nil { + return nil + } + return o.Source +} diff --git a/tests/mockserver/internal/sdk/models/components/structuredtext.go b/tests/mockserver/internal/sdk/models/components/structuredtext.go new file mode 100644 index 00000000..0502a822 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/structuredtext.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type StructuredText struct { + Text string `json:"text"` + // An array of objects each of which contains either a string or a link which optionally corresponds to a document. + StructuredList []StructuredTextItem `json:"structuredList,omitempty"` +} + +func (o *StructuredText) GetText() string { + if o == nil { + return "" + } + return o.Text +} + +func (o *StructuredText) GetStructuredList() []StructuredTextItem { + if o == nil { + return nil + } + return o.StructuredList +} diff --git a/tests/mockserver/internal/sdk/models/components/structuredtextitem.go b/tests/mockserver/internal/sdk/models/components/structuredtextitem.go new file mode 100644 index 00000000..684a10cf --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/structuredtextitem.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type StructuredTextItem struct { + Link *string `json:"link,omitempty"` + Document *Document `json:"document,omitempty"` + Text *string `json:"text,omitempty"` + // A single object that can support any object in the work graph. Only a single object will be populated. + StructuredResult *StructuredResult `json:"structuredResult,omitempty"` +} + +func (o *StructuredTextItem) GetLink() *string { + if o == nil { + return nil + } + return o.Link +} + +func (o *StructuredTextItem) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} + +func (o *StructuredTextItem) GetText() *string { + if o == nil { + return nil + } + return o.Text +} + +func (o *StructuredTextItem) GetStructuredResult() *StructuredResult { + if o == nil { + return nil + } + return o.StructuredResult +} diff --git a/tests/mockserver/internal/sdk/models/components/structuredtextmutableproperties.go b/tests/mockserver/internal/sdk/models/components/structuredtextmutableproperties.go new file mode 100644 index 00000000..ab29bfc2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/structuredtextmutableproperties.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type StructuredTextMutableProperties struct { + Text string `json:"text"` +} + +func (o *StructuredTextMutableProperties) GetText() string { + if o == nil { + return "" + } + return o.Text +} diff --git a/tests/mockserver/internal/sdk/models/components/summarizerequest.go b/tests/mockserver/internal/sdk/models/components/summarizerequest.go new file mode 100644 index 00000000..451b202e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/summarizerequest.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// SummarizeRequest - Summary of the document +type SummarizeRequest struct { + // The ISO 8601 timestamp associated with the client request. + Timestamp *time.Time `json:"timestamp,omitempty"` + // Optional query that the summary should be about + Query *string `json:"query,omitempty"` + // Optional length of summary output. If not given, defaults to 500 chars. + PreferredSummaryLength *int64 `json:"preferredSummaryLength,omitempty"` + // Specifications of documents to summarize + DocumentSpecs []DocumentSpecUnion `json:"documentSpecs"` + // An opaque token that represents this particular result. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` +} + +func (s SummarizeRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SummarizeRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + return err + } + return nil +} + +func (o *SummarizeRequest) GetTimestamp() *time.Time { + if o == nil { + return nil + } + return o.Timestamp +} + +func (o *SummarizeRequest) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +func (o *SummarizeRequest) GetPreferredSummaryLength() *int64 { + if o == nil { + return nil + } + return o.PreferredSummaryLength +} + +func (o *SummarizeRequest) GetDocumentSpecs() []DocumentSpecUnion { + if o == nil { + return []DocumentSpecUnion{} + } + return o.DocumentSpecs +} + +func (o *SummarizeRequest) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} diff --git a/tests/mockserver/internal/sdk/models/components/summarizeresponse.go b/tests/mockserver/internal/sdk/models/components/summarizeresponse.go new file mode 100644 index 00000000..b196ab2d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/summarizeresponse.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Error struct { + Message *string `json:"message,omitempty"` +} + +func (o *Error) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +type SummarizeResponse struct { + Error *Error `json:"error,omitempty"` + Summary *Summary `json:"summary,omitempty"` + // An opaque token that represents this summary in this particular query. To be used for /feedback reporting. + TrackingToken *string `json:"trackingToken,omitempty"` +} + +func (o *SummarizeResponse) GetError() *Error { + if o == nil { + return nil + } + return o.Error +} + +func (o *SummarizeResponse) GetSummary() *Summary { + if o == nil { + return nil + } + return o.Summary +} + +func (o *SummarizeResponse) GetTrackingToken() *string { + if o == nil { + return nil + } + return o.TrackingToken +} diff --git a/tests/mockserver/internal/sdk/models/components/summary.go b/tests/mockserver/internal/sdk/models/components/summary.go new file mode 100644 index 00000000..1e715524 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/summary.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Summary struct { + Text *string `json:"text,omitempty"` + // Follow-up prompts based on the summarized doc + FollowUpPrompts []string `json:"followUpPrompts,omitempty"` +} + +func (o *Summary) GetText() *string { + if o == nil { + return nil + } + return o.Text +} + +func (o *Summary) GetFollowUpPrompts() []string { + if o == nil { + return nil + } + return o.FollowUpPrompts +} diff --git a/tests/mockserver/internal/sdk/models/components/team.go b/tests/mockserver/internal/sdk/models/components/team.go new file mode 100644 index 00000000..889ca29a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/team.go @@ -0,0 +1,242 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// TeamStatus - whether this team is fully processed or there are still unprocessed operations that'll affect it +type TeamStatus string + +const ( + TeamStatusProcessed TeamStatus = "PROCESSED" + TeamStatusQueuedForCreation TeamStatus = "QUEUED_FOR_CREATION" + TeamStatusQueuedForDeletion TeamStatus = "QUEUED_FOR_DELETION" +) + +func (e TeamStatus) ToPointer() *TeamStatus { + return &e +} +func (e *TeamStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "PROCESSED": + fallthrough + case "QUEUED_FOR_CREATION": + fallthrough + case "QUEUED_FOR_DELETION": + *e = TeamStatus(v) + return nil + default: + return fmt.Errorf("invalid value for TeamStatus: %v", v) + } +} + +type Team struct { + // A list of objects related to a source object. + RelatedObjects map[string]RelatedObjectEdge `json:"relatedObjects,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // Unique identifier + ID string `json:"id"` + // Team name + Name string `json:"name"` + // A description of the team + Description *string `json:"description,omitempty"` + // Typically the highest level organizational unit; generally applies to bigger companies with multiple distinct businesses. + BusinessUnit *string `json:"businessUnit,omitempty"` + // An organizational unit where everyone has a similar task, e.g. `Engineering`. + Department *string `json:"department,omitempty"` + // A link to the team's photo. + PhotoURL *string `json:"photoUrl,omitempty"` + // A link to the team's banner photo. + BannerURL *string `json:"bannerUrl,omitempty"` + // Link to a team page on the internet or your company's intranet + ExternalLink *string `json:"externalLink,omitempty"` + // The members on this team + Members []PersonToTeamRelationship `json:"members,omitempty"` + // Number of members on this team (recursive; includes all individuals that belong to this team, and all individuals that belong to a subteam within this team) + MemberCount *int64 `json:"memberCount,omitempty"` + // The emails for this team + Emails []TeamEmail `json:"emails,omitempty"` + // Customizable fields for additional team information. + CustomFields []CustomFieldData `json:"customFields,omitempty"` + // The datasource profiles of the team + DatasourceProfiles []DatasourceProfile `json:"datasourceProfiles,omitempty"` + // the data source of the team, e.g. GDRIVE + Datasource *string `json:"datasource,omitempty"` + // For teams created from docs, the doc title. Otherwise empty. + CreatedFrom *string `json:"createdFrom,omitempty"` + // when this team was last updated. + LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"` + // whether this team is fully processed or there are still unprocessed operations that'll affect it + Status *TeamStatus `default:"PROCESSED" json:"status"` + // can this team be deleted. Some manually ingested teams like GCS_CSV or PUSH_API cannot + CanBeDeleted *bool `default:"true" json:"canBeDeleted"` + // The logging id of the team used in scrubbed logs, client analytics, and metrics. + LoggingID *string `json:"loggingId,omitempty"` +} + +func (t Team) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *Team) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Team) GetRelatedObjects() map[string]RelatedObjectEdge { + if o == nil { + return nil + } + return o.RelatedObjects +} + +func (o *Team) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *Team) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *Team) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *Team) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *Team) GetBusinessUnit() *string { + if o == nil { + return nil + } + return o.BusinessUnit +} + +func (o *Team) GetDepartment() *string { + if o == nil { + return nil + } + return o.Department +} + +func (o *Team) GetPhotoURL() *string { + if o == nil { + return nil + } + return o.PhotoURL +} + +func (o *Team) GetBannerURL() *string { + if o == nil { + return nil + } + return o.BannerURL +} + +func (o *Team) GetExternalLink() *string { + if o == nil { + return nil + } + return o.ExternalLink +} + +func (o *Team) GetMembers() []PersonToTeamRelationship { + if o == nil { + return nil + } + return o.Members +} + +func (o *Team) GetMemberCount() *int64 { + if o == nil { + return nil + } + return o.MemberCount +} + +func (o *Team) GetEmails() []TeamEmail { + if o == nil { + return nil + } + return o.Emails +} + +func (o *Team) GetCustomFields() []CustomFieldData { + if o == nil { + return nil + } + return o.CustomFields +} + +func (o *Team) GetDatasourceProfiles() []DatasourceProfile { + if o == nil { + return nil + } + return o.DatasourceProfiles +} + +func (o *Team) GetDatasource() *string { + if o == nil { + return nil + } + return o.Datasource +} + +func (o *Team) GetCreatedFrom() *string { + if o == nil { + return nil + } + return o.CreatedFrom +} + +func (o *Team) GetLastUpdatedAt() *time.Time { + if o == nil { + return nil + } + return o.LastUpdatedAt +} + +func (o *Team) GetStatus() *TeamStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *Team) GetCanBeDeleted() *bool { + if o == nil { + return nil + } + return o.CanBeDeleted +} + +func (o *Team) GetLoggingID() *string { + if o == nil { + return nil + } + return o.LoggingID +} diff --git a/tests/mockserver/internal/sdk/models/components/teamemail.go b/tests/mockserver/internal/sdk/models/components/teamemail.go new file mode 100644 index 00000000..fed529e0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/teamemail.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" +) + +// TeamEmail - Information about a team's email +type TeamEmail struct { + // An email address + Email string `json:"email"` + // An enum of `PRIMARY`, `SECONDARY`, `ONCALL`, `OTHER` + Type *string `default:"OTHER" json:"type"` +} + +func (t TeamEmail) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TeamEmail) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TeamEmail) GetEmail() string { + if o == nil { + return "" + } + return o.Email +} + +func (o *TeamEmail) GetType() *string { + if o == nil { + return nil + } + return o.Type +} diff --git a/tests/mockserver/internal/sdk/models/components/teaminfodefinition.go b/tests/mockserver/internal/sdk/models/components/teaminfodefinition.go new file mode 100644 index 00000000..9dea6e19 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/teaminfodefinition.go @@ -0,0 +1,107 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// TeamInfoDefinition - Information about an employee's team +type TeamInfoDefinition struct { + // The unique ID of the team + ID string `json:"id"` + // Human-readable team name + Name string `json:"name"` + // The description of this team + Description *string `json:"description,omitempty"` + // Typically the highest level organizational unit; generally applies to bigger companies with multiple distinct businesses. + BusinessUnit *string `json:"businessUnit,omitempty"` + // An organizational unit where everyone has a similar task, e.g. `Engineering`. + Department *string `json:"department,omitempty"` + // A link to the team's photo + PhotoURL *string `json:"photoUrl,omitempty"` + // A link to an external team page. If set, team results will link to it. + // + ExternalLink *string `json:"externalLink,omitempty"` + // The emails of the team + Emails []TeamEmail `json:"emails,omitempty"` + // The datasource profiles of the team, e.g. `Slack`,`Github`. + DatasourceProfiles []DatasourceProfile `json:"datasourceProfiles,omitempty"` + // The members of the team + Members []TeamMember `json:"members"` + // List of additional fields with more information about the team. + AdditionalFields []AdditionalFieldDefinition `json:"additionalFields,omitempty"` +} + +func (o *TeamInfoDefinition) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *TeamInfoDefinition) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *TeamInfoDefinition) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *TeamInfoDefinition) GetBusinessUnit() *string { + if o == nil { + return nil + } + return o.BusinessUnit +} + +func (o *TeamInfoDefinition) GetDepartment() *string { + if o == nil { + return nil + } + return o.Department +} + +func (o *TeamInfoDefinition) GetPhotoURL() *string { + if o == nil { + return nil + } + return o.PhotoURL +} + +func (o *TeamInfoDefinition) GetExternalLink() *string { + if o == nil { + return nil + } + return o.ExternalLink +} + +func (o *TeamInfoDefinition) GetEmails() []TeamEmail { + if o == nil { + return nil + } + return o.Emails +} + +func (o *TeamInfoDefinition) GetDatasourceProfiles() []DatasourceProfile { + if o == nil { + return nil + } + return o.DatasourceProfiles +} + +func (o *TeamInfoDefinition) GetMembers() []TeamMember { + if o == nil { + return []TeamMember{} + } + return o.Members +} + +func (o *TeamInfoDefinition) GetAdditionalFields() []AdditionalFieldDefinition { + if o == nil { + return nil + } + return o.AdditionalFields +} diff --git a/tests/mockserver/internal/sdk/models/components/teammember.go b/tests/mockserver/internal/sdk/models/components/teammember.go new file mode 100644 index 00000000..7b846e8e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/teammember.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" +) + +// TeamMember - Information about a team's member +type TeamMember struct { + // The member's email + Email string `json:"email"` + // The member's relationship to the team, an enum of `MEMBER`, `MANAGER`, `LEAD`, `POINT_OF_CONTACT`, `OTHER` + Relationship *string `default:"MEMBER" json:"relationship"` + // The member's start date + JoinDate *types.Date `json:"join_date,omitempty"` +} + +func (t TeamMember) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TeamMember) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TeamMember) GetEmail() string { + if o == nil { + return "" + } + return o.Email +} + +func (o *TeamMember) GetRelationship() *string { + if o == nil { + return nil + } + return o.Relationship +} + +func (o *TeamMember) GetJoinDate() *types.Date { + if o == nil { + return nil + } + return o.JoinDate +} diff --git a/tests/mockserver/internal/sdk/models/components/textrange.go b/tests/mockserver/internal/sdk/models/components/textrange.go new file mode 100644 index 00000000..1d226226 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/textrange.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type TextRangeType string + +const ( + TextRangeTypeBold TextRangeType = "BOLD" + TextRangeTypeCitation TextRangeType = "CITATION" + TextRangeTypeHighlight TextRangeType = "HIGHLIGHT" + TextRangeTypeLink TextRangeType = "LINK" +) + +func (e TextRangeType) ToPointer() *TextRangeType { + return &e +} +func (e *TextRangeType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "BOLD": + fallthrough + case "CITATION": + fallthrough + case "HIGHLIGHT": + fallthrough + case "LINK": + *e = TextRangeType(v) + return nil + default: + return fmt.Errorf("invalid value for TextRangeType: %v", v) + } +} + +// TextRange - A subsection of a given string to which some special formatting should be applied. +type TextRange struct { + // The inclusive start index of the range. + StartIndex int64 `json:"startIndex"` + // The exclusive end index of the range. + EndIndex *int64 `json:"endIndex,omitempty"` + Type *TextRangeType `json:"type,omitempty"` + // The URL associated with the range, if applicable. For example, the linked URL for a LINK range. + URL *string `json:"url,omitempty"` + Document *Document `json:"document,omitempty"` +} + +func (o *TextRange) GetStartIndex() int64 { + if o == nil { + return 0 + } + return o.StartIndex +} + +func (o *TextRange) GetEndIndex() *int64 { + if o == nil { + return nil + } + return o.EndIndex +} + +func (o *TextRange) GetType() *TextRangeType { + if o == nil { + return nil + } + return o.Type +} + +func (o *TextRange) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +func (o *TextRange) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} diff --git a/tests/mockserver/internal/sdk/models/components/thumbnail.go b/tests/mockserver/internal/sdk/models/components/thumbnail.go new file mode 100644 index 00000000..6f97f3ea --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/thumbnail.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Thumbnail struct { + // Photo id if the thumbnail is from splash. + PhotoID *string `json:"photoId,omitempty"` + // Thumbnail URL. This can be user provided image and/or from downloaded images hosted by Glean. + URL *string `json:"url,omitempty"` +} + +func (o *Thumbnail) GetPhotoID() *string { + if o == nil { + return nil + } + return o.PhotoID +} + +func (o *Thumbnail) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} diff --git a/tests/mockserver/internal/sdk/models/components/timeinterval.go b/tests/mockserver/internal/sdk/models/components/timeinterval.go new file mode 100644 index 00000000..48a70efb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/timeinterval.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TimeInterval struct { + // The RFC3339 timestamp formatted start time of this event. + Start string `json:"start"` + // The RFC3339 timestamp formatted end time of this event. + End string `json:"end"` +} + +func (o *TimeInterval) GetStart() string { + if o == nil { + return "" + } + return o.Start +} + +func (o *TimeInterval) GetEnd() string { + if o == nil { + return "" + } + return o.End +} diff --git a/tests/mockserver/internal/sdk/models/components/timepoint.go b/tests/mockserver/internal/sdk/models/components/timepoint.go new file mode 100644 index 00000000..1fa1a072 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/timepoint.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TimePoint struct { + // Epoch seconds. Has precedence over daysFromNow. + EpochSeconds *int64 `json:"epochSeconds,omitempty"` + // The number of days from now. Specification relative to current time. Can be negative. + DaysFromNow *int64 `json:"daysFromNow,omitempty"` +} + +func (o *TimePoint) GetEpochSeconds() *int64 { + if o == nil { + return nil + } + return o.EpochSeconds +} + +func (o *TimePoint) GetDaysFromNow() *int64 { + if o == nil { + return nil + } + return o.DaysFromNow +} diff --git a/tests/mockserver/internal/sdk/models/components/timerange.go b/tests/mockserver/internal/sdk/models/components/timerange.go new file mode 100644 index 00000000..a2493b92 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/timerange.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type TimeRange struct { + // start time of the time range, applicable for the CUSTOM type. + StartTime *time.Time `json:"startTime,omitempty"` + // end time of the time range, applicable for the CUSTOM type. + EndTime *time.Time `json:"endTime,omitempty"` + // The number of days to look back from the current time, applicable for the LAST_N_DAYS type. + LastNDaysValue *int64 `json:"lastNDaysValue,omitempty"` +} + +func (t TimeRange) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TimeRange) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TimeRange) GetStartTime() *time.Time { + if o == nil { + return nil + } + return o.StartTime +} + +func (o *TimeRange) GetEndTime() *time.Time { + if o == nil { + return nil + } + return o.EndTime +} + +func (o *TimeRange) GetLastNDaysValue() *int64 { + if o == nil { + return nil + } + return o.LastNDaysValue +} diff --git a/tests/mockserver/internal/sdk/models/components/tool.go b/tests/mockserver/internal/sdk/models/components/tool.go new file mode 100644 index 00000000..ed0eadfe --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/tool.go @@ -0,0 +1,83 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ToolType - Type of tool (READ, WRITE) +type ToolType string + +const ( + ToolTypeRead ToolType = "READ" + ToolTypeWrite ToolType = "WRITE" +) + +func (e ToolType) ToPointer() *ToolType { + return &e +} +func (e *ToolType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "READ": + fallthrough + case "WRITE": + *e = ToolType(v) + return nil + default: + return fmt.Errorf("invalid value for ToolType: %v", v) + } +} + +type Tool struct { + // Type of tool (READ, WRITE) + Type *ToolType `json:"type,omitempty"` + // Unique identifier for the tool + Name *string `json:"name,omitempty"` + // Human-readable name + DisplayName *string `json:"displayName,omitempty"` + // LLM friendly description of the tool + Description *string `json:"description,omitempty"` + // The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. + Parameters map[string]ToolParameter `json:"parameters,omitempty"` +} + +func (o *Tool) GetType() *ToolType { + if o == nil { + return nil + } + return o.Type +} + +func (o *Tool) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *Tool) GetDisplayName() *string { + if o == nil { + return nil + } + return o.DisplayName +} + +func (o *Tool) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *Tool) GetParameters() map[string]ToolParameter { + if o == nil { + return nil + } + return o.Parameters +} diff --git a/tests/mockserver/internal/sdk/models/components/toolinfo.go b/tests/mockserver/internal/sdk/models/components/toolinfo.go new file mode 100644 index 00000000..dea3298b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/toolinfo.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ToolInfo struct { + // The manifest for a tool that can be used to augment Glean Assistant. + Metadata *ToolMetadata `json:"metadata,omitempty"` + // Parameters supported by the tool. + Parameters map[string]WriteActionParameter `json:"parameters,omitempty"` +} + +func (o *ToolInfo) GetMetadata() *ToolMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *ToolInfo) GetParameters() map[string]WriteActionParameter { + if o == nil { + return nil + } + return o.Parameters +} diff --git a/tests/mockserver/internal/sdk/models/components/toolmetadata.go b/tests/mockserver/internal/sdk/models/components/toolmetadata.go new file mode 100644 index 00000000..ddc888f0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/toolmetadata.go @@ -0,0 +1,316 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// ToolMetadataType - The type of tool. +type ToolMetadataType string + +const ( + ToolMetadataTypeRetrieval ToolMetadataType = "RETRIEVAL" + ToolMetadataTypeAction ToolMetadataType = "ACTION" +) + +func (e ToolMetadataType) ToPointer() *ToolMetadataType { + return &e +} +func (e *ToolMetadataType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "RETRIEVAL": + fallthrough + case "ACTION": + *e = ToolMetadataType(v) + return nil + default: + return fmt.Errorf("invalid value for ToolMetadataType: %v", v) + } +} + +// KnowledgeType - Indicates the kind of knowledge a tool would access or modify. +type KnowledgeType string + +const ( + KnowledgeTypeNeutralKnowledge KnowledgeType = "NEUTRAL_KNOWLEDGE" + KnowledgeTypeCompanyKnowledge KnowledgeType = "COMPANY_KNOWLEDGE" + KnowledgeTypeWorldKnowledge KnowledgeType = "WORLD_KNOWLEDGE" +) + +func (e KnowledgeType) ToPointer() *KnowledgeType { + return &e +} +func (e *KnowledgeType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NEUTRAL_KNOWLEDGE": + fallthrough + case "COMPANY_KNOWLEDGE": + fallthrough + case "WORLD_KNOWLEDGE": + *e = KnowledgeType(v) + return nil + default: + return fmt.Errorf("invalid value for KnowledgeType: %v", v) + } +} + +// WriteActionType - Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. +type WriteActionType string + +const ( + WriteActionTypeRedirect WriteActionType = "REDIRECT" + WriteActionTypeExecution WriteActionType = "EXECUTION" +) + +func (e WriteActionType) ToPointer() *WriteActionType { + return &e +} +func (e *WriteActionType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "REDIRECT": + fallthrough + case "EXECUTION": + *e = WriteActionType(v) + return nil + default: + return fmt.Errorf("invalid value for WriteActionType: %v", v) + } +} + +// AuthType - The type of authentication being used. +// Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. +// 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. +// 'OAUTH_USER' uses individual user tokens for external API calls. +// 'DWD' refers to domain wide delegation. +type AuthType string + +const ( + AuthTypeNone AuthType = "NONE" + AuthTypeOauthUser AuthType = "OAUTH_USER" + AuthTypeOauthAdmin AuthType = "OAUTH_ADMIN" + AuthTypeAPIKey AuthType = "API_KEY" + AuthTypeBasicAuth AuthType = "BASIC_AUTH" + AuthTypeDwd AuthType = "DWD" +) + +func (e AuthType) ToPointer() *AuthType { + return &e +} +func (e *AuthType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "NONE": + fallthrough + case "OAUTH_USER": + fallthrough + case "OAUTH_ADMIN": + fallthrough + case "API_KEY": + fallthrough + case "BASIC_AUTH": + fallthrough + case "DWD": + *e = AuthType(v) + return nil + default: + return fmt.Errorf("invalid value for AuthType: %v", v) + } +} + +// ToolMetadata - The manifest for a tool that can be used to augment Glean Assistant. +type ToolMetadata struct { + // The type of tool. + Type ToolMetadataType `json:"type"` + // Unique identifier for the tool. Name should be understandable by the LLM, and will be used to invoke a tool. + Name string `json:"name"` + // Human understandable name of the tool. Max 50 characters. + DisplayName string `json:"displayName"` + // An opaque id which is unique identifier for the tool. + ToolID *string `json:"toolId,omitempty"` + // Description of the tool meant for a human. + DisplayDescription string `json:"displayDescription"` + // URL used to fetch the logo. + LogoURL *string `json:"logoUrl,omitempty"` + // Name of the generated object. This will be used to indicate to the end user what the generated object contains. + ObjectName *string `json:"objectName,omitempty"` + // Indicates the kind of knowledge a tool would access or modify. + KnowledgeType *KnowledgeType `json:"knowledgeType,omitempty"` + CreatedBy *PersonObject `json:"createdBy,omitempty"` + LastUpdatedBy *PersonObject `json:"lastUpdatedBy,omitempty"` + // The time the tool was created in ISO format (ISO 8601) + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The time the tool was last updated in ISO format (ISO 8601) + LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"` + // Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. + WriteActionType *WriteActionType `json:"writeActionType,omitempty"` + // The type of authentication being used. + // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. + // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. + // 'OAUTH_USER' uses individual user tokens for external API calls. + // 'DWD' refers to domain wide delegation. + // + AuthType *AuthType `json:"authType,omitempty"` + // Config for tool's authentication method. + Auth *AuthConfig `json:"auth,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // Usage instructions for the LLM to use this action. + UsageInstructions *string `json:"usageInstructions,omitempty"` + // Whether this action has been fully configured and validated. + IsSetupFinished *bool `json:"isSetupFinished,omitempty"` +} + +func (t ToolMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ToolMetadata) GetType() ToolMetadataType { + if o == nil { + return ToolMetadataType("") + } + return o.Type +} + +func (o *ToolMetadata) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *ToolMetadata) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *ToolMetadata) GetToolID() *string { + if o == nil { + return nil + } + return o.ToolID +} + +func (o *ToolMetadata) GetDisplayDescription() string { + if o == nil { + return "" + } + return o.DisplayDescription +} + +func (o *ToolMetadata) GetLogoURL() *string { + if o == nil { + return nil + } + return o.LogoURL +} + +func (o *ToolMetadata) GetObjectName() *string { + if o == nil { + return nil + } + return o.ObjectName +} + +func (o *ToolMetadata) GetKnowledgeType() *KnowledgeType { + if o == nil { + return nil + } + return o.KnowledgeType +} + +func (o *ToolMetadata) GetCreatedBy() *PersonObject { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *ToolMetadata) GetLastUpdatedBy() *PersonObject { + if o == nil { + return nil + } + return o.LastUpdatedBy +} + +func (o *ToolMetadata) GetCreatedAt() *time.Time { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *ToolMetadata) GetLastUpdatedAt() *time.Time { + if o == nil { + return nil + } + return o.LastUpdatedAt +} + +func (o *ToolMetadata) GetWriteActionType() *WriteActionType { + if o == nil { + return nil + } + return o.WriteActionType +} + +func (o *ToolMetadata) GetAuthType() *AuthType { + if o == nil { + return nil + } + return o.AuthType +} + +func (o *ToolMetadata) GetAuth() *AuthConfig { + if o == nil { + return nil + } + return o.Auth +} + +func (o *ToolMetadata) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *ToolMetadata) GetUsageInstructions() *string { + if o == nil { + return nil + } + return o.UsageInstructions +} + +func (o *ToolMetadata) GetIsSetupFinished() *bool { + if o == nil { + return nil + } + return o.IsSetupFinished +} diff --git a/tests/mockserver/internal/sdk/models/components/toolparameter.go b/tests/mockserver/internal/sdk/models/components/toolparameter.go new file mode 100644 index 00000000..fd0c3c73 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/toolparameter.go @@ -0,0 +1,109 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ToolParameterType - Parameter type (string, number, boolean, object, array) +type ToolParameterType string + +const ( + ToolParameterTypeString ToolParameterType = "string" + ToolParameterTypeNumber ToolParameterType = "number" + ToolParameterTypeBoolean ToolParameterType = "boolean" + ToolParameterTypeObject ToolParameterType = "object" + ToolParameterTypeArray ToolParameterType = "array" +) + +func (e ToolParameterType) ToPointer() *ToolParameterType { + return &e +} +func (e *ToolParameterType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "string": + fallthrough + case "number": + fallthrough + case "boolean": + fallthrough + case "object": + fallthrough + case "array": + *e = ToolParameterType(v) + return nil + default: + return fmt.Errorf("invalid value for ToolParameterType: %v", v) + } +} + +type ToolParameter struct { + // Parameter type (string, number, boolean, object, array) + Type *ToolParameterType `json:"type,omitempty"` + // The name of the parameter + Name *string `json:"name,omitempty"` + // The description of the parameter + Description *string `json:"description,omitempty"` + // Whether the parameter is required + IsRequired *bool `json:"isRequired,omitempty"` + // The possible values for the parameter. Can contain only primitive values or arrays of primitive values. + PossibleValues []string `json:"possibleValues,omitempty"` + Items *ToolParameter `json:"items,omitempty"` + // When type is 'object', this describes the structure of the object. + Properties map[string]ToolParameter `json:"properties,omitempty"` +} + +func (o *ToolParameter) GetType() *ToolParameterType { + if o == nil { + return nil + } + return o.Type +} + +func (o *ToolParameter) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ToolParameter) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *ToolParameter) GetIsRequired() *bool { + if o == nil { + return nil + } + return o.IsRequired +} + +func (o *ToolParameter) GetPossibleValues() []string { + if o == nil { + return nil + } + return o.PossibleValues +} + +func (o *ToolParameter) GetItems() *ToolParameter { + if o == nil { + return nil + } + return o.Items +} + +func (o *ToolParameter) GetProperties() map[string]ToolParameter { + if o == nil { + return nil + } + return o.Properties +} diff --git a/tests/mockserver/internal/sdk/models/components/toolscallparameter.go b/tests/mockserver/internal/sdk/models/components/toolscallparameter.go new file mode 100644 index 00000000..ddfbe5f9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/toolscallparameter.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ToolsCallParameter struct { + // The name of the parameter + Name string `json:"name"` + // The value of the parameter (for primitive types) + Value string `json:"value"` + // The value of the parameter (for array types) + Items []ToolsCallParameter `json:"items,omitempty"` + // The value of the parameter (for object types) + Properties map[string]ToolsCallParameter `json:"properties,omitempty"` +} + +func (o *ToolsCallParameter) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *ToolsCallParameter) GetValue() string { + if o == nil { + return "" + } + return o.Value +} + +func (o *ToolsCallParameter) GetItems() []ToolsCallParameter { + if o == nil { + return nil + } + return o.Items +} + +func (o *ToolsCallParameter) GetProperties() map[string]ToolsCallParameter { + if o == nil { + return nil + } + return o.Properties +} diff --git a/tests/mockserver/internal/sdk/models/components/toolscallrequest.go b/tests/mockserver/internal/sdk/models/components/toolscallrequest.go new file mode 100644 index 00000000..4678acfc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/toolscallrequest.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ToolsCallRequest struct { + // Required name of the tool to execute + Name string `json:"name"` + // The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. + Parameters map[string]ToolsCallParameter `json:"parameters"` +} + +func (o *ToolsCallRequest) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *ToolsCallRequest) GetParameters() map[string]ToolsCallParameter { + if o == nil { + return map[string]ToolsCallParameter{} + } + return o.Parameters +} diff --git a/tests/mockserver/internal/sdk/models/components/toolscallresponse.go b/tests/mockserver/internal/sdk/models/components/toolscallresponse.go new file mode 100644 index 00000000..03e9af73 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/toolscallresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ToolsCallResponse struct { + // The raw response from the tool + RawResponse map[string]any `json:"rawResponse,omitempty"` + // The error message if applicable + Error *string `json:"error,omitempty"` +} + +func (o *ToolsCallResponse) GetRawResponse() map[string]any { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ToolsCallResponse) GetError() *string { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/toolslistresponse.go b/tests/mockserver/internal/sdk/models/components/toolslistresponse.go new file mode 100644 index 00000000..7a6a8980 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/toolslistresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ToolsListResponse struct { + Tools []Tool `json:"tools,omitempty"` +} + +func (o *ToolsListResponse) GetTools() []Tool { + if o == nil { + return nil + } + return o.Tools +} diff --git a/tests/mockserver/internal/sdk/models/components/ugctype.go b/tests/mockserver/internal/sdk/models/components/ugctype.go new file mode 100644 index 00000000..e1cdc164 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/ugctype.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type UgcType string + +const ( + UgcTypeAnnouncementsType UgcType = "ANNOUNCEMENTS_TYPE" + UgcTypeAnswersType UgcType = "ANSWERS_TYPE" + UgcTypeCollectionsType UgcType = "COLLECTIONS_TYPE" + UgcTypeShortcutsType UgcType = "SHORTCUTS_TYPE" + UgcTypeWorkflowsType UgcType = "WORKFLOWS_TYPE" + UgcTypePromptTemplatesType UgcType = "PROMPT_TEMPLATES_TYPE" +) + +func (e UgcType) ToPointer() *UgcType { + return &e +} +func (e *UgcType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ANNOUNCEMENTS_TYPE": + fallthrough + case "ANSWERS_TYPE": + fallthrough + case "COLLECTIONS_TYPE": + fallthrough + case "SHORTCUTS_TYPE": + fallthrough + case "WORKFLOWS_TYPE": + fallthrough + case "PROMPT_TEMPLATES_TYPE": + *e = UgcType(v) + return nil + default: + return fmt.Errorf("invalid value for UgcType: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/unpin.go b/tests/mockserver/internal/sdk/models/components/unpin.go new file mode 100644 index 00000000..c7d34319 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/unpin.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Unpin struct { + // The opaque id of the pin to be unpinned. + ID *string `json:"id,omitempty"` +} + +func (o *Unpin) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/updateannouncementrequest.go b/tests/mockserver/internal/sdk/models/components/updateannouncementrequest.go new file mode 100644 index 00000000..d12b1add --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updateannouncementrequest.go @@ -0,0 +1,210 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// UpdateAnnouncementRequestChannel - This determines whether this is a Social Feed post or a regular announcement. +type UpdateAnnouncementRequestChannel string + +const ( + UpdateAnnouncementRequestChannelMain UpdateAnnouncementRequestChannel = "MAIN" + UpdateAnnouncementRequestChannelSocialFeed UpdateAnnouncementRequestChannel = "SOCIAL_FEED" +) + +func (e UpdateAnnouncementRequestChannel) ToPointer() *UpdateAnnouncementRequestChannel { + return &e +} +func (e *UpdateAnnouncementRequestChannel) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MAIN": + fallthrough + case "SOCIAL_FEED": + *e = UpdateAnnouncementRequestChannel(v) + return nil + default: + return fmt.Errorf("invalid value for UpdateAnnouncementRequestChannel: %v", v) + } +} + +// UpdateAnnouncementRequestPostType - This determines whether this is an external-link post or a regular announcement post. TEXT - Regular announcement that can contain rich text. LINK - Announcement that is linked to an external site. +type UpdateAnnouncementRequestPostType string + +const ( + UpdateAnnouncementRequestPostTypeText UpdateAnnouncementRequestPostType = "TEXT" + UpdateAnnouncementRequestPostTypeLink UpdateAnnouncementRequestPostType = "LINK" +) + +func (e UpdateAnnouncementRequestPostType) ToPointer() *UpdateAnnouncementRequestPostType { + return &e +} +func (e *UpdateAnnouncementRequestPostType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + fallthrough + case "LINK": + *e = UpdateAnnouncementRequestPostType(v) + return nil + default: + return fmt.Errorf("invalid value for UpdateAnnouncementRequestPostType: %v", v) + } +} + +type UpdateAnnouncementRequest struct { + // The date and time at which the announcement becomes active. + StartTime time.Time `json:"startTime"` + // The date and time at which the announcement expires. + EndTime time.Time `json:"endTime"` + // The headline of the announcement. + Title string `json:"title"` + Body *StructuredText `json:"body,omitempty"` + // An emoji used to indicate the nature of the announcement. + Emoji *string `json:"emoji,omitempty"` + Thumbnail *Thumbnail `json:"thumbnail,omitempty"` + Banner *Thumbnail `json:"banner,omitempty"` + // Filters which restrict who should see the announcement. Values are taken from the corresponding filters in people search. + AudienceFilters []FacetFilter `json:"audienceFilters,omitempty"` + // The Glean Document ID of the source document this Announcement was created from (e.g. Slack thread). + SourceDocumentID *string `json:"sourceDocumentId,omitempty"` + // Whether or not to hide an author attribution. + HideAttribution *bool `json:"hideAttribution,omitempty"` + // This determines whether this is a Social Feed post or a regular announcement. + Channel *UpdateAnnouncementRequestChannel `json:"channel,omitempty"` + // This determines whether this is an external-link post or a regular announcement post. TEXT - Regular announcement that can contain rich text. LINK - Announcement that is linked to an external site. + PostType *UpdateAnnouncementRequestPostType `json:"postType,omitempty"` + // Used by the Social Feed to pin posts to the front of the feed. + IsPrioritized *bool `json:"isPrioritized,omitempty"` + // URL for viewing the announcement. It will be set to document URL for announcements from other datasources e.g. simpplr. Can only be written when channel="SOCIAL_FEED". + ViewURL *string `json:"viewUrl,omitempty"` + // The opaque id of the announcement. + ID int64 `json:"id"` +} + +func (u UpdateAnnouncementRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateAnnouncementRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { + return err + } + return nil +} + +func (o *UpdateAnnouncementRequest) GetStartTime() time.Time { + if o == nil { + return time.Time{} + } + return o.StartTime +} + +func (o *UpdateAnnouncementRequest) GetEndTime() time.Time { + if o == nil { + return time.Time{} + } + return o.EndTime +} + +func (o *UpdateAnnouncementRequest) GetTitle() string { + if o == nil { + return "" + } + return o.Title +} + +func (o *UpdateAnnouncementRequest) GetBody() *StructuredText { + if o == nil { + return nil + } + return o.Body +} + +func (o *UpdateAnnouncementRequest) GetEmoji() *string { + if o == nil { + return nil + } + return o.Emoji +} + +func (o *UpdateAnnouncementRequest) GetThumbnail() *Thumbnail { + if o == nil { + return nil + } + return o.Thumbnail +} + +func (o *UpdateAnnouncementRequest) GetBanner() *Thumbnail { + if o == nil { + return nil + } + return o.Banner +} + +func (o *UpdateAnnouncementRequest) GetAudienceFilters() []FacetFilter { + if o == nil { + return nil + } + return o.AudienceFilters +} + +func (o *UpdateAnnouncementRequest) GetSourceDocumentID() *string { + if o == nil { + return nil + } + return o.SourceDocumentID +} + +func (o *UpdateAnnouncementRequest) GetHideAttribution() *bool { + if o == nil { + return nil + } + return o.HideAttribution +} + +func (o *UpdateAnnouncementRequest) GetChannel() *UpdateAnnouncementRequestChannel { + if o == nil { + return nil + } + return o.Channel +} + +func (o *UpdateAnnouncementRequest) GetPostType() *UpdateAnnouncementRequestPostType { + if o == nil { + return nil + } + return o.PostType +} + +func (o *UpdateAnnouncementRequest) GetIsPrioritized() *bool { + if o == nil { + return nil + } + return o.IsPrioritized +} + +func (o *UpdateAnnouncementRequest) GetViewURL() *string { + if o == nil { + return nil + } + return o.ViewURL +} + +func (o *UpdateAnnouncementRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/updatedlpconfigrequest.go b/tests/mockserver/internal/sdk/models/components/updatedlpconfigrequest.go new file mode 100644 index 00000000..676fbf0c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updatedlpconfigrequest.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateDlpConfigRequest struct { + // Detailed configuration of what documents and sensitive content will be scanned. + Config *DlpConfig `json:"config,omitempty"` + // Only "ONCE" is supported for reports. + Frequency *string `json:"frequency,omitempty"` +} + +func (o *UpdateDlpConfigRequest) GetConfig() *DlpConfig { + if o == nil { + return nil + } + return o.Config +} + +func (o *UpdateDlpConfigRequest) GetFrequency() *string { + if o == nil { + return nil + } + return o.Frequency +} diff --git a/tests/mockserver/internal/sdk/models/components/updatedlpconfigresponse.go b/tests/mockserver/internal/sdk/models/components/updatedlpconfigresponse.go new file mode 100644 index 00000000..7f2dceec --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updatedlpconfigresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateDlpConfigResponse struct { + Result *DlpSimpleResult `json:"result,omitempty"` + // The id of the report that was just created and run. + ReportID *string `json:"reportId,omitempty"` +} + +func (o *UpdateDlpConfigResponse) GetResult() *DlpSimpleResult { + if o == nil { + return nil + } + return o.Result +} + +func (o *UpdateDlpConfigResponse) GetReportID() *string { + if o == nil { + return nil + } + return o.ReportID +} diff --git a/tests/mockserver/internal/sdk/models/components/updatedlpreportrequest.go b/tests/mockserver/internal/sdk/models/components/updatedlpreportrequest.go new file mode 100644 index 00000000..7b8e524e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updatedlpreportrequest.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateDlpReportRequest struct { + // Detailed configuration of what documents and sensitive content will be scanned. + Config *DlpConfig `json:"config,omitempty"` + // Interval between scans. DAILY is deprecated. + Frequency *DlpFrequency `json:"frequency,omitempty"` + // The status of the policy/report. Only ACTIVE status will be picked for scans. + Status *DlpReportStatus `json:"status,omitempty"` + // The new autoHideDoc boolean the policy will be updated to if provided. + AutoHideDocs *bool `json:"autoHideDocs,omitempty"` + // The new name of the policy if provided. + ReportName *string `json:"reportName,omitempty"` +} + +func (o *UpdateDlpReportRequest) GetConfig() *DlpConfig { + if o == nil { + return nil + } + return o.Config +} + +func (o *UpdateDlpReportRequest) GetFrequency() *DlpFrequency { + if o == nil { + return nil + } + return o.Frequency +} + +func (o *UpdateDlpReportRequest) GetStatus() *DlpReportStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *UpdateDlpReportRequest) GetAutoHideDocs() *bool { + if o == nil { + return nil + } + return o.AutoHideDocs +} + +func (o *UpdateDlpReportRequest) GetReportName() *string { + if o == nil { + return nil + } + return o.ReportName +} diff --git a/tests/mockserver/internal/sdk/models/components/updatedlpreportresponse.go b/tests/mockserver/internal/sdk/models/components/updatedlpreportresponse.go new file mode 100644 index 00000000..beff94eb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updatedlpreportresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateDlpReportResponse struct { + Result *DlpSimpleResult `json:"result,omitempty"` +} + +func (o *UpdateDlpReportResponse) GetResult() *DlpSimpleResult { + if o == nil { + return nil + } + return o.Result +} diff --git a/tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesrequest.go b/tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesrequest.go new file mode 100644 index 00000000..e26ea504 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesrequest.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateDocumentVisibilityOverridesRequest struct { + VisibilityOverrides []DocumentVisibilityOverride `json:"visibilityOverrides,omitempty"` +} + +func (o *UpdateDocumentVisibilityOverridesRequest) GetVisibilityOverrides() []DocumentVisibilityOverride { + if o == nil { + return nil + } + return o.VisibilityOverrides +} diff --git a/tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesresponse.go b/tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesresponse.go new file mode 100644 index 00000000..638a1b97 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updatedocumentvisibilityoverridesresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateDocumentVisibilityOverridesResponse struct { + // The documents and whether their visibility was successfully updated. + Results []DocumentVisibilityUpdateResult `json:"results,omitempty"` +} + +func (o *UpdateDocumentVisibilityOverridesResponse) GetResults() []DocumentVisibilityUpdateResult { + if o == nil { + return nil + } + return o.Results +} diff --git a/tests/mockserver/internal/sdk/models/components/updatepermissionsrequest.go b/tests/mockserver/internal/sdk/models/components/updatepermissionsrequest.go new file mode 100644 index 00000000..a2455c34 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updatepermissionsrequest.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// UpdatePermissionsRequest - Describes the request body of the /updatepermissions API call +type UpdatePermissionsRequest struct { + Datasource string `json:"datasource"` + // The type of the document (Case, KnowledgeArticle for Salesforce for example). It cannot have spaces or _ + ObjectType *string `json:"objectType,omitempty"` + // The datasource specific id for the document. This field is case insensitive and should not be more than 200 characters in length. + ID *string `json:"id,omitempty"` + // The permalink for viewing the document. **Note: viewURL is a required field if id was not set when uploading the document.**' + // + ViewURL *string `json:"viewURL,omitempty"` + // describes the access control details of the document + Permissions DocumentPermissionsDefinition `json:"permissions"` +} + +func (o *UpdatePermissionsRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *UpdatePermissionsRequest) GetObjectType() *string { + if o == nil { + return nil + } + return o.ObjectType +} + +func (o *UpdatePermissionsRequest) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *UpdatePermissionsRequest) GetViewURL() *string { + if o == nil { + return nil + } + return o.ViewURL +} + +func (o *UpdatePermissionsRequest) GetPermissions() DocumentPermissionsDefinition { + if o == nil { + return DocumentPermissionsDefinition{} + } + return o.Permissions +} diff --git a/tests/mockserver/internal/sdk/models/components/updateshortcutrequest.go b/tests/mockserver/internal/sdk/models/components/updateshortcutrequest.go new file mode 100644 index 00000000..e9e8dd98 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updateshortcutrequest.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateShortcutRequest struct { + // The opaque id of the user generated content. + ID int64 `json:"id"` + // Link text following go/ prefix as entered by the user. + InputAlias *string `json:"inputAlias,omitempty"` + // Destination URL for the shortcut. + DestinationURL *string `json:"destinationUrl,omitempty"` + // Glean Document ID for the URL, if known. + DestinationDocumentID *string `json:"destinationDocumentId,omitempty"` + // A short, plain text blurb to help people understand the intent of the shortcut. + Description *string `json:"description,omitempty"` + // Whether this shortcut is unlisted or not. Unlisted shortcuts are visible to author + admins only. + Unlisted *bool `json:"unlisted,omitempty"` + // For variable shortcuts, contains the URL template; note, `destinationUrl` contains default URL. + URLTemplate *string `json:"urlTemplate,omitempty"` + // A list of user roles added for the Shortcut. + AddedRoles []UserRoleSpecification `json:"addedRoles,omitempty"` + // A list of user roles removed for the Shortcut. + RemovedRoles []UserRoleSpecification `json:"removedRoles,omitempty"` +} + +func (o *UpdateShortcutRequest) GetID() int64 { + if o == nil { + return 0 + } + return o.ID +} + +func (o *UpdateShortcutRequest) GetInputAlias() *string { + if o == nil { + return nil + } + return o.InputAlias +} + +func (o *UpdateShortcutRequest) GetDestinationURL() *string { + if o == nil { + return nil + } + return o.DestinationURL +} + +func (o *UpdateShortcutRequest) GetDestinationDocumentID() *string { + if o == nil { + return nil + } + return o.DestinationDocumentID +} + +func (o *UpdateShortcutRequest) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *UpdateShortcutRequest) GetUnlisted() *bool { + if o == nil { + return nil + } + return o.Unlisted +} + +func (o *UpdateShortcutRequest) GetURLTemplate() *string { + if o == nil { + return nil + } + return o.URLTemplate +} + +func (o *UpdateShortcutRequest) GetAddedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.AddedRoles +} + +func (o *UpdateShortcutRequest) GetRemovedRoles() []UserRoleSpecification { + if o == nil { + return nil + } + return o.RemovedRoles +} diff --git a/tests/mockserver/internal/sdk/models/components/updateshortcutresponse.go b/tests/mockserver/internal/sdk/models/components/updateshortcutresponse.go new file mode 100644 index 00000000..f4ab9bee --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/updateshortcutresponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateShortcutResponse struct { + Shortcut *Shortcut `json:"shortcut,omitempty"` + Error *ShortcutError `json:"error,omitempty"` +} + +func (o *UpdateShortcutResponse) GetShortcut() *Shortcut { + if o == nil { + return nil + } + return o.Shortcut +} + +func (o *UpdateShortcutResponse) GetError() *ShortcutError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go b/tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go new file mode 100644 index 00000000..7c324627 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/uploadchatfilesrequest.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "io" +) + +type File struct { + FileName string `multipartForm:"name=fileName"` + Content io.Reader `multipartForm:"content"` +} + +func (o *File) GetFileName() string { + if o == nil { + return "" + } + return o.FileName +} + +func (o *File) GetContent() io.Reader { + if o == nil { + return nil + } + return o.Content +} + +type UploadChatFilesRequest struct { + // Raw files to be uploaded for chat in binary format. + Files []File `multipartForm:"file"` +} + +func (o *UploadChatFilesRequest) GetFiles() []File { + if o == nil { + return []File{} + } + return o.Files +} diff --git a/tests/mockserver/internal/sdk/models/components/uploadchatfilesresponse.go b/tests/mockserver/internal/sdk/models/components/uploadchatfilesresponse.go new file mode 100644 index 00000000..a10030cf --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/uploadchatfilesresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UploadChatFilesResponse struct { + // Files uploaded for chat. + Files []ChatFile `json:"files,omitempty"` +} + +func (o *UploadChatFilesResponse) GetFiles() []ChatFile { + if o == nil { + return nil + } + return o.Files +} diff --git a/tests/mockserver/internal/sdk/models/components/uploadshortcutsrequest.go b/tests/mockserver/internal/sdk/models/components/uploadshortcutsrequest.go new file mode 100644 index 00000000..4549bec3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/uploadshortcutsrequest.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// UploadShortcutsRequest - Describes the request body of the /uploadshortcuts API call +type UploadShortcutsRequest struct { + // Unique id that must be used for this bulk upload instance + UploadID string `json:"uploadId"` + // true if this is the first page of the upload. Defaults to false + IsFirstPage *bool `json:"isFirstPage,omitempty"` + // true if this is the last page of the upload. Defaults to false + IsLastPage *bool `json:"isLastPage,omitempty"` + // Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true + ForceRestartUpload *bool `json:"forceRestartUpload,omitempty"` + // Batch of shortcuts information + Shortcuts []IndexingShortcut `json:"shortcuts"` +} + +func (o *UploadShortcutsRequest) GetUploadID() string { + if o == nil { + return "" + } + return o.UploadID +} + +func (o *UploadShortcutsRequest) GetIsFirstPage() *bool { + if o == nil { + return nil + } + return o.IsFirstPage +} + +func (o *UploadShortcutsRequest) GetIsLastPage() *bool { + if o == nil { + return nil + } + return o.IsLastPage +} + +func (o *UploadShortcutsRequest) GetForceRestartUpload() *bool { + if o == nil { + return nil + } + return o.ForceRestartUpload +} + +func (o *UploadShortcutsRequest) GetShortcuts() []IndexingShortcut { + if o == nil { + return []IndexingShortcut{} + } + return o.Shortcuts +} diff --git a/tests/mockserver/internal/sdk/models/components/uploadstatusenum.go b/tests/mockserver/internal/sdk/models/components/uploadstatusenum.go new file mode 100644 index 00000000..90546c9d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/uploadstatusenum.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// UploadStatusEnum - Upload status, enum of NOT_UPLOADED, UPLOADED, STATUS_UNKNOWN +type UploadStatusEnum string + +const ( + UploadStatusEnumUploaded UploadStatusEnum = "UPLOADED" + UploadStatusEnumNotUploaded UploadStatusEnum = "NOT_UPLOADED" + UploadStatusEnumStatusUnknown UploadStatusEnum = "STATUS_UNKNOWN" +) + +func (e UploadStatusEnum) ToPointer() *UploadStatusEnum { + return &e +} +func (e *UploadStatusEnum) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UPLOADED": + fallthrough + case "NOT_UPLOADED": + fallthrough + case "STATUS_UNKNOWN": + *e = UploadStatusEnum(v) + return nil + default: + return fmt.Errorf("invalid value for UploadStatusEnum: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/user.go b/tests/mockserver/internal/sdk/models/components/user.go new file mode 100644 index 00000000..c9309929 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/user.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type User struct { + // An opaque user ID for the claimed authority (i.e., the actas param, or the origid if actas is not specified). + UserID *string `json:"userID,omitempty"` + // An opaque user ID for the authenticated user (ignores actas). + OrigID *string `json:"origID,omitempty"` +} + +func (o *User) GetUserID() *string { + if o == nil { + return nil + } + return o.UserID +} + +func (o *User) GetOrigID() *string { + if o == nil { + return nil + } + return o.OrigID +} diff --git a/tests/mockserver/internal/sdk/models/components/useractivity.go b/tests/mockserver/internal/sdk/models/components/useractivity.go new file mode 100644 index 00000000..686d1176 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/useractivity.go @@ -0,0 +1,108 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// UserActivityAction - The action for the activity +type UserActivityAction string + +const ( + UserActivityActionAdd UserActivityAction = "ADD" + UserActivityActionAddReminder UserActivityAction = "ADD_REMINDER" + UserActivityActionClick UserActivityAction = "CLICK" + UserActivityActionComment UserActivityAction = "COMMENT" + UserActivityActionDelete UserActivityAction = "DELETE" + UserActivityActionDismiss UserActivityAction = "DISMISS" + UserActivityActionEdit UserActivityAction = "EDIT" + UserActivityActionMention UserActivityAction = "MENTION" + UserActivityActionMove UserActivityAction = "MOVE" + UserActivityActionOther UserActivityAction = "OTHER" + UserActivityActionRestore UserActivityAction = "RESTORE" + UserActivityActionUnknown UserActivityAction = "UNKNOWN" + UserActivityActionVerify UserActivityAction = "VERIFY" + UserActivityActionView UserActivityAction = "VIEW" +) + +func (e UserActivityAction) ToPointer() *UserActivityAction { + return &e +} +func (e *UserActivityAction) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ADD": + fallthrough + case "ADD_REMINDER": + fallthrough + case "CLICK": + fallthrough + case "COMMENT": + fallthrough + case "DELETE": + fallthrough + case "DISMISS": + fallthrough + case "EDIT": + fallthrough + case "MENTION": + fallthrough + case "MOVE": + fallthrough + case "OTHER": + fallthrough + case "RESTORE": + fallthrough + case "UNKNOWN": + fallthrough + case "VERIFY": + fallthrough + case "VIEW": + *e = UserActivityAction(v) + return nil + default: + return fmt.Errorf("invalid value for UserActivityAction: %v", v) + } +} + +type UserActivity struct { + Actor *Person `json:"actor,omitempty"` + // Unix timestamp of the activity (in seconds since epoch UTC). + Timestamp *int64 `json:"timestamp,omitempty"` + // The action for the activity + Action *UserActivityAction `json:"action,omitempty"` + AggregateVisitCount *CountInfo `json:"aggregateVisitCount,omitempty"` +} + +func (o *UserActivity) GetActor() *Person { + if o == nil { + return nil + } + return o.Actor +} + +func (o *UserActivity) GetTimestamp() *int64 { + if o == nil { + return nil + } + return o.Timestamp +} + +func (o *UserActivity) GetAction() *UserActivityAction { + if o == nil { + return nil + } + return o.Action +} + +func (o *UserActivity) GetAggregateVisitCount() *CountInfo { + if o == nil { + return nil + } + return o.AggregateVisitCount +} diff --git a/tests/mockserver/internal/sdk/models/components/useractivityinsight.go b/tests/mockserver/internal/sdk/models/components/useractivityinsight.go new file mode 100644 index 00000000..ef7cc879 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/useractivityinsight.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// ActivityEnum - Activity e.g. search, home page visit or all. +type ActivityEnum string + +const ( + ActivityEnumAll ActivityEnum = "ALL" + ActivityEnumSearch ActivityEnum = "SEARCH" +) + +func (e ActivityEnum) ToPointer() *ActivityEnum { + return &e +} +func (e *ActivityEnum) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ALL": + fallthrough + case "SEARCH": + *e = ActivityEnum(v) + return nil + default: + return fmt.Errorf("invalid value for ActivityEnum: %v", v) + } +} + +type UserActivityInsight struct { + User Person `json:"user"` + // Activity e.g. search, home page visit or all. + Activity ActivityEnum `json:"activity"` + // Unix timestamp of the last activity (in seconds since epoch UTC). + LastActivityTimestamp *int64 `json:"lastActivityTimestamp,omitempty"` + ActivityCount *CountInfo `json:"activityCount,omitempty"` + ActiveDayCount *CountInfo `json:"activeDayCount,omitempty"` +} + +func (o *UserActivityInsight) GetUser() Person { + if o == nil { + return Person{} + } + return o.User +} + +func (o *UserActivityInsight) GetActivity() ActivityEnum { + if o == nil { + return ActivityEnum("") + } + return o.Activity +} + +func (o *UserActivityInsight) GetLastActivityTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastActivityTimestamp +} + +func (o *UserActivityInsight) GetActivityCount() *CountInfo { + if o == nil { + return nil + } + return o.ActivityCount +} + +func (o *UserActivityInsight) GetActiveDayCount() *CountInfo { + if o == nil { + return nil + } + return o.ActiveDayCount +} diff --git a/tests/mockserver/internal/sdk/models/components/usergeneratedcontentid.go b/tests/mockserver/internal/sdk/models/components/usergeneratedcontentid.go new file mode 100644 index 00000000..e8db0dae --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/usergeneratedcontentid.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UserGeneratedContentID struct { + // The opaque id of the user generated content. + ID *int64 `json:"id,omitempty"` +} + +func (o *UserGeneratedContentID) GetID() *int64 { + if o == nil { + return nil + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/userinsightsresponse.go b/tests/mockserver/internal/sdk/models/components/userinsightsresponse.go new file mode 100644 index 00000000..2fb26d2f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/userinsightsresponse.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UserInsightsResponse struct { + // Unix timestamp of the last activity processed to make the response (in seconds since epoch UTC). + LastLogTimestamp *int64 `json:"lastLogTimestamp,omitempty"` + // Insights for all active users with respect to set of actions. + ActivityInsights []UserActivityInsight `json:"activityInsights,omitempty"` + // Insights for all in inactive users with respect to set of actions and time period. Activity count will be set to 0. + InactiveInsights []UserActivityInsight `json:"inactiveInsights,omitempty"` + // Total number of teammates that have logged in to the product, that are still valid teammates. + TotalTeammates *int64 `json:"totalTeammates,omitempty"` + // Total number of active users in the requested period. + TotalActiveUsers *int64 `json:"totalActiveUsers,omitempty"` + // list of departments applicable for users tab. + Departments []string `json:"departments,omitempty"` +} + +func (o *UserInsightsResponse) GetLastLogTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastLogTimestamp +} + +func (o *UserInsightsResponse) GetActivityInsights() []UserActivityInsight { + if o == nil { + return nil + } + return o.ActivityInsights +} + +func (o *UserInsightsResponse) GetInactiveInsights() []UserActivityInsight { + if o == nil { + return nil + } + return o.InactiveInsights +} + +func (o *UserInsightsResponse) GetTotalTeammates() *int64 { + if o == nil { + return nil + } + return o.TotalTeammates +} + +func (o *UserInsightsResponse) GetTotalActiveUsers() *int64 { + if o == nil { + return nil + } + return o.TotalActiveUsers +} + +func (o *UserInsightsResponse) GetDepartments() []string { + if o == nil { + return nil + } + return o.Departments +} diff --git a/tests/mockserver/internal/sdk/models/components/userreferencedefinition.go b/tests/mockserver/internal/sdk/models/components/userreferencedefinition.go new file mode 100644 index 00000000..29153dad --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/userreferencedefinition.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// UserReferenceDefinition - Describes how a user is referenced in a document. The user can be referenced by email or by a datasource specific id. +type UserReferenceDefinition struct { + Email *string `json:"email,omitempty"` + // some datasources refer to the user by the datasource user id in the document + DatasourceUserID *string `json:"datasourceUserId,omitempty"` + Name *string `json:"name,omitempty"` +} + +func (o *UserReferenceDefinition) GetEmail() *string { + if o == nil { + return nil + } + return o.Email +} + +func (o *UserReferenceDefinition) GetDatasourceUserID() *string { + if o == nil { + return nil + } + return o.DatasourceUserID +} + +func (o *UserReferenceDefinition) GetName() *string { + if o == nil { + return nil + } + return o.Name +} diff --git a/tests/mockserver/internal/sdk/models/components/userrole.go b/tests/mockserver/internal/sdk/models/components/userrole.go new file mode 100644 index 00000000..7697e0b0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/userrole.go @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// UserRole - A user's role with respect to a specific document. +type UserRole string + +const ( + UserRoleOwner UserRole = "OWNER" + UserRoleViewer UserRole = "VIEWER" + UserRoleAnswerModerator UserRole = "ANSWER_MODERATOR" + UserRoleEditor UserRole = "EDITOR" + UserRoleVerifier UserRole = "VERIFIER" +) + +func (e UserRole) ToPointer() *UserRole { + return &e +} +func (e *UserRole) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "OWNER": + fallthrough + case "VIEWER": + fallthrough + case "ANSWER_MODERATOR": + fallthrough + case "EDITOR": + fallthrough + case "VERIFIER": + *e = UserRole(v) + return nil + default: + return fmt.Errorf("invalid value for UserRole: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/userrolespecification.go b/tests/mockserver/internal/sdk/models/components/userrolespecification.go new file mode 100644 index 00000000..8e4fd68d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/userrolespecification.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UserRoleSpecification struct { + SourceDocumentSpec *DocumentSpecUnion `json:"sourceDocumentSpec,omitempty"` + Person *Person `json:"person,omitempty"` + Group *Group `json:"group,omitempty"` + // A user's role with respect to a specific document. + Role UserRole `json:"role"` +} + +func (o *UserRoleSpecification) GetSourceDocumentSpec() *DocumentSpecUnion { + if o == nil { + return nil + } + return o.SourceDocumentSpec +} + +func (o *UserRoleSpecification) GetPerson() *Person { + if o == nil { + return nil + } + return o.Person +} + +func (o *UserRoleSpecification) GetGroup() *Group { + if o == nil { + return nil + } + return o.Group +} + +func (o *UserRoleSpecification) GetRole() UserRole { + if o == nil { + return UserRole("") + } + return o.Role +} diff --git a/tests/mockserver/internal/sdk/models/components/userstatusresponse.go b/tests/mockserver/internal/sdk/models/components/userstatusresponse.go new file mode 100644 index 00000000..7457001c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/userstatusresponse.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// UserStatusResponse - Describes the user status response body +type UserStatusResponse struct { + // Whether the user is active or not + IsActiveUser *bool `json:"isActiveUser,omitempty"` + // Upload status, enum of NOT_UPLOADED, UPLOADED, STATUS_UNKNOWN + UploadStatus *UploadStatusEnum `json:"uploadStatus,omitempty"` + // Time of last successful upload for the user, in ISO 8601 format + LastUploadedAt *string `json:"lastUploadedAt,omitempty"` +} + +func (o *UserStatusResponse) GetIsActiveUser() *bool { + if o == nil { + return nil + } + return o.IsActiveUser +} + +func (o *UserStatusResponse) GetUploadStatus() *UploadStatusEnum { + if o == nil { + return nil + } + return o.UploadStatus +} + +func (o *UserStatusResponse) GetLastUploadedAt() *string { + if o == nil { + return nil + } + return o.LastUploadedAt +} diff --git a/tests/mockserver/internal/sdk/models/components/userviewinfo.go b/tests/mockserver/internal/sdk/models/components/userviewinfo.go new file mode 100644 index 00000000..e256289a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/userviewinfo.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UserViewInfo struct { + // Unique Glean Document ID of the associated document. + DocID *string `json:"docId,omitempty"` + // Title of associated document. + DocTitle *string `json:"docTitle,omitempty"` + // URL of associated document. + DocURL *string `json:"docUrl,omitempty"` +} + +func (o *UserViewInfo) GetDocID() *string { + if o == nil { + return nil + } + return o.DocID +} + +func (o *UserViewInfo) GetDocTitle() *string { + if o == nil { + return nil + } + return o.DocTitle +} + +func (o *UserViewInfo) GetDocURL() *string { + if o == nil { + return nil + } + return o.DocURL +} diff --git a/tests/mockserver/internal/sdk/models/components/verification.go b/tests/mockserver/internal/sdk/models/components/verification.go new file mode 100644 index 00000000..363532a4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/verification.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// State - The verification state for the document. +type State string + +const ( + StateUnverified State = "UNVERIFIED" + StateVerified State = "VERIFIED" + StateDeprecated State = "DEPRECATED" +) + +func (e State) ToPointer() *State { + return &e +} +func (e *State) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UNVERIFIED": + fallthrough + case "VERIFIED": + fallthrough + case "DEPRECATED": + *e = State(v) + return nil + default: + return fmt.Errorf("invalid value for State: %v", v) + } +} + +type Verification struct { + // The verification state for the document. + State State `json:"state"` + Metadata *VerificationMetadata `json:"metadata,omitempty"` +} + +func (o *Verification) GetState() State { + if o == nil { + return State("") + } + return o.State +} + +func (o *Verification) GetMetadata() *VerificationMetadata { + if o == nil { + return nil + } + return o.Metadata +} diff --git a/tests/mockserver/internal/sdk/models/components/verificationfeed.go b/tests/mockserver/internal/sdk/models/components/verificationfeed.go new file mode 100644 index 00000000..74a08b65 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/verificationfeed.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type VerificationFeed struct { + // List of document infos that include verification related information for them. + Documents []Verification `json:"documents,omitempty"` +} + +func (o *VerificationFeed) GetDocuments() []Verification { + if o == nil { + return nil + } + return o.Documents +} diff --git a/tests/mockserver/internal/sdk/models/components/verificationmetadata.go b/tests/mockserver/internal/sdk/models/components/verificationmetadata.go new file mode 100644 index 00000000..d91c6310 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/verificationmetadata.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type VerificationMetadata struct { + LastVerifier *Person `json:"lastVerifier,omitempty"` + // The unix timestamp of the verification (in seconds since epoch UTC). + LastVerificationTs *int64 `json:"lastVerificationTs,omitempty"` + // The unix timestamp of the verification expiration if applicable (in seconds since epoch UTC). + ExpirationTs *int64 `json:"expirationTs,omitempty"` + Document *Document `json:"document,omitempty"` + // Info about all outstanding verification reminders for the document if exists. + Reminders []Reminder `json:"reminders,omitempty"` + LastReminder *Reminder `json:"lastReminder,omitempty"` + // Number of visitors to the document during included time periods. + VisitorCount []CountInfo `json:"visitorCount,omitempty"` + // List of potential verifiers for the document e.g. old verifiers and/or users with view/edit permissions. + CandidateVerifiers []Person `json:"candidateVerifiers,omitempty"` +} + +func (o *VerificationMetadata) GetLastVerifier() *Person { + if o == nil { + return nil + } + return o.LastVerifier +} + +func (o *VerificationMetadata) GetLastVerificationTs() *int64 { + if o == nil { + return nil + } + return o.LastVerificationTs +} + +func (o *VerificationMetadata) GetExpirationTs() *int64 { + if o == nil { + return nil + } + return o.ExpirationTs +} + +func (o *VerificationMetadata) GetDocument() *Document { + if o == nil { + return nil + } + return o.Document +} + +func (o *VerificationMetadata) GetReminders() []Reminder { + if o == nil { + return nil + } + return o.Reminders +} + +func (o *VerificationMetadata) GetLastReminder() *Reminder { + if o == nil { + return nil + } + return o.LastReminder +} + +func (o *VerificationMetadata) GetVisitorCount() []CountInfo { + if o == nil { + return nil + } + return o.VisitorCount +} + +func (o *VerificationMetadata) GetCandidateVerifiers() []Person { + if o == nil { + return nil + } + return o.CandidateVerifiers +} diff --git a/tests/mockserver/internal/sdk/models/components/verifyrequest.go b/tests/mockserver/internal/sdk/models/components/verifyrequest.go new file mode 100644 index 00000000..18059e0b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/verifyrequest.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// VerifyRequestAction - The verification action requested. +type VerifyRequestAction string + +const ( + VerifyRequestActionVerify VerifyRequestAction = "VERIFY" + VerifyRequestActionDeprecate VerifyRequestAction = "DEPRECATE" + VerifyRequestActionUnverify VerifyRequestAction = "UNVERIFY" +) + +func (e VerifyRequestAction) ToPointer() *VerifyRequestAction { + return &e +} +func (e *VerifyRequestAction) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "VERIFY": + fallthrough + case "DEPRECATE": + fallthrough + case "UNVERIFY": + *e = VerifyRequestAction(v) + return nil + default: + return fmt.Errorf("invalid value for VerifyRequestAction: %v", v) + } +} + +type VerifyRequest struct { + // The document which is verified. + DocumentID string `json:"documentId"` + // The verification action requested. + Action *VerifyRequestAction `json:"action,omitempty"` +} + +func (o *VerifyRequest) GetDocumentID() string { + if o == nil { + return "" + } + return o.DocumentID +} + +func (o *VerifyRequest) GetAction() *VerifyRequestAction { + if o == nil { + return nil + } + return o.Action +} diff --git a/tests/mockserver/internal/sdk/models/components/viewerinfo.go b/tests/mockserver/internal/sdk/models/components/viewerinfo.go new file mode 100644 index 00000000..ec85917b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/viewerinfo.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// Role - DEPRECATED - use permissions instead. Viewer's role on the specific document. +// +// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. +type Role string + +const ( + RoleAnswerModerator Role = "ANSWER_MODERATOR" + RoleOwner Role = "OWNER" + RoleViewer Role = "VIEWER" +) + +func (e Role) ToPointer() *Role { + return &e +} +func (e *Role) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ANSWER_MODERATOR": + fallthrough + case "OWNER": + fallthrough + case "VIEWER": + *e = Role(v) + return nil + default: + return fmt.Errorf("invalid value for Role: %v", v) + } +} + +type ViewerInfo struct { + // DEPRECATED - use permissions instead. Viewer's role on the specific document. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Role *Role `json:"role,omitempty"` + LastViewedTime *time.Time `json:"lastViewedTime,omitempty"` +} + +func (v ViewerInfo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *ViewerInfo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ViewerInfo) GetRole() *Role { + if o == nil { + return nil + } + return o.Role +} + +func (o *ViewerInfo) GetLastViewedTime() *time.Time { + if o == nil { + return nil + } + return o.LastViewedTime +} diff --git a/tests/mockserver/internal/sdk/models/components/workflow.go b/tests/mockserver/internal/sdk/models/components/workflow.go new file mode 100644 index 00000000..4d9b678b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/workflow.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Workflow struct { + // The name of the workflow. + Name *string `json:"name,omitempty"` + Author *Person `json:"author,omitempty"` + // Server Unix timestamp of the creation time. + CreateTimestamp *int64 `json:"createTimestamp,omitempty"` + // Server Unix timestamp of the last update time. + LastUpdateTimestamp *int64 `json:"lastUpdateTimestamp,omitempty"` + LastUpdatedBy *Person `json:"lastUpdatedBy,omitempty"` + Permissions *ObjectPermissions `json:"permissions,omitempty"` + // The ID of the workflow. + ID *string `json:"id,omitempty"` +} + +func (o *Workflow) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *Workflow) GetAuthor() *Person { + if o == nil { + return nil + } + return o.Author +} + +func (o *Workflow) GetCreateTimestamp() *int64 { + if o == nil { + return nil + } + return o.CreateTimestamp +} + +func (o *Workflow) GetLastUpdateTimestamp() *int64 { + if o == nil { + return nil + } + return o.LastUpdateTimestamp +} + +func (o *Workflow) GetLastUpdatedBy() *Person { + if o == nil { + return nil + } + return o.LastUpdatedBy +} + +func (o *Workflow) GetPermissions() *ObjectPermissions { + if o == nil { + return nil + } + return o.Permissions +} + +func (o *Workflow) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/tests/mockserver/internal/sdk/models/components/workflowfeedbackinfo.go b/tests/mockserver/internal/sdk/models/components/workflowfeedbackinfo.go new file mode 100644 index 00000000..e13579ac --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/workflowfeedbackinfo.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// WorkflowFeedbackInfoSource - Where the feedback of the workflow originated from +type WorkflowFeedbackInfoSource string + +const ( + WorkflowFeedbackInfoSourceZeroState WorkflowFeedbackInfoSource = "ZERO_STATE" + WorkflowFeedbackInfoSourceLibrary WorkflowFeedbackInfoSource = "LIBRARY" + WorkflowFeedbackInfoSourceHomepage WorkflowFeedbackInfoSource = "HOMEPAGE" +) + +func (e WorkflowFeedbackInfoSource) ToPointer() *WorkflowFeedbackInfoSource { + return &e +} +func (e *WorkflowFeedbackInfoSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ZERO_STATE": + fallthrough + case "LIBRARY": + fallthrough + case "HOMEPAGE": + *e = WorkflowFeedbackInfoSource(v) + return nil + default: + return fmt.Errorf("invalid value for WorkflowFeedbackInfoSource: %v", v) + } +} + +type WorkflowFeedbackInfo struct { + // Where the feedback of the workflow originated from + Source *WorkflowFeedbackInfoSource `json:"source,omitempty"` +} + +func (o *WorkflowFeedbackInfo) GetSource() *WorkflowFeedbackInfoSource { + if o == nil { + return nil + } + return o.Source +} diff --git a/tests/mockserver/internal/sdk/models/components/workflowresult.go b/tests/mockserver/internal/sdk/models/components/workflowresult.go new file mode 100644 index 00000000..63529735 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/workflowresult.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type WorkflowResult struct { + Workflow Workflow `json:"workflow"` +} + +func (o *WorkflowResult) GetWorkflow() Workflow { + if o == nil { + return Workflow{} + } + return o.Workflow +} diff --git a/tests/mockserver/internal/sdk/models/components/writeactionparameter.go b/tests/mockserver/internal/sdk/models/components/writeactionparameter.go new file mode 100644 index 00000000..de5e3bb3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/writeactionparameter.go @@ -0,0 +1,98 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// WriteActionParameterType - The type of the value (e.g., integer, string, boolean, etc.) +type WriteActionParameterType string + +const ( + WriteActionParameterTypeUnknown WriteActionParameterType = "UNKNOWN" + WriteActionParameterTypeInteger WriteActionParameterType = "INTEGER" + WriteActionParameterTypeString WriteActionParameterType = "STRING" + WriteActionParameterTypeBoolean WriteActionParameterType = "BOOLEAN" +) + +func (e WriteActionParameterType) ToPointer() *WriteActionParameterType { + return &e +} +func (e *WriteActionParameterType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UNKNOWN": + fallthrough + case "INTEGER": + fallthrough + case "STRING": + fallthrough + case "BOOLEAN": + *e = WriteActionParameterType(v) + return nil + default: + return fmt.Errorf("invalid value for WriteActionParameterType: %v", v) + } +} + +type WriteActionParameter struct { + // The type of the value (e.g., integer, string, boolean, etc.) + Type *WriteActionParameterType `json:"type,omitempty"` + // Human readable display name for the key. + DisplayName *string `json:"displayName,omitempty"` + // The value of the field. + Value *string `json:"value,omitempty"` + // Is the parameter a required field. + IsRequired *bool `json:"isRequired,omitempty"` + // Description of the parameter. + Description *string `json:"description,omitempty"` + // Possible values that the parameter can take. + PossibleValues []PossibleValue `json:"possibleValues,omitempty"` +} + +func (o *WriteActionParameter) GetType() *WriteActionParameterType { + if o == nil { + return nil + } + return o.Type +} + +func (o *WriteActionParameter) GetDisplayName() *string { + if o == nil { + return nil + } + return o.DisplayName +} + +func (o *WriteActionParameter) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} + +func (o *WriteActionParameter) GetIsRequired() *bool { + if o == nil { + return nil + } + return o.IsRequired +} + +func (o *WriteActionParameter) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *WriteActionParameter) GetPossibleValues() []PossibleValue { + if o == nil { + return nil + } + return o.PossibleValues +} diff --git a/tests/mockserver/internal/sdk/models/components/writepermission.go b/tests/mockserver/internal/sdk/models/components/writepermission.go new file mode 100644 index 00000000..b0c6e1ab --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/writepermission.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// WritePermission - Describes the write permissions levels that a user has for a specific feature +type WritePermission struct { + // Describes the scope for a ReadPermission, WritePermission, or GrantPermission object + ScopeType *ScopeType `json:"scopeType,omitempty"` + // True if user has create permission for this feature and scope + Create *bool `json:"create,omitempty"` + // True if user has update permission for this feature and scope + Update *bool `json:"update,omitempty"` + // True if user has delete permission for this feature and scope + Delete *bool `json:"delete,omitempty"` +} + +func (o *WritePermission) GetScopeType() *ScopeType { + if o == nil { + return nil + } + return o.ScopeType +} + +func (o *WritePermission) GetCreate() *bool { + if o == nil { + return nil + } + return o.Create +} + +func (o *WritePermission) GetUpdate() *bool { + if o == nil { + return nil + } + return o.Update +} + +func (o *WritePermission) GetDelete() *bool { + if o == nil { + return nil + } + return o.Delete +} diff --git a/tests/mockserver/internal/sdk/models/operations/activity.go b/tests/mockserver/internal/sdk/models/operations/activity.go new file mode 100644 index 00000000..fbeadfb6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/activity.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ActivityResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *ActivityResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/addcollectionitems.go b/tests/mockserver/internal/sdk/models/operations/addcollectionitems.go new file mode 100644 index 00000000..fd74638a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/addcollectionitems.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type AddcollectionitemsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + AddCollectionItemsResponse *components.AddCollectionItemsResponse +} + +func (o *AddcollectionitemsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AddcollectionitemsResponse) GetAddCollectionItemsResponse() *components.AddCollectionItemsResponse { + if o == nil { + return nil + } + return o.AddCollectionItemsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/addverificationreminder.go b/tests/mockserver/internal/sdk/models/operations/addverificationreminder.go new file mode 100644 index 00000000..fb8ab5ad --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/addverificationreminder.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type AddverificationreminderResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + Verification *components.Verification +} + +func (o *AddverificationreminderResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AddverificationreminderResponse) GetVerification() *components.Verification { + if o == nil { + return nil + } + return o.Verification +} diff --git a/tests/mockserver/internal/sdk/models/operations/adminsearch.go b/tests/mockserver/internal/sdk/models/operations/adminsearch.go new file mode 100644 index 00000000..3a9fc431 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/adminsearch.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type AdminsearchResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + SearchResponse *components.SearchResponse +} + +func (o *AdminsearchResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AdminsearchResponse) GetSearchResponse() *components.SearchResponse { + if o == nil { + return nil + } + return o.SearchResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/autocomplete.go b/tests/mockserver/internal/sdk/models/operations/autocomplete.go new file mode 100644 index 00000000..106f5474 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/autocomplete.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type AutocompleteResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + AutocompleteResponse *components.AutocompleteResponse +} + +func (o *AutocompleteResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AutocompleteResponse) GetAutocompleteResponse() *components.AutocompleteResponse { + if o == nil { + return nil + } + return o.AutocompleteResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/chat.go b/tests/mockserver/internal/sdk/models/operations/chat.go new file mode 100644 index 00000000..4f0f7fb1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/chat.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ChatRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + // Includes chat history for Glean AI to respond to. + ChatRequest components.ChatRequest `request:"mediaType=application/json"` +} + +func (o *ChatRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *ChatRequest) GetChatRequest() components.ChatRequest { + if o == nil { + return components.ChatRequest{} + } + return o.ChatRequest +} + +type ChatResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ChatResponse *components.ChatResponse +} + +func (o *ChatResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ChatResponse) GetChatResponse() *components.ChatResponse { + if o == nil { + return nil + } + return o.ChatResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/chatstream.go b/tests/mockserver/internal/sdk/models/operations/chatstream.go new file mode 100644 index 00000000..a8d81d42 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/chatstream.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ChatStreamRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + // Includes chat history for Glean AI to respond to. + ChatRequest components.ChatRequest `request:"mediaType=application/json"` +} + +func (o *ChatStreamRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *ChatStreamRequest) GetChatRequest() components.ChatRequest { + if o == nil { + return components.ChatRequest{} + } + return o.ChatRequest +} + +type ChatStreamResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ChatRequestStream *string +} + +func (o *ChatStreamResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ChatStreamResponse) GetChatRequestStream() *string { + if o == nil { + return nil + } + return o.ChatRequestStream +} diff --git a/tests/mockserver/internal/sdk/models/operations/createandstreamrun.go b/tests/mockserver/internal/sdk/models/operations/createandstreamrun.go new file mode 100644 index 00000000..0dbe446c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createandstreamrun.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreateAndStreamRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Success + Res *string +} + +func (o *CreateAndStreamRunResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreateAndStreamRunResponse) GetRes() *string { + if o == nil { + return nil + } + return o.Res +} diff --git a/tests/mockserver/internal/sdk/models/operations/createandwaitrun.go b/tests/mockserver/internal/sdk/models/operations/createandwaitrun.go new file mode 100644 index 00000000..7286ef64 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createandwaitrun.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreateAndWaitRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Success + AgentRunWaitResponse *components.AgentRunWaitResponse +} + +func (o *CreateAndWaitRunResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreateAndWaitRunResponse) GetAgentRunWaitResponse() *components.AgentRunWaitResponse { + if o == nil { + return nil + } + return o.AgentRunWaitResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/createannouncement.go b/tests/mockserver/internal/sdk/models/operations/createannouncement.go new file mode 100644 index 00000000..86d9ba17 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createannouncement.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreateannouncementResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + Announcement *components.Announcement +} + +func (o *CreateannouncementResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreateannouncementResponse) GetAnnouncement() *components.Announcement { + if o == nil { + return nil + } + return o.Announcement +} diff --git a/tests/mockserver/internal/sdk/models/operations/createanswer.go b/tests/mockserver/internal/sdk/models/operations/createanswer.go new file mode 100644 index 00000000..8abc5c94 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createanswer.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreateanswerResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + Answer *components.Answer +} + +func (o *CreateanswerResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreateanswerResponse) GetAnswer() *components.Answer { + if o == nil { + return nil + } + return o.Answer +} diff --git a/tests/mockserver/internal/sdk/models/operations/createauthtoken.go b/tests/mockserver/internal/sdk/models/operations/createauthtoken.go new file mode 100644 index 00000000..be32a0f3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createauthtoken.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreateauthtokenResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + CreateAuthTokenResponse *components.CreateAuthTokenResponse +} + +func (o *CreateauthtokenResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreateauthtokenResponse) GetCreateAuthTokenResponse() *components.CreateAuthTokenResponse { + if o == nil { + return nil + } + return o.CreateAuthTokenResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/createcollection.go b/tests/mockserver/internal/sdk/models/operations/createcollection.go new file mode 100644 index 00000000..f4d44e36 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createcollection.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreatecollectionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + CreateCollectionResponse *components.CreateCollectionResponse +} + +func (o *CreatecollectionResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreatecollectionResponse) GetCreateCollectionResponse() *components.CreateCollectionResponse { + if o == nil { + return nil + } + return o.CreateCollectionResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/createpolicy.go b/tests/mockserver/internal/sdk/models/operations/createpolicy.go new file mode 100644 index 00000000..d0c5b8e1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createpolicy.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreatepolicyResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + CreateDlpReportResponse *components.CreateDlpReportResponse +} + +func (o *CreatepolicyResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreatepolicyResponse) GetCreateDlpReportResponse() *components.CreateDlpReportResponse { + if o == nil { + return nil + } + return o.CreateDlpReportResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/createreport.go b/tests/mockserver/internal/sdk/models/operations/createreport.go new file mode 100644 index 00000000..7a9d07ab --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createreport.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreatereportResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + UpdateDlpConfigResponse *components.UpdateDlpConfigResponse +} + +func (o *CreatereportResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreatereportResponse) GetUpdateDlpConfigResponse() *components.UpdateDlpConfigResponse { + if o == nil { + return nil + } + return o.UpdateDlpConfigResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/createshortcut.go b/tests/mockserver/internal/sdk/models/operations/createshortcut.go new file mode 100644 index 00000000..b17cc638 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/createshortcut.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type CreateshortcutResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + CreateShortcutResponse *components.CreateShortcutResponse +} + +func (o *CreateshortcutResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *CreateshortcutResponse) GetCreateShortcutResponse() *components.CreateShortcutResponse { + if o == nil { + return nil + } + return o.CreateShortcutResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/deleteallchats.go b/tests/mockserver/internal/sdk/models/operations/deleteallchats.go new file mode 100644 index 00000000..d28cebb1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deleteallchats.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeleteallchatsRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` +} + +func (o *DeleteallchatsRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +type DeleteallchatsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *DeleteallchatsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/deleteannouncement.go b/tests/mockserver/internal/sdk/models/operations/deleteannouncement.go new file mode 100644 index 00000000..774b4d1f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deleteannouncement.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeleteannouncementResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *DeleteannouncementResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/deleteanswer.go b/tests/mockserver/internal/sdk/models/operations/deleteanswer.go new file mode 100644 index 00000000..46b181b2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deleteanswer.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeleteanswerResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *DeleteanswerResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/deletechatfiles.go b/tests/mockserver/internal/sdk/models/operations/deletechatfiles.go new file mode 100644 index 00000000..0d3acc15 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deletechatfiles.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeletechatfilesRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + DeleteChatFilesRequest components.DeleteChatFilesRequest `request:"mediaType=application/json"` +} + +func (o *DeletechatfilesRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *DeletechatfilesRequest) GetDeleteChatFilesRequest() components.DeleteChatFilesRequest { + if o == nil { + return components.DeleteChatFilesRequest{} + } + return o.DeleteChatFilesRequest +} + +type DeletechatfilesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *DeletechatfilesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/deletechats.go b/tests/mockserver/internal/sdk/models/operations/deletechats.go new file mode 100644 index 00000000..a3f3f497 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deletechats.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeletechatsRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + DeleteChatsRequest components.DeleteChatsRequest `request:"mediaType=application/json"` +} + +func (o *DeletechatsRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *DeletechatsRequest) GetDeleteChatsRequest() components.DeleteChatsRequest { + if o == nil { + return components.DeleteChatsRequest{} + } + return o.DeleteChatsRequest +} + +type DeletechatsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *DeletechatsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/deletecollection.go b/tests/mockserver/internal/sdk/models/operations/deletecollection.go new file mode 100644 index 00000000..b21f01fa --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deletecollection.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeletecollectionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *DeletecollectionResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/deletecollectionitem.go b/tests/mockserver/internal/sdk/models/operations/deletecollectionitem.go new file mode 100644 index 00000000..f9b6a404 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deletecollectionitem.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeletecollectionitemResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + DeleteCollectionItemResponse *components.DeleteCollectionItemResponse +} + +func (o *DeletecollectionitemResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *DeletecollectionitemResponse) GetDeleteCollectionItemResponse() *components.DeleteCollectionItemResponse { + if o == nil { + return nil + } + return o.DeleteCollectionItemResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/deleteshortcut.go b/tests/mockserver/internal/sdk/models/operations/deleteshortcut.go new file mode 100644 index 00000000..03a740b6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/deleteshortcut.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DeleteshortcutResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *DeleteshortcutResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/downloadpolicycsv.go b/tests/mockserver/internal/sdk/models/operations/downloadpolicycsv.go new file mode 100644 index 00000000..f11d56e2 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/downloadpolicycsv.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DownloadpolicycsvRequest struct { + // The id of the policy to download violations for. + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (o *DownloadpolicycsvRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +type DownloadpolicycsvResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Downloads csv of batch policy violations. + Res *string +} + +func (o *DownloadpolicycsvResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *DownloadpolicycsvResponse) GetRes() *string { + if o == nil { + return nil + } + return o.Res +} diff --git a/tests/mockserver/internal/sdk/models/operations/downloadreportcsv.go b/tests/mockserver/internal/sdk/models/operations/downloadreportcsv.go new file mode 100644 index 00000000..40814b93 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/downloadreportcsv.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type DownloadreportcsvRequest struct { + // The id of the report to download violations for. + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (o *DownloadreportcsvRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +type DownloadreportcsvResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Downloads csv of one-time report violations. + Res *string +} + +func (o *DownloadreportcsvResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *DownloadreportcsvResponse) GetRes() *string { + if o == nil { + return nil + } + return o.Res +} diff --git a/tests/mockserver/internal/sdk/models/operations/editanswer.go b/tests/mockserver/internal/sdk/models/operations/editanswer.go new file mode 100644 index 00000000..92a67c43 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/editanswer.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type EditanswerResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + Answer *components.Answer +} + +func (o *EditanswerResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *EditanswerResponse) GetAnswer() *components.Answer { + if o == nil { + return nil + } + return o.Answer +} diff --git a/tests/mockserver/internal/sdk/models/operations/editcollection.go b/tests/mockserver/internal/sdk/models/operations/editcollection.go new file mode 100644 index 00000000..6b17b377 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/editcollection.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type EditcollectionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + EditCollectionResponse *components.EditCollectionResponse +} + +func (o *EditcollectionResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *EditcollectionResponse) GetEditCollectionResponse() *components.EditCollectionResponse { + if o == nil { + return nil + } + return o.EditCollectionResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/editcollectionitem.go b/tests/mockserver/internal/sdk/models/operations/editcollectionitem.go new file mode 100644 index 00000000..8ac9f5a9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/editcollectionitem.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type EditcollectionitemResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + EditCollectionItemResponse *components.EditCollectionItemResponse +} + +func (o *EditcollectionitemResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *EditcollectionitemResponse) GetEditCollectionItemResponse() *components.EditCollectionItemResponse { + if o == nil { + return nil + } + return o.EditCollectionItemResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/editpin.go b/tests/mockserver/internal/sdk/models/operations/editpin.go new file mode 100644 index 00000000..921ea93c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/editpin.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type EditpinResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + PinDocument *components.PinDocument +} + +func (o *EditpinResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *EditpinResponse) GetPinDocument() *components.PinDocument { + if o == nil { + return nil + } + return o.PinDocument +} diff --git a/tests/mockserver/internal/sdk/models/operations/feed.go b/tests/mockserver/internal/sdk/models/operations/feed.go new file mode 100644 index 00000000..1d0cbfbf --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/feed.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type FeedResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + FeedResponse *components.FeedResponse +} + +func (o *FeedResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *FeedResponse) GetFeedResponse() *components.FeedResponse { + if o == nil { + return nil + } + return o.FeedResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/feedback.go b/tests/mockserver/internal/sdk/models/operations/feedback.go new file mode 100644 index 00000000..e81f65fc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/feedback.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type FeedbackRequest struct { + // A URL encoded versions of Feedback. This is useful for requests. + FeedbackQueryParameter *string `queryParam:"style=form,explode=true,name=feedback"` + Feedback1 *components.Feedback `request:"mediaType=application/json"` +} + +func (o *FeedbackRequest) GetFeedbackQueryParameter() *string { + if o == nil { + return nil + } + return o.FeedbackQueryParameter +} + +func (o *FeedbackRequest) GetFeedback1() *components.Feedback { + if o == nil { + return nil + } + return o.Feedback1 +} + +type FeedbackResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *FeedbackResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/getagent.go b/tests/mockserver/internal/sdk/models/operations/getagent.go new file mode 100644 index 00000000..471bb945 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getagent.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetAgentRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + // The ID of the agent. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` +} + +func (o *GetAgentRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *GetAgentRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +type GetAgentResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Success + Agent *components.Agent +} + +func (o *GetAgentResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetAgentResponse) GetAgent() *components.Agent { + if o == nil { + return nil + } + return o.Agent +} diff --git a/tests/mockserver/internal/sdk/models/operations/getagentschemas.go b/tests/mockserver/internal/sdk/models/operations/getagentschemas.go new file mode 100644 index 00000000..b4aa8ea6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getagentschemas.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetAgentSchemasRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + // The ID of the agent. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` +} + +func (o *GetAgentSchemasRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *GetAgentSchemasRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +type GetAgentSchemasResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Success + AgentSchemas *components.AgentSchemas +} + +func (o *GetAgentSchemasResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetAgentSchemasResponse) GetAgentSchemas() *components.AgentSchemas { + if o == nil { + return nil + } + return o.AgentSchemas +} diff --git a/tests/mockserver/internal/sdk/models/operations/getanswer.go b/tests/mockserver/internal/sdk/models/operations/getanswer.go new file mode 100644 index 00000000..ce29ef9f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getanswer.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetanswerResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetAnswerResponse *components.GetAnswerResponse +} + +func (o *GetanswerResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetanswerResponse) GetGetAnswerResponse() *components.GetAnswerResponse { + if o == nil { + return nil + } + return o.GetAnswerResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getchat.go b/tests/mockserver/internal/sdk/models/operations/getchat.go new file mode 100644 index 00000000..9ce30de8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getchat.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetchatRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + GetChatRequest components.GetChatRequest `request:"mediaType=application/json"` +} + +func (o *GetchatRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *GetchatRequest) GetGetChatRequest() components.GetChatRequest { + if o == nil { + return components.GetChatRequest{} + } + return o.GetChatRequest +} + +type GetchatResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetChatResponse *components.GetChatResponse +} + +func (o *GetchatResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetchatResponse) GetGetChatResponse() *components.GetChatResponse { + if o == nil { + return nil + } + return o.GetChatResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getchatapplication.go b/tests/mockserver/internal/sdk/models/operations/getchatapplication.go new file mode 100644 index 00000000..ec673be9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getchatapplication.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetchatapplicationRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + GetChatApplicationRequest components.GetChatApplicationRequest `request:"mediaType=application/json"` +} + +func (o *GetchatapplicationRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *GetchatapplicationRequest) GetGetChatApplicationRequest() components.GetChatApplicationRequest { + if o == nil { + return components.GetChatApplicationRequest{} + } + return o.GetChatApplicationRequest +} + +type GetchatapplicationResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetChatApplicationResponse *components.GetChatApplicationResponse +} + +func (o *GetchatapplicationResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetchatapplicationResponse) GetGetChatApplicationResponse() *components.GetChatApplicationResponse { + if o == nil { + return nil + } + return o.GetChatApplicationResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getchatfiles.go b/tests/mockserver/internal/sdk/models/operations/getchatfiles.go new file mode 100644 index 00000000..24bcda85 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getchatfiles.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetchatfilesRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + GetChatFilesRequest components.GetChatFilesRequest `request:"mediaType=application/json"` +} + +func (o *GetchatfilesRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *GetchatfilesRequest) GetGetChatFilesRequest() components.GetChatFilesRequest { + if o == nil { + return components.GetChatFilesRequest{} + } + return o.GetChatFilesRequest +} + +type GetchatfilesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetChatFilesResponse *components.GetChatFilesResponse +} + +func (o *GetchatfilesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetchatfilesResponse) GetGetChatFilesResponse() *components.GetChatFilesResponse { + if o == nil { + return nil + } + return o.GetChatFilesResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getcollection.go b/tests/mockserver/internal/sdk/models/operations/getcollection.go new file mode 100644 index 00000000..38e38763 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getcollection.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetcollectionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetCollectionResponse *components.GetCollectionResponse +} + +func (o *GetcollectionResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetcollectionResponse) GetGetCollectionResponse() *components.GetCollectionResponse { + if o == nil { + return nil + } + return o.GetCollectionResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getdocpermissions.go b/tests/mockserver/internal/sdk/models/operations/getdocpermissions.go new file mode 100644 index 00000000..a509a3a7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getdocpermissions.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetdocpermissionsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetDocPermissionsResponse *components.GetDocPermissionsResponse +} + +func (o *GetdocpermissionsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetdocpermissionsResponse) GetGetDocPermissionsResponse() *components.GetDocPermissionsResponse { + if o == nil { + return nil + } + return o.GetDocPermissionsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getdocuments.go b/tests/mockserver/internal/sdk/models/operations/getdocuments.go new file mode 100644 index 00000000..a2ef5c08 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getdocuments.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetdocumentsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetDocumentsResponse *components.GetDocumentsResponse +} + +func (o *GetdocumentsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetdocumentsResponse) GetGetDocumentsResponse() *components.GetDocumentsResponse { + if o == nil { + return nil + } + return o.GetDocumentsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getdocumentsbyfacets.go b/tests/mockserver/internal/sdk/models/operations/getdocumentsbyfacets.go new file mode 100644 index 00000000..12629e29 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getdocumentsbyfacets.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetdocumentsbyfacetsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetDocumentsByFacetsResponse *components.GetDocumentsByFacetsResponse +} + +func (o *GetdocumentsbyfacetsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetdocumentsbyfacetsResponse) GetGetDocumentsByFacetsResponse() *components.GetDocumentsByFacetsResponse { + if o == nil { + return nil + } + return o.GetDocumentsByFacetsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getdocvisibility.go b/tests/mockserver/internal/sdk/models/operations/getdocvisibility.go new file mode 100644 index 00000000..8fbe2575 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getdocvisibility.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetdocvisibilityRequest struct { + // List of doc-ids which will have their hide status fetched. + DocIds []string `queryParam:"style=form,explode=true,name=docIds"` +} + +func (o *GetdocvisibilityRequest) GetDocIds() []string { + if o == nil { + return nil + } + return o.DocIds +} + +type GetdocvisibilityResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // The visibility status of documents + GetDocumentVisibilityOverridesResponse *components.GetDocumentVisibilityOverridesResponse +} + +func (o *GetdocvisibilityResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetdocvisibilityResponse) GetGetDocumentVisibilityOverridesResponse() *components.GetDocumentVisibilityOverridesResponse { + if o == nil { + return nil + } + return o.GetDocumentVisibilityOverridesResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getpin.go b/tests/mockserver/internal/sdk/models/operations/getpin.go new file mode 100644 index 00000000..9ccb680e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getpin.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetpinResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetPinResponse *components.GetPinResponse +} + +func (o *GetpinResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetpinResponse) GetGetPinResponse() *components.GetPinResponse { + if o == nil { + return nil + } + return o.GetPinResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getpolicy.go b/tests/mockserver/internal/sdk/models/operations/getpolicy.go new file mode 100644 index 00000000..1cac9e52 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getpolicy.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetpolicyRequest struct { + // The id of the policy to fetch. + ID string `pathParam:"style=simple,explode=false,name=id"` + // The version of the policy to fetch. Each time a policy is updated, the older version is still stored. If this is left empty, the latest policy is fetched. + Version *int64 `queryParam:"style=form,explode=true,name=version"` +} + +func (o *GetpolicyRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *GetpolicyRequest) GetVersion() *int64 { + if o == nil { + return nil + } + return o.Version +} + +type GetpolicyResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetDlpReportResponse *components.GetDlpReportResponse +} + +func (o *GetpolicyResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetpolicyResponse) GetGetDlpReportResponse() *components.GetDlpReportResponse { + if o == nil { + return nil + } + return o.GetDlpReportResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getreportstatus.go b/tests/mockserver/internal/sdk/models/operations/getreportstatus.go new file mode 100644 index 00000000..d83ce726 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getreportstatus.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetreportstatusRequest struct { + // The id of the report to get run status for. + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (o *GetreportstatusRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +type GetreportstatusResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Fetches status of report run. + ReportStatusResponse *components.ReportStatusResponse +} + +func (o *GetreportstatusResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetreportstatusResponse) GetReportStatusResponse() *components.ReportStatusResponse { + if o == nil { + return nil + } + return o.ReportStatusResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getrestapiv1toolslist.go b/tests/mockserver/internal/sdk/models/operations/getrestapiv1toolslist.go new file mode 100644 index 00000000..4d9d36df --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getrestapiv1toolslist.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetRestAPIV1ToolsListRequest struct { + // Optional array of tool names to filter by + ToolNames []string `queryParam:"style=form,explode=false,name=toolNames"` +} + +func (o *GetRestAPIV1ToolsListRequest) GetToolNames() []string { + if o == nil { + return nil + } + return o.ToolNames +} + +type GetRestAPIV1ToolsListResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful operation + ToolsListResponse *components.ToolsListResponse +} + +func (o *GetRestAPIV1ToolsListResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetRestAPIV1ToolsListResponse) GetToolsListResponse() *components.ToolsListResponse { + if o == nil { + return nil + } + return o.ToolsListResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/getshortcut.go b/tests/mockserver/internal/sdk/models/operations/getshortcut.go new file mode 100644 index 00000000..032c32c5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/getshortcut.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetshortcutResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetShortcutResponse *components.GetShortcutResponse +} + +func (o *GetshortcutResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetshortcutResponse) GetGetShortcutResponse() *components.GetShortcutResponse { + if o == nil { + return nil + } + return o.GetShortcutResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/insights.go b/tests/mockserver/internal/sdk/models/operations/insights.go new file mode 100644 index 00000000..0f883502 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/insights.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type InsightsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + InsightsResponse *components.InsightsResponse +} + +func (o *InsightsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *InsightsResponse) GetInsightsResponse() *components.InsightsResponse { + if o == nil { + return nil + } + return o.InsightsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listanswers.go b/tests/mockserver/internal/sdk/models/operations/listanswers.go new file mode 100644 index 00000000..2229cf7f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listanswers.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ListanswersResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ListAnswersResponse *components.ListAnswersResponse +} + +func (o *ListanswersResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListanswersResponse) GetListAnswersResponse() *components.ListAnswersResponse { + if o == nil { + return nil + } + return o.ListAnswersResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listchats.go b/tests/mockserver/internal/sdk/models/operations/listchats.go new file mode 100644 index 00000000..36a64f6c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listchats.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ListchatsRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` +} + +func (o *ListchatsRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +type ListchatsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ListChatsResponse *components.ListChatsResponse +} + +func (o *ListchatsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListchatsResponse) GetListChatsResponse() *components.ListChatsResponse { + if o == nil { + return nil + } + return o.ListChatsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listcollections.go b/tests/mockserver/internal/sdk/models/operations/listcollections.go new file mode 100644 index 00000000..9efddbd6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listcollections.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ListcollectionsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ListCollectionsResponse *components.ListCollectionsResponse +} + +func (o *ListcollectionsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListcollectionsResponse) GetListCollectionsResponse() *components.ListCollectionsResponse { + if o == nil { + return nil + } + return o.ListCollectionsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listentities.go b/tests/mockserver/internal/sdk/models/operations/listentities.go new file mode 100644 index 00000000..d05441f9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listentities.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ListentitiesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ListEntitiesResponse *components.ListEntitiesResponse +} + +func (o *ListentitiesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListentitiesResponse) GetListEntitiesResponse() *components.ListEntitiesResponse { + if o == nil { + return nil + } + return o.ListEntitiesResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listpins.go b/tests/mockserver/internal/sdk/models/operations/listpins.go new file mode 100644 index 00000000..45c93a45 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listpins.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +// ListpinsRequest - List pins request +type ListpinsRequest struct { +} + +type ListpinsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ListPinsResponse *components.ListPinsResponse +} + +func (o *ListpinsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListpinsResponse) GetListPinsResponse() *components.ListPinsResponse { + if o == nil { + return nil + } + return o.ListPinsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listpolicies.go b/tests/mockserver/internal/sdk/models/operations/listpolicies.go new file mode 100644 index 00000000..61d27e4f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listpolicies.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ListpoliciesRequest struct { + // Filter to return reports with a given value of auto-hide. + AutoHide *bool `queryParam:"style=form,explode=true,name=autoHide"` + // Filter to return reports with a given frequency. + Frequency *string `queryParam:"style=form,explode=true,name=frequency"` +} + +func (o *ListpoliciesRequest) GetAutoHide() *bool { + if o == nil { + return nil + } + return o.AutoHide +} + +func (o *ListpoliciesRequest) GetFrequency() *string { + if o == nil { + return nil + } + return o.Frequency +} + +type ListpoliciesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ListDlpReportsResponse *components.ListDlpReportsResponse +} + +func (o *ListpoliciesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListpoliciesResponse) GetListDlpReportsResponse() *components.ListDlpReportsResponse { + if o == nil { + return nil + } + return o.ListDlpReportsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listshortcuts.go b/tests/mockserver/internal/sdk/models/operations/listshortcuts.go new file mode 100644 index 00000000..a5b0962f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listshortcuts.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ListshortcutsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ListShortcutsPaginatedResponse *components.ListShortcutsPaginatedResponse +} + +func (o *ListshortcutsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListshortcutsResponse) GetListShortcutsPaginatedResponse() *components.ListShortcutsPaginatedResponse { + if o == nil { + return nil + } + return o.ListShortcutsPaginatedResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/listverifications.go b/tests/mockserver/internal/sdk/models/operations/listverifications.go new file mode 100644 index 00000000..13015ee5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/listverifications.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type ListverificationsRequest struct { + // Maximum number of documents to return + Count *int64 `queryParam:"style=form,explode=true,name=count"` +} + +func (o *ListverificationsRequest) GetCount() *int64 { + if o == nil { + return nil + } + return o.Count +} + +type ListverificationsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + VerificationFeed *components.VerificationFeed +} + +func (o *ListverificationsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *ListverificationsResponse) GetVerificationFeed() *components.VerificationFeed { + if o == nil { + return nil + } + return o.VerificationFeed +} diff --git a/tests/mockserver/internal/sdk/models/operations/messages.go b/tests/mockserver/internal/sdk/models/operations/messages.go new file mode 100644 index 00000000..c33c0888 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/messages.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type MessagesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + MessagesResponse *components.MessagesResponse +} + +func (o *MessagesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *MessagesResponse) GetMessagesResponse() *components.MessagesResponse { + if o == nil { + return nil + } + return o.MessagesResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/people.go b/tests/mockserver/internal/sdk/models/operations/people.go new file mode 100644 index 00000000..fe1bf61d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/people.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PeopleResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + PeopleResponse *components.PeopleResponse +} + +func (o *PeopleResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PeopleResponse) GetPeopleResponse() *components.PeopleResponse { + if o == nil { + return nil + } + return o.PeopleResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/pin.go b/tests/mockserver/internal/sdk/models/operations/pin.go new file mode 100644 index 00000000..ba2d47e1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/pin.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PinResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + PinDocument *components.PinDocument +} + +func (o *PinResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PinResponse) GetPinDocument() *components.PinDocument { + if o == nil { + return nil + } + return o.PinDocument +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go new file mode 100644 index 00000000..ec4316c1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1AdddatasourceResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1AdddatasourceResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1betausers.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1betausers.go new file mode 100644 index 00000000..eaab9c65 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1betausers.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BetausersResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BetausersResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexdocuments.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexdocuments.go new file mode 100644 index 00000000..91856daa --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexdocuments.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BulkindexdocumentsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BulkindexdocumentsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexemployees.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexemployees.go new file mode 100644 index 00000000..9db6475f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexemployees.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BulkindexemployeesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BulkindexemployeesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexgroups.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexgroups.go new file mode 100644 index 00000000..61a821cd --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexgroups.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BulkindexgroupsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BulkindexgroupsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexmemberships.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexmemberships.go new file mode 100644 index 00000000..e2f87c0d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexmemberships.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BulkindexmembershipsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BulkindexmembershipsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexshortcuts.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexshortcuts.go new file mode 100644 index 00000000..6348bbd6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexshortcuts.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BulkindexshortcutsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BulkindexshortcutsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexteams.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexteams.go new file mode 100644 index 00000000..a6a54ca3 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexteams.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BulkindexteamsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BulkindexteamsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexusers.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexusers.go new file mode 100644 index 00000000..eca83011 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1bulkindexusers.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1BulkindexusersResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1BulkindexusersResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1checkdocumentaccess.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1checkdocumentaccess.go new file mode 100644 index 00000000..daa947b5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1checkdocumentaccess.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1CheckdocumentaccessResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + CheckDocumentAccessResponse *components.CheckDocumentAccessResponse +} + +func (o *PostAPIIndexV1CheckdocumentaccessResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1CheckdocumentaccessResponse) GetCheckDocumentAccessResponse() *components.CheckDocumentAccessResponse { + if o == nil { + return nil + } + return o.CheckDocumentAccessResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocument.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocument.go new file mode 100644 index 00000000..664ceb3b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocument.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DebugDatasourceDocumentRequest struct { + // The datasource to which the document belongs + Datasource string `pathParam:"style=simple,explode=false,name=datasource"` + DebugDocumentRequest components.DebugDocumentRequest `request:"mediaType=application/json"` +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentRequest) GetDebugDocumentRequest() components.DebugDocumentRequest { + if o == nil { + return components.DebugDocumentRequest{} + } + return o.DebugDocumentRequest +} + +type PostAPIIndexV1DebugDatasourceDocumentResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + DebugDocumentResponse *components.DebugDocumentResponse +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentResponse) GetDebugDocumentResponse() *components.DebugDocumentResponse { + if o == nil { + return nil + } + return o.DebugDocumentResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocuments.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocuments.go new file mode 100644 index 00000000..437e6f06 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcedocuments.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DebugDatasourceDocumentsRequest struct { + // The datasource to which the document belongs + Datasource string `pathParam:"style=simple,explode=false,name=datasource"` + DebugDocumentsRequest components.DebugDocumentsRequest `request:"mediaType=application/json"` +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentsRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentsRequest) GetDebugDocumentsRequest() components.DebugDocumentsRequest { + if o == nil { + return components.DebugDocumentsRequest{} + } + return o.DebugDocumentsRequest +} + +type PostAPIIndexV1DebugDatasourceDocumentsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + DebugDocumentsResponse *components.DebugDocumentsResponse +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1DebugDatasourceDocumentsResponse) GetDebugDocumentsResponse() *components.DebugDocumentsResponse { + if o == nil { + return nil + } + return o.DebugDocumentsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcestatus.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcestatus.go new file mode 100644 index 00000000..e9913883 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourcestatus.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DebugDatasourceStatusRequest struct { + // The datasource to get debug status for. + Datasource string `pathParam:"style=simple,explode=false,name=datasource"` +} + +func (o *PostAPIIndexV1DebugDatasourceStatusRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +type PostAPIIndexV1DebugDatasourceStatusResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + DebugDatasourceStatusResponse *components.DebugDatasourceStatusResponse +} + +func (o *PostAPIIndexV1DebugDatasourceStatusResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1DebugDatasourceStatusResponse) GetDebugDatasourceStatusResponse() *components.DebugDatasourceStatusResponse { + if o == nil { + return nil + } + return o.DebugDatasourceStatusResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourceuser.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourceuser.go new file mode 100644 index 00000000..5ead8da7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1debugdatasourceuser.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DebugDatasourceUserRequest struct { + // The datasource to which the user belongs + Datasource string `pathParam:"style=simple,explode=false,name=datasource"` + DebugUserRequest components.DebugUserRequest `request:"mediaType=application/json"` +} + +func (o *PostAPIIndexV1DebugDatasourceUserRequest) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *PostAPIIndexV1DebugDatasourceUserRequest) GetDebugUserRequest() components.DebugUserRequest { + if o == nil { + return components.DebugUserRequest{} + } + return o.DebugUserRequest +} + +type PostAPIIndexV1DebugDatasourceUserResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + DebugUserResponse *components.DebugUserResponse +} + +func (o *PostAPIIndexV1DebugDatasourceUserResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1DebugDatasourceUserResponse) GetDebugUserResponse() *components.DebugUserResponse { + if o == nil { + return nil + } + return o.DebugUserResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletedocument.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletedocument.go new file mode 100644 index 00000000..cb9dcbeb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletedocument.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DeletedocumentResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1DeletedocumentResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteemployee.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteemployee.go new file mode 100644 index 00000000..c2ff187f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteemployee.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DeleteemployeeResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1DeleteemployeeResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletegroup.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletegroup.go new file mode 100644 index 00000000..51bf5588 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletegroup.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DeletegroupResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1DeletegroupResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletemembership.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletemembership.go new file mode 100644 index 00000000..0c2cf3c6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deletemembership.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DeletemembershipResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1DeletemembershipResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteteam.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteteam.go new file mode 100644 index 00000000..3e7591f4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteteam.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DeleteteamResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1DeleteteamResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteuser.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteuser.go new file mode 100644 index 00000000..f2836359 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1deleteuser.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1DeleteuserResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1DeleteuserResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdatasourceconfig.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdatasourceconfig.go new file mode 100644 index 00000000..87af103e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdatasourceconfig.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1GetdatasourceconfigResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + CustomDatasourceConfig *components.CustomDatasourceConfig +} + +func (o *PostAPIIndexV1GetdatasourceconfigResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1GetdatasourceconfigResponse) GetCustomDatasourceConfig() *components.CustomDatasourceConfig { + if o == nil { + return nil + } + return o.CustomDatasourceConfig +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentcount.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentcount.go new file mode 100644 index 00000000..e8346738 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentcount.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1GetdocumentcountResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetDocumentCountResponse *components.GetDocumentCountResponse +} + +func (o *PostAPIIndexV1GetdocumentcountResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1GetdocumentcountResponse) GetGetDocumentCountResponse() *components.GetDocumentCountResponse { + if o == nil { + return nil + } + return o.GetDocumentCountResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentstatus.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentstatus.go new file mode 100644 index 00000000..23e6ce27 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getdocumentstatus.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1GetdocumentstatusResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetDocumentStatusResponse *components.GetDocumentStatusResponse +} + +func (o *PostAPIIndexV1GetdocumentstatusResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1GetdocumentstatusResponse) GetGetDocumentStatusResponse() *components.GetDocumentStatusResponse { + if o == nil { + return nil + } + return o.GetDocumentStatusResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1getusercount.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getusercount.go new file mode 100644 index 00000000..d65e1df9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1getusercount.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1GetusercountResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + GetUserCountResponse *components.GetUserCountResponse +} + +func (o *PostAPIIndexV1GetusercountResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1GetusercountResponse) GetGetUserCountResponse() *components.GetUserCountResponse { + if o == nil { + return nil + } + return o.GetUserCountResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocument.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocument.go new file mode 100644 index 00000000..0dee9b59 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocument.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1IndexdocumentResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1IndexdocumentResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocuments.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocuments.go new file mode 100644 index 00000000..dc8114ae --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexdocuments.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1IndexdocumentsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1IndexdocumentsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexemployee.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexemployee.go new file mode 100644 index 00000000..78fee1b1 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexemployee.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1IndexemployeeResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1IndexemployeeResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexgroup.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexgroup.go new file mode 100644 index 00000000..2376f01a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexgroup.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1IndexgroupResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1IndexgroupResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexmembership.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexmembership.go new file mode 100644 index 00000000..bc379818 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexmembership.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1IndexmembershipResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1IndexmembershipResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexteam.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexteam.go new file mode 100644 index 00000000..e21ea660 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexteam.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1IndexteamResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1IndexteamResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexuser.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexuser.go new file mode 100644 index 00000000..97d96c43 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1indexuser.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1IndexuserResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1IndexuserResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1processalldocuments.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1processalldocuments.go new file mode 100644 index 00000000..842e0b83 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1processalldocuments.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1ProcessalldocumentsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1ProcessalldocumentsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1processallemployeesandteams.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1processallemployeesandteams.go new file mode 100644 index 00000000..6836e1b0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1processallemployeesandteams.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1ProcessallemployeesandteamsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1ProcessallemployeesandteamsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1processallmemberships.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1processallmemberships.go new file mode 100644 index 00000000..7fda5903 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1processallmemberships.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1ProcessallmembershipsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1ProcessallmembershipsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1rotatetoken.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1rotatetoken.go new file mode 100644 index 00000000..d0333d02 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1rotatetoken.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1RotatetokenResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + RotateTokenResponse *components.RotateTokenResponse +} + +func (o *PostAPIIndexV1RotatetokenResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostAPIIndexV1RotatetokenResponse) GetRotateTokenResponse() *components.RotateTokenResponse { + if o == nil { + return nil + } + return o.RotateTokenResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1updatepermissions.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1updatepermissions.go new file mode 100644 index 00000000..677130bb --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1updatepermissions.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1UpdatepermissionsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1UpdatepermissionsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postapiindexv1uploadshortcuts.go b/tests/mockserver/internal/sdk/models/operations/postapiindexv1uploadshortcuts.go new file mode 100644 index 00000000..cc5dbf54 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postapiindexv1uploadshortcuts.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostAPIIndexV1UploadshortcutsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PostAPIIndexV1UploadshortcutsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/postrestapiv1toolscall.go b/tests/mockserver/internal/sdk/models/operations/postrestapiv1toolscall.go new file mode 100644 index 00000000..eb2eea47 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/postrestapiv1toolscall.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PostRestAPIV1ToolsCallResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful operation + ToolsCallResponse *components.ToolsCallResponse +} + +func (o *PostRestAPIV1ToolsCallResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PostRestAPIV1ToolsCallResponse) GetToolsCallResponse() *components.ToolsCallResponse { + if o == nil { + return nil + } + return o.ToolsCallResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/recommendations.go b/tests/mockserver/internal/sdk/models/operations/recommendations.go new file mode 100644 index 00000000..9c74d480 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/recommendations.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type RecommendationsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + ResultsResponse *components.ResultsResponse +} + +func (o *RecommendationsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *RecommendationsResponse) GetResultsResponse() *components.ResultsResponse { + if o == nil { + return nil + } + return o.ResultsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/search.go b/tests/mockserver/internal/sdk/models/operations/search.go new file mode 100644 index 00000000..6b1d9873 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/search.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type SearchResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + SearchResponse *components.SearchResponse +} + +func (o *SearchResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *SearchResponse) GetSearchResponse() *components.SearchResponse { + if o == nil { + return nil + } + return o.SearchResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/searchagents.go b/tests/mockserver/internal/sdk/models/operations/searchagents.go new file mode 100644 index 00000000..0e9a0715 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/searchagents.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type SearchAgentsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Success + SearchAgentsResponse *components.SearchAgentsResponse +} + +func (o *SearchAgentsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *SearchAgentsResponse) GetSearchAgentsResponse() *components.SearchAgentsResponse { + if o == nil { + return nil + } + return o.SearchAgentsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/setdocvisibility.go b/tests/mockserver/internal/sdk/models/operations/setdocvisibility.go new file mode 100644 index 00000000..3b077768 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/setdocvisibility.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type SetdocvisibilityResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + UpdateDocumentVisibilityOverridesResponse *components.UpdateDocumentVisibilityOverridesResponse +} + +func (o *SetdocvisibilityResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *SetdocvisibilityResponse) GetUpdateDocumentVisibilityOverridesResponse() *components.UpdateDocumentVisibilityOverridesResponse { + if o == nil { + return nil + } + return o.UpdateDocumentVisibilityOverridesResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/summarize.go b/tests/mockserver/internal/sdk/models/operations/summarize.go new file mode 100644 index 00000000..90cc598d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/summarize.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type SummarizeResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + SummarizeResponse *components.SummarizeResponse +} + +func (o *SummarizeResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *SummarizeResponse) GetSummarizeResponse() *components.SummarizeResponse { + if o == nil { + return nil + } + return o.SummarizeResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/unpin.go b/tests/mockserver/internal/sdk/models/operations/unpin.go new file mode 100644 index 00000000..4bff2a3c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/unpin.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type UnpinResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *UnpinResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/updateannouncement.go b/tests/mockserver/internal/sdk/models/operations/updateannouncement.go new file mode 100644 index 00000000..927436ef --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/updateannouncement.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type UpdateannouncementResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + Announcement *components.Announcement +} + +func (o *UpdateannouncementResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *UpdateannouncementResponse) GetAnnouncement() *components.Announcement { + if o == nil { + return nil + } + return o.Announcement +} diff --git a/tests/mockserver/internal/sdk/models/operations/updatepolicy.go b/tests/mockserver/internal/sdk/models/operations/updatepolicy.go new file mode 100644 index 00000000..8171038c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/updatepolicy.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type UpdatepolicyRequest struct { + // The id of the policy to fetch. + ID string `pathParam:"style=simple,explode=false,name=id"` + UpdateDlpReportRequest components.UpdateDlpReportRequest `request:"mediaType=application/json"` +} + +func (o *UpdatepolicyRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *UpdatepolicyRequest) GetUpdateDlpReportRequest() components.UpdateDlpReportRequest { + if o == nil { + return components.UpdateDlpReportRequest{} + } + return o.UpdateDlpReportRequest +} + +type UpdatepolicyResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + UpdateDlpReportResponse *components.UpdateDlpReportResponse +} + +func (o *UpdatepolicyResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *UpdatepolicyResponse) GetUpdateDlpReportResponse() *components.UpdateDlpReportResponse { + if o == nil { + return nil + } + return o.UpdateDlpReportResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/updateshortcut.go b/tests/mockserver/internal/sdk/models/operations/updateshortcut.go new file mode 100644 index 00000000..ebfd6f72 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/updateshortcut.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type UpdateshortcutResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + UpdateShortcutResponse *components.UpdateShortcutResponse +} + +func (o *UpdateshortcutResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *UpdateshortcutResponse) GetUpdateShortcutResponse() *components.UpdateShortcutResponse { + if o == nil { + return nil + } + return o.UpdateShortcutResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/uploadchatfiles.go b/tests/mockserver/internal/sdk/models/operations/uploadchatfiles.go new file mode 100644 index 00000000..d11a18d5 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/uploadchatfiles.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type UploadchatfilesRequest struct { + // The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. + TimezoneOffset *int64 `queryParam:"style=form,explode=true,name=timezoneOffset"` + UploadChatFilesRequest components.UploadChatFilesRequest `request:"mediaType=multipart/form-data"` +} + +func (o *UploadchatfilesRequest) GetTimezoneOffset() *int64 { + if o == nil { + return nil + } + return o.TimezoneOffset +} + +func (o *UploadchatfilesRequest) GetUploadChatFilesRequest() components.UploadChatFilesRequest { + if o == nil { + return components.UploadChatFilesRequest{} + } + return o.UploadChatFilesRequest +} + +type UploadchatfilesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + UploadChatFilesResponse *components.UploadChatFilesResponse +} + +func (o *UploadchatfilesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *UploadchatfilesResponse) GetUploadChatFilesResponse() *components.UploadChatFilesResponse { + if o == nil { + return nil + } + return o.UploadChatFilesResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/verify.go b/tests/mockserver/internal/sdk/models/operations/verify.go new file mode 100644 index 00000000..1f2fc93e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/verify.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type VerifyResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // OK + Verification *components.Verification +} + +func (o *VerifyResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *VerifyResponse) GetVerification() *components.Verification { + if o == nil { + return nil + } + return o.Verification +} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/collectionerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/collectionerror.go new file mode 100644 index 00000000..6eb492d8 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/sdkerrors/collectionerror.go @@ -0,0 +1,20 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "mockserver/internal/sdk/models/components" +) + +type CollectionError struct { + ErrorCode components.CollectionErrorErrorCode `json:"errorCode"` + HTTPMeta components.HTTPMetadata `json:"-"` +} + +var _ error = &CollectionError{} + +func (e *CollectionError) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/gleandataerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/gleandataerror.go new file mode 100644 index 00000000..5870c8ac --- /dev/null +++ b/tests/mockserver/internal/sdk/models/sdkerrors/gleandataerror.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "mockserver/internal/sdk/models/components" +) + +type GleanDataError struct { + // Indicates the gmail results could not be fetched due to bad token. + BadGmailToken *bool `json:"badGmailToken,omitempty"` + // Indicates the outlook results could not be fetched due to bad token. + BadOutlookToken *bool `json:"badOutlookToken,omitempty"` + // Indicates results could not be fetched due to invalid operators in the query. + InvalidOperators []components.InvalidOperatorValueError `json:"invalidOperators,omitempty"` + ErrorMessages []components.ErrorMessage `json:"errorMessages,omitempty"` + HTTPMeta components.HTTPMetadata `json:"-"` +} + +var _ error = &GleanDataError{} + +func (e *GleanDataError) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/tests/mockserver/internal/sdk/types/bigint.go b/tests/mockserver/internal/sdk/types/bigint.go new file mode 100644 index 00000000..9c6a086d --- /dev/null +++ b/tests/mockserver/internal/sdk/types/bigint.go @@ -0,0 +1,21 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package types + +import ( + "fmt" + "math/big" +) + +// MustNewBigIntFromString returns an instance of big.Int from a string +// The string is assumed to be base 10 and if it is not a valid big.Int +// then the function panics. +// Avoid using this function in production code. +func MustNewBigIntFromString(s string) *big.Int { + i, ok := new(big.Int).SetString(s, 10) + if !ok { + panic(fmt.Errorf("failed to parse string as big.Int")) + } + + return i +} diff --git a/tests/mockserver/internal/sdk/types/date.go b/tests/mockserver/internal/sdk/types/date.go new file mode 100644 index 00000000..5b2782f2 --- /dev/null +++ b/tests/mockserver/internal/sdk/types/date.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package types + +import ( + "encoding/json" + "fmt" + "strings" + "time" +) + +// Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02". +type Date struct { + time.Time +} + +var ( + _ json.Marshaler = &Date{} + _ json.Unmarshaler = &Date{} + _ fmt.Stringer = &Date{} +) + +// NewDate returns an instance of Date from a time.Time. +func NewDate(t time.Time) *Date { + d := DateFromTime(t) + return &d +} + +// DateFromTime returns a Date from a time.Time. +func DateFromTime(t time.Time) Date { + return Date{t} +} + +// NewDateFromString returns an instance of Date from a string formatted as "2006-01-02". +func NewDateFromString(str string) (*Date, error) { + d, err := DateFromString(str) + if err != nil { + return nil, err + } + + return &d, nil +} + +// DateFromString returns a Date from a string formatted as "2006-01-02". +func DateFromString(str string) (Date, error) { + var d Date + var err error + + d.Time, err = time.Parse("2006-01-02", str) + return d, err +} + +// MustNewDateFromString returns an instance of Date from a string formatted as "2006-01-02" or panics. +// Avoid using this function in production code. +func MustNewDateFromString(str string) *Date { + d := MustDateFromString(str) + return &d +} + +// MustDateFromString returns a Date from a string formatted as "2006-01-02" or panics. +// Avoid using this function in production code. +func MustDateFromString(str string) Date { + d, err := DateFromString(str) + if err != nil { + panic(err) + } + return d +} + +func (d Date) GetTime() time.Time { + return d.Time +} + +func (d Date) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"%s"`, d.Time.Format("2006-01-02"))), nil +} + +func (d *Date) UnmarshalJSON(data []byte) error { + var err error + + str := string(data) + str = strings.Trim(str, `"`) + + d.Time, err = time.Parse("2006-01-02", str) + return err +} + +func (d Date) String() string { + return d.Time.Format("2006-01-02") +} diff --git a/tests/mockserver/internal/sdk/types/datetime.go b/tests/mockserver/internal/sdk/types/datetime.go new file mode 100644 index 00000000..3eff332d --- /dev/null +++ b/tests/mockserver/internal/sdk/types/datetime.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package types + +import "time" + +// MustTimeFromString returns a time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. +// Avoid using this function in production code. +func MustTimeFromString(str string) time.Time { + t, err := time.Parse(time.RFC3339, str) + if err != nil { + panic(err) + } + + return t +} + +// MustNewTimeFromString returns an instance of time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. +// Avoid using this function in production code. +func MustNewTimeFromString(str string) *time.Time { + t := MustTimeFromString(str) + return &t +} diff --git a/tests/mockserver/internal/sdk/types/decimal.go b/tests/mockserver/internal/sdk/types/decimal.go new file mode 100644 index 00000000..d8429bc6 --- /dev/null +++ b/tests/mockserver/internal/sdk/types/decimal.go @@ -0,0 +1,20 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package types + +import ( + "fmt" + + "github.com/ericlagergren/decimal" +) + +// MustNewDecimalFromString returns an instance of Decimal from a string +// Avoid using this function in production code. +func MustNewDecimalFromString(s string) *decimal.Big { + d, ok := new(decimal.Big).SetString(s) + if !ok { + panic(fmt.Errorf("failed to parse string as decimal.Big")) + } + + return d +} diff --git a/tests/mockserver/internal/sdk/types/jsonl/jsonl.go b/tests/mockserver/internal/sdk/types/jsonl/jsonl.go new file mode 100644 index 00000000..26df95cf --- /dev/null +++ b/tests/mockserver/internal/sdk/types/jsonl/jsonl.go @@ -0,0 +1,7 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package jsonl + +type JsonLStream[T any] struct { + // TODO to be implemented +} diff --git a/tests/mockserver/internal/sdk/types/pointers.go b/tests/mockserver/internal/sdk/types/pointers.go new file mode 100644 index 00000000..35c439d2 --- /dev/null +++ b/tests/mockserver/internal/sdk/types/pointers.go @@ -0,0 +1,11 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package types + +func String(s string) *string { return &s } +func Bool(b bool) *bool { return &b } +func Int(i int) *int { return &i } +func Int64(i int64) *int64 { return &i } +func Float32(f float32) *float32 { return &f } +func Float64(f float64) *float64 { return &f } +func Pointer[T any](v T) *T { return &v } diff --git a/tests/mockserver/internal/sdk/utils/json.go b/tests/mockserver/internal/sdk/utils/json.go new file mode 100644 index 00000000..ca93aa5b --- /dev/null +++ b/tests/mockserver/internal/sdk/utils/json.go @@ -0,0 +1,675 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package utils + +import ( + "bytes" + "encoding/json" + "fmt" + "math/big" + "reflect" + "strconv" + "strings" + "time" + "unsafe" + + "mockserver/internal/sdk/types" + + "github.com/ericlagergren/decimal" +) + +func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error) { + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel { + return json.Marshal(v) + } + + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + omitEmpty := false + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag == "omitempty" { + omitEmpty = true + } else { + fieldName = tag + } + } + } + + if (isNil(field.Type, fieldVal) || isEmpty(field.Type, fieldVal)) && field.Tag.Get("const") == "" { + if omitEmpty { + continue + } + } + + if !field.IsExported() && field.Tag.Get("const") == "" { + continue + } + + additionalProperties := field.Tag.Get("additionalProperties") + if fieldName == "-" && additionalProperties == "" { + continue + } + + if additionalProperties == "true" { + if isNil(field.Type, fieldVal) { + continue + } + fieldVal := trueReflectValue(fieldVal) + if fieldVal.Type().Kind() != reflect.Map { + return nil, fmt.Errorf("additionalProperties must be a map") + } + + for _, key := range fieldVal.MapKeys() { + r, err := marshalValue(fieldVal.MapIndex(key).Interface(), field.Tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + continue + } + + var fv interface{} + + if field.IsExported() { + fv = fieldVal.Interface() + } else { + pt := reflect.New(typ).Elem() + pt.Set(val) + + pf := pt.Field(i) + + fv = reflect.NewAt(pf.Type(), unsafe.Pointer(pf.UnsafeAddr())).Elem().Interface() + } + + r, err := marshalValue(fv, field.Tag) + if err != nil { + return nil, err + } + + out[fieldName] = r + } + + return json.Marshal(out) + default: + return marshalValue(v, tag) + } +} + +func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, disallowUnknownFields bool) error { + if reflect.TypeOf(v).Kind() != reflect.Ptr { + return fmt.Errorf("v must be a pointer") + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel || bytes.Equal(b, []byte("null")) { + d := json.NewDecoder(bytes.NewReader(b)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(v) + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(b, &unmarhsaled); err != nil { + return err + } + + var additionalPropertiesField *reflect.StructField + var additionalPropertiesValue *reflect.Value + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag != "omitempty" { + fieldName = tag + } + } + } + + if field.Tag.Get("additionalProperties") == "true" { + additionalPropertiesField = &field + additionalPropertiesValue = &fieldVal + continue + } + + // If we receive a value for a const field ignore it but mark it as unmarshaled + if field.Tag.Get("const") != "" { + if r, ok := unmarhsaled[fieldName]; ok { + val := string(r) + + if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { + var err error + val, err = strconv.Unquote(val) + if err != nil { + return fmt.Errorf("failed to unquote const field `%s` value `%s`: %w", fieldName, val, err) + } + } + constValue := field.Tag.Get("const") + if val != constValue { + return fmt.Errorf("const field `%s` does not match expected value `%s` got `%s`", fieldName, constValue, val) + } + + delete(unmarhsaled, fieldName) + } + } else if !field.IsExported() { + continue + } + + value, ok := unmarhsaled[fieldName] + if !ok { + defaultTag := field.Tag.Get("default") + if defaultTag != "" { + value = handleDefaultConstValue(defaultTag, fieldVal.Interface(), field.Tag) + ok = true + } + } else { + delete(unmarhsaled, fieldName) + } + + if ok { + if err := unmarshalValue(value, fieldVal, field.Tag, disallowUnknownFields); err != nil { + return err + } + } + } + + keys := make([]string, 0, len(unmarhsaled)) + for k := range unmarhsaled { + keys = append(keys, k) + } + + if len(keys) > 0 { + if disallowUnknownFields && (additionalPropertiesField == nil || additionalPropertiesValue == nil) { + return fmt.Errorf("unknown fields: %v", keys) + } + + if additionalPropertiesField != nil && additionalPropertiesValue != nil { + typeOfMap := additionalPropertiesField.Type + if additionalPropertiesValue.Type().Kind() == reflect.Interface { + typeOfMap = reflect.TypeOf(map[string]interface{}{}) + } else if additionalPropertiesValue.Type().Kind() != reflect.Map { + return fmt.Errorf("additionalProperties must be a map") + } + + mapValue := reflect.MakeMap(typeOfMap) + + for key, value := range unmarhsaled { + val := reflect.New(typeOfMap.Elem()) + + if err := unmarshalValue(value, val, additionalPropertiesField.Tag, disallowUnknownFields); err != nil { + return err + } + + if val.Elem().Type().String() == typeOfMap.Elem().String() { + mapValue.SetMapIndex(reflect.ValueOf(key), val.Elem()) + } else { + mapValue.SetMapIndex(reflect.ValueOf(key), trueReflectValue(val)) + } + + } + if additionalPropertiesValue.Type().Kind() == reflect.Interface { + additionalPropertiesValue.Set(mapValue) + } else { + additionalPropertiesValue.Set(mapValue) + } + } + } + default: + return unmarshalValue(b, reflect.ValueOf(v), tag, disallowUnknownFields) + } + + return nil +} + +func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) { + constTag := tag.Get("const") + if constTag != "" { + return handleDefaultConstValue(constTag, v, tag), nil + } + + if isNil(reflect.TypeOf(v), reflect.ValueOf(v)) { + defaultTag := tag.Get("default") + if defaultTag != "" { + return handleDefaultConstValue(defaultTag, v, tag), nil + } + + return []byte("null"), nil + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + switch typ.Kind() { + case reflect.Int64: + format := tag.Get("integer") + if format == "string" { + b := val.Interface().(int64) + return []byte(fmt.Sprintf(`"%d"`, b)), nil + } + case reflect.Float64: + format := tag.Get("number") + if format == "string" { + b := val.Interface().(float64) + return []byte(fmt.Sprintf(`"%g"`, b)), nil + } + case reflect.Map: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for _, key := range val.MapKeys() { + itemVal := val.MapIndex(key) + + if isNil(itemVal.Type(), itemVal) { + out[key.String()] = []byte("null") + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + return json.Marshal(out) + case reflect.Slice, reflect.Array: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := []json.RawMessage{} + + for i := 0; i < val.Len(); i++ { + itemVal := val.Index(i) + + if isNil(itemVal.Type(), itemVal) { + out = append(out, []byte("null")) + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out = append(out, r) + } + + return json.Marshal(out) + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, val.Interface().(time.Time).Format(time.RFC3339Nano))), nil + case reflect.TypeOf(big.Int{}): + format := tag.Get("bigint") + if format == "string" { + b := val.Interface().(big.Int) + return []byte(fmt.Sprintf(`"%s"`, (&b).String())), nil + } + case reflect.TypeOf(decimal.Big{}): + format := tag.Get("decimal") + if format == "number" { + b := val.Interface().(decimal.Big) + f, ok := (&b).Float64() + if ok { + return []byte(b.String()), nil + } + + return []byte(fmt.Sprintf(`%f`, f)), nil + } + } + } + + return json.Marshal(v) +} + +func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.StructTag) json.RawMessage { + if tagValue == "null" { + return []byte("null") + } + + typ := dereferenceTypePointer(reflect.TypeOf(val)) + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + case reflect.TypeOf(big.Int{}): + bigIntTag := tag.Get("bigint") + if bigIntTag == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(int64(0)): + format := tag.Get("integer") + if format == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(float64(0)): + format := tag.Get("number") + if format == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(decimal.Big{}): + decimalTag := tag.Get("decimal") + if decimalTag != "number" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(types.Date{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + default: + if typ.Kind() == reflect.String { + return []byte(fmt.Sprintf("%q", tagValue)) + } + } + + return []byte(tagValue) +} + +func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag, disallowUnknownFields bool) error { + if bytes.Equal(value, []byte("null")) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + typ := dereferenceTypePointer(v.Type()) + + switch typ.Kind() { + case reflect.Int64: + var b int64 + + format := tag.Get("integer") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var err error + b, err = strconv.ParseInt(s, 10, 64) + if err != nil { + return fmt.Errorf("failed to parse string as int64: %w", err) + } + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + } + case reflect.Float64: + var b float64 + + format := tag.Get("number") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var err error + b, err = strconv.ParseFloat(s, 64) + if err != nil { + return fmt.Errorf("failed to parse string as float64: %w", err) + } + + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + } + case reflect.Map: + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(value, &unmarhsaled); err != nil { + return err + } + + m := reflect.MakeMap(typ) + + for k, value := range unmarhsaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + m.SetMapIndex(reflect.ValueOf(k), itemVal.Elem()) + } + + v.Set(m) + return nil + case reflect.Slice, reflect.Array: + var unmarshaled []json.RawMessage + + if err := json.Unmarshal(value, &unmarshaled); err != nil { + return err + } + + arrVal := reflect.MakeSlice(typ, len(unmarshaled), len(unmarshaled)) + + for index, value := range unmarshaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + arrVal.Index(index).Set(itemVal.Elem()) + } + + if v.Kind() == reflect.Pointer { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(arrVal) + return nil + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + t, err := time.Parse(time.RFC3339Nano, s) + if err != nil { + return fmt.Errorf("failed to parse string as time.Time: %w", err) + } + + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(t)) + return nil + case reflect.TypeOf(big.Int{}): + var b *big.Int + + format := tag.Get("bigint") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var ok bool + b, ok = new(big.Int).SetString(s, 10) + if !ok { + return fmt.Errorf("failed to parse string as big.Int") + } + } else { + if err := json.Unmarshal(value, &b); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + case reflect.TypeOf(decimal.Big{}): + var d *decimal.Big + format := tag.Get("decimal") + if format == "number" { + var ok bool + d, ok = new(decimal.Big).SetString(string(value)) + if !ok { + return fmt.Errorf("failed to parse number as decimal.Big") + } + } else { + if err := json.Unmarshal(value, &d); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + case reflect.TypeOf(types.Date{}): + var s string + + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + d, err := types.DateFromString(s) + if err != nil { + return fmt.Errorf("failed to parse string as types.Date: %w", err) + } + + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + } + } + + var val interface{} + + if v.CanAddr() { + val = v.Addr().Interface() + } else { + val = v.Interface() + } + + d := json.NewDecoder(bytes.NewReader(value)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(val) +} + +func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return typ, val + } + + return dereferencePointers(typ, val) +} + +func dereferenceTypePointer(typ reflect.Type) reflect.Type { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } else { + return typ + } + + return dereferenceTypePointer(typ) +} + +func isComplexValueType(typ reflect.Type) bool { + switch typ.Kind() { + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + fallthrough + case reflect.TypeOf(big.Int{}): + fallthrough + case reflect.TypeOf(decimal.Big{}): + fallthrough + case reflect.TypeOf(types.Date{}): + return true + } + } + + return false +} + +func isModelType(typ reflect.Type) bool { + if isComplexValueType(typ) { + return false + } + + if typ.Kind() == reflect.Struct { + return true + } + + return false +} diff --git a/tests/mockserver/internal/sdk/utils/reflect.go b/tests/mockserver/internal/sdk/utils/reflect.go new file mode 100644 index 00000000..255f3dd7 --- /dev/null +++ b/tests/mockserver/internal/sdk/utils/reflect.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package utils + +import ( + "reflect" +) + +func isNil(typ reflect.Type, val reflect.Value) bool { + // `reflect.TypeOf(nil) == nil` so calling typ.Kind() will cause a nil pointer + // dereference panic. Catch it and return early. + // https://github.com/golang/go/issues/51649 + // https://github.com/golang/go/issues/54208 + if typ == nil { + return true + } + + if typ.Kind() == reflect.Ptr || typ.Kind() == reflect.Map || typ.Kind() == reflect.Slice || typ.Kind() == reflect.Interface { + return val.IsNil() + } + + return false +} + +func isEmpty(typ reflect.Type, val reflect.Value) bool { + if typ == nil { + return true + } + + switch typ.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return val.Len() == 0 + } + + return false +} + +func trueReflectValue(val reflect.Value) reflect.Value { + kind := val.Type().Kind() + for kind == reflect.Interface || kind == reflect.Ptr { + innerVal := val.Elem() + if !innerVal.IsValid() { + break + } + val = innerVal + kind = val.Type().Kind() + } + return val +} diff --git a/tests/mockserver/internal/sdk/utils/sort.go b/tests/mockserver/internal/sdk/utils/sort.go new file mode 100644 index 00000000..6b265be7 --- /dev/null +++ b/tests/mockserver/internal/sdk/utils/sort.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package utils + +import ( + "regexp" + "sort" + "strings" +) + +// SortSerializedMaps will sort a given string, []string, or map[string]string +// such that all keys are ordered. This should only be used to simplify testing +// logic. +func SortSerializedMaps(input interface{}, regex string, delim string) interface{} { + sortString := func(input string) string { + r := regexp.MustCompile(regex) + + return replaceAllStringSubmatchFunc(r, input, func(matches []string) string { + result := matches[0] + + for i := 1; i < len(matches); i++ { + match := matches[i] + + pairs := []string{} + if strings.Contains(match, "=") { + pairs = strings.Split(match, delim) + + sort.SliceStable(pairs, func(i, j int) bool { + return strings.Split(pairs[i], "=")[0] < strings.Split(pairs[j], "=")[0] + }) + } else { + values := strings.Split(match, delim) + + if len(values) == 1 { + pairs = values + } else { + pairs = make([]string, len(values)/2) + for i := 0; i < len(values); i += 2 { + pairs[i/2] = values[i] + delim + values[i+1] + } + } + + sort.SliceStable(pairs, func(i, j int) bool { + return strings.Split(pairs[i], delim)[0] < strings.Split(pairs[j], delim)[0] + }) + } + + match = strings.Join(pairs, delim) + + result = strings.Replace(result, matches[i], match, 1) + } + + return result + }) + } + + switch input := input.(type) { + case string: + return sortString(input) + case []string: + for i, v := range input { + input[i] = sortString(v) + } + return input + case map[string]string: + for k, v := range input { + input[k] = sortString(v) + } + return input + default: + panic("unsupported type") + } +} + +func replaceAllStringSubmatchFunc(re *regexp.Regexp, str string, repl func([]string) string) string { + result := "" + lastIndex := 0 + + for _, v := range re.FindAllSubmatchIndex([]byte(str), -1) { + groups := []string{} + for i := 0; i < len(v); i += 2 { + if v[i] == -1 || v[i+1] == -1 { + groups = append(groups, "") + } else { + groups = append(groups, str[v[i]:v[i+1]]) + } + } + + result += str[lastIndex:v[0]] + repl(groups) + lastIndex = v[1] + } + + return result + str[lastIndex:] +} diff --git a/tests/mockserver/internal/server/doc.go b/tests/mockserver/internal/server/doc.go new file mode 100644 index 00000000..666dc109 --- /dev/null +++ b/tests/mockserver/internal/server/doc.go @@ -0,0 +1,4 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +// Package server implements the HTTP server. +package server diff --git a/tests/mockserver/internal/server/generated_handlers.go b/tests/mockserver/internal/server/generated_handlers.go new file mode 100644 index 00000000..1ea16355 --- /dev/null +++ b/tests/mockserver/internal/server/generated_handlers.go @@ -0,0 +1,17 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package server + +import ( + "context" + + "mockserver/internal/handler" +) + +func (s *Server) registerGeneratedHandlers(ctx context.Context) { + s.logger.Debug("registering generated handlers") + + for _, h := range handler.GeneratedHandlers(ctx, s.httpFileDir, s.requestTracker) { + s.RegisterHandlerFunc(ctx, []string{h.Method}, h.Path, h.HandlerFunc()) + } +} diff --git a/tests/mockserver/internal/server/internal_handlers.go b/tests/mockserver/internal/server/internal_handlers.go new file mode 100644 index 00000000..1c248615 --- /dev/null +++ b/tests/mockserver/internal/server/internal_handlers.go @@ -0,0 +1,343 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package server + +import ( + "bytes" + "context" + "fmt" + "html/template" + "io" + "net/http" + "path/filepath" + "strings" +) + +const ( + // Mock server internal route prefix to prevent naming collisions. + internalPathPrefix = "/_mockserver" +) + +// registerInternalHandlers adds any internal handlers, such as healthcheck +// endpoints and fallback handling. +func (s *Server) registerInternalHandlers(ctx context.Context) { + s.logger.Debug("registering internal handlers") + + // Healthcheck endpoint + s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/health", healthcheckHandler) + + // HTTP log index endpoint + s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/log", s.httpFileIndexHandler) + + // HTTP log operation endpoint + s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/log/{operationId}", s.httpOperationHandler) + + // Default all other requests to 404 Not Found + s.RegisterHandlerFunc(ctx, []string{}, "/", rootHandler) +} + +// healthcheckHandler returns a simple OK response. +func healthcheckHandler(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "text/plain; charset=utf-8") + w.WriteHeader(http.StatusOK) + fmt.Fprintln(w, "OK") +} + +// httpFileIndexHandler returns a HTML index page for all logged HTTP operations +// written to the HTTP file directory. +func (s *Server) httpFileIndexHandler(w http.ResponseWriter, _ *http.Request) { + operations, err := s.httpFileDir.Operations() + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation log error: %s", err), + http.StatusInternalServerError, + ) + + return + } + + type operationModel struct { + CallCount int64 + ID string + LogURL string + Method string + Path string + } + + type indexModel struct { + Operations []operationModel + } + + var index indexModel + + for _, operation := range operations { + index.Operations = append(index.Operations, operationModel{ + CallCount: operation.CallCount(), + ID: operation.Id(), + LogURL: internalPathPrefix + "/log/" + operation.Id(), + Method: operation.Method(), + Path: operation.Path(), + }) + } + + tmpl := template.New("index.html.tmpl") + tmpl.Funcs(template.FuncMap{ + "mod": func(i, j int) bool { return i%j == 0 }, + }) + _, err = tmpl.ParseFiles( + filepath.Join("internal", "server", "templates", "log", "style.css.tmpl"), + filepath.Join("internal", "server", "templates", "log", "index.html.tmpl"), + ) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation log template error: %s", err), + http.StatusInternalServerError, + ) + + return + } + + var wBuf bytes.Buffer + + err = tmpl.Execute(&wBuf, index) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation log template execution error: %s", err), + http.StatusInternalServerError, + ) + + return + } + + w.Header().Set("Content-Type", "text/html; charset=utf-8") + w.WriteHeader(http.StatusOK) + _, _ = wBuf.WriteTo(w) +} + +// httpOperationHandler returns a HTML page for HTTP request and response log files +// written to _debug. +func (s *Server) httpOperationHandler(w http.ResponseWriter, req *http.Request) { + operationId := req.PathValue("operationId") + + if operationId == "" { + http.Error(w, "operation logs not found", http.StatusNotFound) + + return + } + + operation, err := s.httpFileDir.Operation(operationId) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation %s log error: %s", operationId, err), + http.StatusInternalServerError, + ) + + return + } + + type headerModel struct { + Key string + Values template.HTML + } + + type queryParameterModel struct { + Key string + Values template.HTML + } + + type operationCallModel struct { + Call int64 + ID string + LogOperationURL string + + RawRequest template.HTML + RawResponse template.HTML + + RequestBody string + RequestHeaders []headerModel + RequestQueryParameters []queryParameterModel + + ResponseBody string + ResponseHeaders []headerModel + ResponseStatus string + } + + type operationDataModel struct { + Calls []operationCallModel + ID string + LogIndexURL string + RequestMethod string + RequestPath string + } + + operationData := operationDataModel{ + ID: operationId, + LogIndexURL: internalPathPrefix + "/log", + RequestMethod: operation.Method(), + RequestPath: operation.Path(), + } + + for i := range operation.CallCount() { + call := i + 1 + + callReqRaw, err := operation.RawRequest(call) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation %s call %d log raw request error: %s", operationId, call, err), + http.StatusInternalServerError, + ) + + return + } + + callReq, err := operation.Request(call) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation %s call %d log request error: %s", operationId, call, err), + http.StatusInternalServerError, + ) + + return + } + + callReqBody, err := io.ReadAll(callReq.Body) + defer callReq.Body.Close() + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation %s call %d log request body error: %s", operationId, call, err), + http.StatusInternalServerError, + ) + + return + } + + callRespRaw, err := operation.RawResponse(call) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation %s call %d log response error: %s", operationId, call, err), + http.StatusInternalServerError, + ) + + return + } + + callResp, err := operation.Response(call) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation %s call %d log response error: %s", operationId, call, err), + http.StatusInternalServerError, + ) + + return + } + + callRespBody, err := io.ReadAll(callResp.Body) + defer callReq.Body.Close() + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation %s call %d log response body error: %s", operationId, call, err), + http.StatusInternalServerError, + ) + + return + } + + operationCall := operationCallModel{ + Call: call, + LogOperationURL: internalPathPrefix + "/log/" + operationId, + + RawRequest: template.HTML(strings.ReplaceAll(string(callReqRaw), "\r\n", "
")), + RawResponse: template.HTML(strings.ReplaceAll(string(callRespRaw), "\r\n", "
")), + + RequestBody: string(callReqBody), + ResponseBody: string(callRespBody), + ResponseStatus: callResp.Status, + } + + for key, values := range callReq.URL.Query() { + operationCall.RequestQueryParameters = append(operationCall.RequestQueryParameters, queryParameterModel{ + Key: key, + Values: template.HTML(strings.Join(values, "
")), + }) + } + + for key, values := range callReq.Header { + operationCall.RequestHeaders = append(operationCall.RequestHeaders, headerModel{ + Key: key, + Values: template.HTML(strings.Join(values, "
")), + }) + } + + for key, values := range callResp.Header { + operationCall.ResponseHeaders = append(operationCall.ResponseHeaders, headerModel{ + Key: key, + Values: template.HTML(strings.Join(values, "
")), + }) + } + + operationData.Calls = append(operationData.Calls, operationCall) + } + + tmpl := template.New("operation.html.tmpl") + tmpl.Funcs(template.FuncMap{ + "mod": func(i, j int) bool { return i%j == 0 }, + }) + _, err = tmpl.ParseFiles( + filepath.Join("internal", "server", "templates", "log", "style.css.tmpl"), + filepath.Join("internal", "server", "templates", "log", "operation.html.tmpl"), + ) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation log template error: %s", err), + http.StatusInternalServerError, + ) + + return + } + + var wBuf bytes.Buffer + + err = tmpl.Execute(&wBuf, operationData) + + if err != nil { + http.Error( + w, + fmt.Sprintf("operation log template execution error: %s", err), + http.StatusInternalServerError, + ) + + return + } + + w.Header().Set("Content-Type", "text/html; charset=utf-8") + w.WriteHeader(http.StatusOK) + _, _ = wBuf.WriteTo(w) +} + +// rootHandler returns a slightly customized [http.NotFoundHandler], saying +// "path" instead of "page". +func rootHandler(w http.ResponseWriter, _ *http.Request) { + http.Error(w, "path not found", http.StatusNotFound) +} diff --git a/tests/mockserver/internal/server/server.go b/tests/mockserver/internal/server/server.go new file mode 100644 index 00000000..12239611 --- /dev/null +++ b/tests/mockserver/internal/server/server.go @@ -0,0 +1,134 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package server + +import ( + "context" + "errors" + "fmt" + "log/slog" + "mockserver/internal/logging" + "mockserver/internal/tracking" + "net/http" + "strings" + "time" + + "github.com/gorilla/mux" +) + +const ( + // Default address for server listening. + DefaultAddress = ":18080" +) + +// Server implements the HTTP server. +type Server struct { + // Address for server listening. + address string + + // Directory for raw HTTP request and response files. + httpFileDir *logging.HTTPFileDirectory + + // Logger implementation. + logger *slog.Logger + + // Underlying mux implementation. + // Based on gorilla mux as the native mux suffered from issues with ambiguous paths and different http methods + // eg - panic: pattern "HEAD /v8/artifacts/{hash}" (registered at /usr/src/app/internal/server/server.go:104) conflicts with pattern "GET /v8/artifacts/status" (registered at /usr/src/app/internal/server/server.go:104): HEAD /v8/artifacts/{hash} matches fewer methods than GET /v8/artifacts/status, but has a more general path pattern + mux *mux.Router + + // Underlying server implementation. + server *http.Server + + requestTracker *tracking.RequestTracker +} + +// NewServer creates a new Server instance. +func NewServer(ctx context.Context, opts ...ServerOption) (*Server, error) { + // Initialize with defaults. + result := &Server{ + address: DefaultAddress, + logger: slog.Default(), + mux: mux.NewRouter(), + requestTracker: tracking.New(), + } + + // Customize based on ServerOption. + for _, opt := range opts { + err := opt(result) + + if err != nil { + return result, err + } + } + + result.server = &http.Server{ + Addr: result.address, + Handler: logging.HTTPLoggerHandler(result.logger, result.mux), + ErrorLog: slog.NewLogLogger(result.logger.Handler(), slog.LevelError), + } + + httpFileDir, err := logging.NewHTTPFileDirectory("") + + if err != nil { + return result, err + } + + err = httpFileDir.Clean() + + if err != nil { + return result, err + } + + result.httpFileDir = httpFileDir + + result.registerGeneratedHandlers(ctx) + result.registerInternalHandlers(ctx) + + return result, err +} + +// Address returns the server address including protocol, hostname, and port. +func (s *Server) Address() string { + return "http://localhost" + s.address +} + +// RegisterHandlerFunc adds a new HTTP handler function for the given methods and path. +func (s *Server) RegisterHandlerFunc(ctx context.Context, methods []string, path string, handlerFunc http.HandlerFunc) { + s.logger.DebugContext(ctx, fmt.Sprintf("registering handler for %s %s", strings.Join(methods, ", "), path)) + + r := s.mux.HandleFunc(path, handlerFunc) + if len(methods) > 0 { + r.Methods(methods...) + } +} + +// Serve starts the server. +func (s *Server) Serve(ctx context.Context) error { + s.logger.InfoContext(ctx, "starting server with address "+s.server.Addr) + + err := s.server.ListenAndServe() + + if errors.Is(err, http.ErrServerClosed) { + return nil + } + + return fmt.Errorf("error running server: %w", err) +} + +// Shutdown gracefully stops the server. +func (s *Server) Shutdown(ctx context.Context) error { + s.logger.WarnContext(ctx, "shutting down server") + s.server.SetKeepAlivesEnabled(false) + + ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + defer cancel() + + err := s.server.Shutdown(ctx) + + if err != nil { + return fmt.Errorf("error shutting down server: %w", err) + } + + return nil +} diff --git a/tests/mockserver/internal/server/server_option.go b/tests/mockserver/internal/server/server_option.go new file mode 100644 index 00000000..ff85a678 --- /dev/null +++ b/tests/mockserver/internal/server/server_option.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package server + +import ( + "log/slog" +) + +// ServerOption is a function which modifies the Server. +type ServerOption func(*Server) error + +// WithAddress sets the listening address for a Server. By default, the server +// address is :18080. +func WithAddress(address string) ServerOption { + return func(s *Server) error { + s.address = address + + return nil + } +} + +// WithLogger sets the logger implementation for a Server. By default, the +// server logger is [slog.Default]. +func WithLogger(logger *slog.Logger) ServerOption { + return func(s *Server) error { + s.logger = logger + + return nil + } +} diff --git a/tests/mockserver/internal/server/templates/log/index.html.tmpl b/tests/mockserver/internal/server/templates/log/index.html.tmpl new file mode 100644 index 00000000..8b1124e5 --- /dev/null +++ b/tests/mockserver/internal/server/templates/log/index.html.tmpl @@ -0,0 +1,22 @@ + + + Operation Logs + + + +

// Speakeasy

+

Operation Logs

+ + + {{ range $idx, $o := .Operations }} + + + + + + {{ end }} +
OperationRequestCalls
{{ .ID }}{{ .Method }} {{ .Path }}{{ .CallCount }}
+ + diff --git a/tests/mockserver/internal/server/templates/log/operation.html.tmpl b/tests/mockserver/internal/server/templates/log/operation.html.tmpl new file mode 100644 index 00000000..a54a2adc --- /dev/null +++ b/tests/mockserver/internal/server/templates/log/operation.html.tmpl @@ -0,0 +1,93 @@ + + + Operation Logs: {{ .ID }} + + + +

// Speakeasy

+

Operation Logs: {{ .ID }}

+

{{ .RequestMethod }} {{ .RequestPath }}

+

Back to All Operation Logs

+
+ {{ range $idx, $c := .Calls }} +
+ {{ if (ne (len $.Calls) 1) }} +

Call {{ .Call }}

+ {{ end }} +
+

Request

+ + {{ if (gt (len .RequestQueryParameters) 0) }} +
+

Query Parameters

+ + + {{ range $idx, $p := .RequestQueryParameters }} + + + + + {{ end }} +
KeyValue
{{ .Key }}{{ .Values }}
+
+ {{ end }} +
+

Headers

+ + + {{ range $idx, $h := .RequestHeaders }} + + + + + {{ end }} +
KeyValue(s)
{{ .Key }}{{ .Values }}
+
+ {{ if (gt (len .RequestBody) 0) }} +
+

Body

+

{{ .RequestBody }}

+
+ {{ end }} +

+

+ Raw Request +
{{ .RawRequest }}
+
+

+
+
+

Response

+

{{ .ResponseStatus }}

+
+

Headers

+ + + {{ range $idx, $h := .ResponseHeaders }} + + + + + {{ end }} +
KeyValue(s)
{{ .Key }}{{ .Values }}
+
+ {{ if (gt (len .ResponseBody) 0) }} +
+

Body

+

{{ .ResponseBody }}

+
+ {{ end }} +

+

+ Raw Response +
{{ .RawResponse }}
+
+

+
+
+ {{ end }} +
+ + diff --git a/tests/mockserver/internal/server/templates/log/style.css.tmpl b/tests/mockserver/internal/server/templates/log/style.css.tmpl new file mode 100644 index 00000000..5490930e --- /dev/null +++ b/tests/mockserver/internal/server/templates/log/style.css.tmpl @@ -0,0 +1,64 @@ +{{ define "style" }} +a { + color: rgba(251, 227, 50, 1.0); +} +body { + background: black; + font-family: Arial, Helvetica, sans-serif; +} +code { + color: white; +} +details > div { + border-left: 1px solid gray; + margin-left: 10px; + padding: 10px; +} +div { + width: fit-content; +} +div.operation-call.odd { + background-color: rgba(251, 227, 50, 0.1); +} +h1 { + color: hsl(53, 96%, 59%); +} +h2 { + color: rgba(255, 255, 255, 1.0); +} +h3 { + color: rgba(255, 255, 255, 0.75); +} +h4 { + color: rgba(255, 255, 255, 0.50); +} +p { + color: white; + padding-left: 10px; +} +summary { + color: gray; + font-weight: bold; + margin-bottom: 5px; +} +table { + border-collapse: collapse; + margin: 5px; +} +th { + border-bottom: 1px solid gray; + color: white; + padding: 10px; + text-align: left; +} +td { + color: white; + padding: 10px; +} +tr.even { + background-color: rgba(255, 255, 255, 0.0); +} +tr.odd { + background-color: rgba(255, 255, 255, 0.1); +} +{{ end }} diff --git a/tests/mockserver/internal/tracking/requesttracker.go b/tests/mockserver/internal/tracking/requesttracker.go new file mode 100644 index 00000000..1d9131d0 --- /dev/null +++ b/tests/mockserver/internal/tracking/requesttracker.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package tracking + +import ( + "fmt" + "time" + + cache "github.com/go-pkgz/expirable-cache/v3" +) + +type RequestTracker struct { + cache cache.Cache[string, *testEntry] +} + +type testEntry struct { + name string + id string + count int + created time.Time +} + +func New() *RequestTracker { + return &RequestTracker{ + cache: cache.NewCache[string, *testEntry]().WithTTL(5 * time.Minute), + } +} + +func (t *RequestTracker) GetRequestCount(testName, instanceID string) int { + key := fmt.Sprintf("%s-%s", testName, instanceID) + + entry, ok := t.cache.Get(key) + if !ok { + entry = &testEntry{ + name: testName, + id: instanceID, + count: 0, + created: time.Now(), + } + } + + count := entry.count + entry.count++ + t.cache.Set(key, entry, 0) + + return count +} diff --git a/tests/mockserver/main.go b/tests/mockserver/main.go new file mode 100644 index 00000000..2270443b --- /dev/null +++ b/tests/mockserver/main.go @@ -0,0 +1,74 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package main + +import ( + "context" + "flag" + "fmt" + "os" + "os/signal" + "strings" + + "mockserver/internal/logging" + "mockserver/internal/server" +) + +func main() { + ctx := context.Background() + + address := flag.String("address", server.DefaultAddress, fmt.Sprintf("server listen address (default: %s)", server.DefaultAddress)) + logFormat := flag.String("log-format", logging.DefaultFormat, fmt.Sprintf("logging format (default: %s, supported: %s)", logging.DefaultFormat, strings.Join(logging.Formats(), ", "))) + logLevel := flag.String("log-level", logging.DefaultLevel, fmt.Sprintf("logging level (default: %s, supported: %s)", logging.DefaultLevel, strings.Join(logging.Levels(), ", "))) + + flag.Parse() + + logger, err := logging.NewLogger(os.Stdout, *logFormat, *logLevel) + + if err != nil { + fmt.Fprintf(os.Stderr, "error setting up logging: %s", err) + os.Exit(1) + } + + serverOpts := []server.ServerOption{ + server.WithAddress(*address), + server.WithLogger(logger), + } + + s, err := server.NewServer(ctx, serverOpts...) + + if err != nil { + logger.ErrorContext(ctx, err.Error()) + os.Exit(1) + } + + finishedShutdown := make(chan struct{}) + startShutdown := make(chan os.Signal, 1) + signal.Notify(startShutdown, os.Interrupt) + + go func() { + <-startShutdown + + logger.WarnContext(ctx, "server received interrupt") + + err := s.Shutdown(ctx) + + if err != nil { + logger.Error(err.Error()) + os.Exit(1) + } + + close(finishedShutdown) + }() + + err = s.Serve(ctx) + + if err != nil { + logger.ErrorContext(ctx, err.Error()) + os.Exit(1) + } + + <-finishedShutdown + + logger.InfoContext(ctx, "server stopped") +} diff --git a/tests/mockserver/testdata/example.file b/tests/mockserver/testdata/example.file new file mode 100644 index 00000000..3b18e512 --- /dev/null +++ b/tests/mockserver/testdata/example.file @@ -0,0 +1 @@ +hello world From 50a4a6f230c03d8331b5a48a59837a346b461a56 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 23:22:42 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow