mencoro 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +304 -0
- data/Rakefile +10 -0
- data/docs/AcceptedJobResource.md +22 -0
- data/docs/AccountApi.md +141 -0
- data/docs/AiResponseReportResource.md +28 -0
- data/docs/AiResponseResource.md +36 -0
- data/docs/AnalyticsApi.md +1320 -0
- data/docs/ApplyClusteringJobOutcome.md +26 -0
- data/docs/ApplyClusteringJobOutcomeClustersInner.md +22 -0
- data/docs/ApplyClusteringJobOutcomeFailedInner.md +22 -0
- data/docs/ApplyClusteringJobOutcomeSkippedClustersInner.md +20 -0
- data/docs/ApplyClusteringJobOutcomeSuccessfulInner.md +20 -0
- data/docs/AsyncJobResource.md +24 -0
- data/docs/BatchChangeTrackedQueryCheckFrequencyRequestData.md +20 -0
- data/docs/BatchChangeTrackedQueryPassesRequestData.md +20 -0
- data/docs/BatchCreateQueryClustersOutcome.md +20 -0
- data/docs/BatchCreateQueryClustersOutcomeFailedInner.md +22 -0
- data/docs/BatchCreateQueryClustersOutcomeSuccessfulInner.md +20 -0
- data/docs/BatchCreateQueryClustersRequestData.md +18 -0
- data/docs/BatchCreateTrackedQueriesRequestData.md +30 -0
- data/docs/BatchCreateTrackedQueriesResultResource.md +20 -0
- data/docs/BatchCreateTrackedQueriesResultResourceFailedInner.md +26 -0
- data/docs/BatchCreateTrackedQueriesResultResourceSuccessfulInner.md +24 -0
- data/docs/BatchForceCheckTrackedQueries200Response.md +20 -0
- data/docs/BatchForceCheckTrackedQueries200ResponseFailedInner.md +22 -0
- data/docs/BatchPauseTrackedQueries200Response.md +20 -0
- data/docs/BatchPauseTrackedQueries200ResponseFailedInner.md +22 -0
- data/docs/BatchPauseTrackedQueries200ResponseSuccessfulInner.md +18 -0
- data/docs/BatchResumeTrackedQueries200Response.md +20 -0
- data/docs/BatchTargetsRequestData.md +18 -0
- data/docs/BatchWriteOutcome.md +20 -0
- data/docs/BatchWriteOutcomeFailedInner.md +22 -0
- data/docs/BillingApi.md +77 -0
- data/docs/BrandProfileResource.md +24 -0
- data/docs/BulkAddClustersToTrackedQueries200Response.md +20 -0
- data/docs/BulkAddClustersToTrackedQueriesRequest.md +20 -0
- data/docs/BulkRemoveClustersFromTrackedQueries200Response.md +20 -0
- data/docs/BulkRemoveClustersFromTrackedQueriesRequest.md +20 -0
- data/docs/CapturesApi.md +267 -0
- data/docs/ChangeMemberRoleRequest.md +18 -0
- data/docs/ChangeTrackedQueryCheckFrequencyRequestData.md +18 -0
- data/docs/ChangeTrackedQueryPassesRequestData.md +18 -0
- data/docs/CitationResource.md +36 -0
- data/docs/ClusterMembershipRequestData.md +18 -0
- data/docs/ClustersApi.md +465 -0
- data/docs/CompetitorResource.md +24 -0
- data/docs/CreateCompetitorRequest.md +22 -0
- data/docs/CreateInvitation200Response.md +22 -0
- data/docs/CreateInvitation201Response.md +32 -0
- data/docs/CreateInvitationRequest.md +20 -0
- data/docs/CreateOrganization201Response.md +22 -0
- data/docs/CreateOrganizationRequest.md +18 -0
- data/docs/CreateProjectRequest.md +24 -0
- data/docs/CreateProjectRequestCompetitorsInner.md +22 -0
- data/docs/CreateQueryCluster409Response.md +22 -0
- data/docs/CreateQueryClusterRequest.md +18 -0
- data/docs/DeleteQueryCluster200Response.md +22 -0
- data/docs/DiscoveryApi.md +311 -0
- data/docs/EntitlementsResource.md +38 -0
- data/docs/GetAvailableFilters200Response.md +22 -0
- data/docs/GetAvailableFilters200ResponseClustersInner.md +20 -0
- data/docs/GetMeStats200Response.md +20 -0
- data/docs/GetMeStats200ResponseOrganizations.md +18 -0
- data/docs/GetMeStats200ResponseProjects.md +20 -0
- data/docs/GetMembershipStats200Response.md +30 -0
- data/docs/GetMentionSamples400Response.md +24 -0
- data/docs/GetMentionSamples400ResponseDetailsValueInner.md +22 -0
- data/docs/GetMetricGlossary200Response.md +18 -0
- data/docs/GetMetricGlossary200ResponseMetricsInner.md +30 -0
- data/docs/GetOrganizationOverview200Response.md +20 -0
- data/docs/GetOrganizationOverview200ResponseAggregate.md +30 -0
- data/docs/GetOrganizationOverview200ResponseProjectsInner.md +32 -0
- data/docs/GetOrganizationStats200Response.md +22 -0
- data/docs/GetOrganizationStats200ResponseInvitations.md +18 -0
- data/docs/GetOrganizationStats200ResponseMembers.md +18 -0
- data/docs/GetOrganizationStats200ResponseProjects.md +20 -0
- data/docs/GetShareOfVoiceFormula200Response.md +24 -0
- data/docs/GetTrackingCoverage200Response.md +30 -0
- data/docs/GetTrackingCoverage200ResponseSampleInner.md +28 -0
- data/docs/InvitationResource.md +30 -0
- data/docs/InvitationsApi.md +243 -0
- data/docs/JobsApi.md +79 -0
- data/docs/KeywordListingResource.md +88 -0
- data/docs/KeywordListingResourceMentionTypeCounts.md +26 -0
- data/docs/ListAiResponses200Response.md +20 -0
- data/docs/ListCompetitors200Response.md +20 -0
- data/docs/ListInvitations200Response.md +20 -0
- data/docs/ListKeywordListings200Response.md +24 -0
- data/docs/ListMembers200Response.md +20 -0
- data/docs/ListOrganizations200Response.md +20 -0
- data/docs/ListProjects200Response.md +20 -0
- data/docs/ListQueryClusters200Response.md +20 -0
- data/docs/ListSearchSnapshots200Response.md +20 -0
- data/docs/ListShoppingSnapshots200Response.md +20 -0
- data/docs/MeResource.md +34 -0
- data/docs/MemberResource.md +28 -0
- data/docs/MembersApi.md +391 -0
- data/docs/OperationEffect.md +22 -0
- data/docs/OrganizationOperationsApi.md +77 -0
- data/docs/OrganizationResource.md +32 -0
- data/docs/OrganizationsApi.md +807 -0
- data/docs/PreviewOrganizationOperation200Response.md +34 -0
- data/docs/PreviewOrganizationOperation200ResponseOrganization.md +20 -0
- data/docs/PreviewOrganizationOperationRequest.md +24 -0
- data/docs/ProjectDetailResource.md +32 -0
- data/docs/ProjectDetailResourceCompetitorsInner.md +24 -0
- data/docs/ProjectResource.md +50 -0
- data/docs/ProjectedMonthlyChecksResource.md +20 -0
- data/docs/ProjectsApi.md +999 -0
- data/docs/QueryClusterResource.md +22 -0
- data/docs/ReportAiResponseRequest.md +22 -0
- data/docs/SearchResultResource.md +32 -0
- data/docs/SearchSnapshotResource.md +28 -0
- data/docs/SearchTrackedQueries200Response.md +20 -0
- data/docs/ShoppingOfferResource.md +38 -0
- data/docs/ShoppingSnapshotResource.md +28 -0
- data/docs/StartBrandDiscoveryJobRequest.md +20 -0
- data/docs/StartBrandNameSuggestionJobRequest.md +24 -0
- data/docs/StartClusteringJobRequestData.md +22 -0
- data/docs/StartKeywordDiscoveryJobRequest.md +24 -0
- data/docs/StartPromptDiscoveryJobRequest.md +24 -0
- data/docs/SubmittedChecksResource.md +20 -0
- data/docs/SubscriptionResource.md +42 -0
- data/docs/TrackedQueriesApi.md +1549 -0
- data/docs/TrackedQueryCountResource.md +20 -0
- data/docs/TrackedQueryDetailResource.md +38 -0
- data/docs/TrackedQueryResource.md +52 -0
- data/docs/TrackedQueryUsageResource.md +18 -0
- data/docs/UpdateOrganizationRequest.md +22 -0
- data/docs/UpdateProjectBrandProfileRequest.md +20 -0
- data/docs/UpdateProjectRequest.md +18 -0
- data/git_push.sh +57 -0
- data/lib/mencoro/api/account_api.rb +136 -0
- data/lib/mencoro/api/analytics_api.rb +1555 -0
- data/lib/mencoro/api/billing_api.rb +85 -0
- data/lib/mencoro/api/captures_api.rb +338 -0
- data/lib/mencoro/api/clusters_api.rb +548 -0
- data/lib/mencoro/api/discovery_api.rb +360 -0
- data/lib/mencoro/api/invitations_api.rb +302 -0
- data/lib/mencoro/api/jobs_api.rb +91 -0
- data/lib/mencoro/api/members_api.rb +453 -0
- data/lib/mencoro/api/organization_operations_api.rb +90 -0
- data/lib/mencoro/api/organizations_api.rb +835 -0
- data/lib/mencoro/api/projects_api.rb +1158 -0
- data/lib/mencoro/api/tracked_queries_api.rb +1792 -0
- data/lib/mencoro/api_client.rb +441 -0
- data/lib/mencoro/api_error.rb +58 -0
- data/lib/mencoro/api_model_base.rb +88 -0
- data/lib/mencoro/configuration.rb +392 -0
- data/lib/mencoro/models/accepted_job_resource.rb +220 -0
- data/lib/mencoro/models/ai_response_report_resource.rb +311 -0
- data/lib/mencoro/models/ai_response_resource.rb +412 -0
- data/lib/mencoro/models/apply_clustering_job_outcome.rb +199 -0
- data/lib/mencoro/models/apply_clustering_job_outcome_clusters_inner.rb +165 -0
- data/lib/mencoro/models/apply_clustering_job_outcome_failed_inner.rb +165 -0
- data/lib/mencoro/models/apply_clustering_job_outcome_skipped_clusters_inner.rb +156 -0
- data/lib/mencoro/models/apply_clustering_job_outcome_successful_inner.rb +158 -0
- data/lib/mencoro/models/async_job_resource.rb +256 -0
- data/lib/mencoro/models/batch_change_tracked_query_check_frequency_request_data.rb +237 -0
- data/lib/mencoro/models/batch_change_tracked_query_passes_request_data.rb +231 -0
- data/lib/mencoro/models/batch_create_query_clusters_outcome.rb +163 -0
- data/lib/mencoro/models/batch_create_query_clusters_outcome_failed_inner.rb +165 -0
- data/lib/mencoro/models/batch_create_query_clusters_outcome_successful_inner.rb +156 -0
- data/lib/mencoro/models/batch_create_query_clusters_request_data.rb +186 -0
- data/lib/mencoro/models/batch_create_tracked_queries_request_data.rb +399 -0
- data/lib/mencoro/models/batch_create_tracked_queries_result_resource.rb +163 -0
- data/lib/mencoro/models/batch_create_tracked_queries_result_resource_failed_inner.rb +183 -0
- data/lib/mencoro/models/batch_create_tracked_queries_result_resource_successful_inner.rb +174 -0
- data/lib/mencoro/models/batch_force_check_tracked_queries200_response.rb +162 -0
- data/lib/mencoro/models/batch_force_check_tracked_queries200_response_failed_inner.rb +165 -0
- data/lib/mencoro/models/batch_pause_tracked_queries200_response.rb +162 -0
- data/lib/mencoro/models/batch_pause_tracked_queries200_response_failed_inner.rb +165 -0
- data/lib/mencoro/models/batch_pause_tracked_queries200_response_successful_inner.rb +147 -0
- data/lib/mencoro/models/batch_resume_tracked_queries200_response.rb +162 -0
- data/lib/mencoro/models/batch_targets_request_data.rb +186 -0
- data/lib/mencoro/models/batch_write_outcome.rb +163 -0
- data/lib/mencoro/models/batch_write_outcome_failed_inner.rb +166 -0
- data/lib/mencoro/models/brand_profile_resource.rb +235 -0
- data/lib/mencoro/models/bulk_add_clusters_to_tracked_queries200_response.rb +162 -0
- data/lib/mencoro/models/bulk_add_clusters_to_tracked_queries_request.rb +218 -0
- data/lib/mencoro/models/bulk_remove_clusters_from_tracked_queries200_response.rb +162 -0
- data/lib/mencoro/models/bulk_remove_clusters_from_tracked_queries_request.rb +218 -0
- data/lib/mencoro/models/change_member_role_request.rb +181 -0
- data/lib/mencoro/models/change_tracked_query_check_frequency_request_data.rb +190 -0
- data/lib/mencoro/models/change_tracked_query_passes_request_data.rb +184 -0
- data/lib/mencoro/models/citation_resource.rb +306 -0
- data/lib/mencoro/models/cluster_membership_request_data.rb +186 -0
- data/lib/mencoro/models/competitor_resource.rb +250 -0
- data/lib/mencoro/models/create_competitor_request.rb +247 -0
- data/lib/mencoro/models/create_invitation200_response.rb +202 -0
- data/lib/mencoro/models/create_invitation201_response.rb +347 -0
- data/lib/mencoro/models/create_invitation_request.rb +192 -0
- data/lib/mencoro/models/create_organization201_response.rb +166 -0
- data/lib/mencoro/models/create_organization_request.rb +175 -0
- data/lib/mencoro/models/create_project_request.rb +307 -0
- data/lib/mencoro/models/create_project_request_competitors_inner.rb +256 -0
- data/lib/mencoro/models/create_query_cluster409_response.rb +165 -0
- data/lib/mencoro/models/create_query_cluster_request.rb +167 -0
- data/lib/mencoro/models/delete_query_cluster200_response.rb +168 -0
- data/lib/mencoro/models/entitlements_resource.rb +328 -0
- data/lib/mencoro/models/get_available_filters200_response.rb +173 -0
- data/lib/mencoro/models/get_available_filters200_response_clusters_inner.rb +157 -0
- data/lib/mencoro/models/get_me_stats200_response.rb +156 -0
- data/lib/mencoro/models/get_me_stats200_response_organizations.rb +167 -0
- data/lib/mencoro/models/get_me_stats200_response_projects.rb +196 -0
- data/lib/mencoro/models/get_membership_stats200_response.rb +322 -0
- data/lib/mencoro/models/get_mention_samples400_response.rb +231 -0
- data/lib/mencoro/models/get_mention_samples400_response_details_value_inner.rb +168 -0
- data/lib/mencoro/models/get_metric_glossary200_response.rb +149 -0
- data/lib/mencoro/models/get_metric_glossary200_response_metrics_inner.rb +240 -0
- data/lib/mencoro/models/get_organization_overview200_response.rb +158 -0
- data/lib/mencoro/models/get_organization_overview200_response_aggregate.rb +209 -0
- data/lib/mencoro/models/get_organization_overview200_response_projects_inner.rb +218 -0
- data/lib/mencoro/models/get_organization_stats200_response.rb +165 -0
- data/lib/mencoro/models/get_organization_stats200_response_invitations.rb +167 -0
- data/lib/mencoro/models/get_organization_stats200_response_members.rb +167 -0
- data/lib/mencoro/models/get_organization_stats200_response_projects.rb +196 -0
- data/lib/mencoro/models/get_share_of_voice_formula200_response.rb +182 -0
- data/lib/mencoro/models/get_tracking_coverage200_response.rb +209 -0
- data/lib/mencoro/models/get_tracking_coverage200_response_sample_inner.rb +229 -0
- data/lib/mencoro/models/invitation_resource.rb +331 -0
- data/lib/mencoro/models/keyword_listing_resource.rb +798 -0
- data/lib/mencoro/models/keyword_listing_resource_mention_type_counts.rb +184 -0
- data/lib/mencoro/models/list_ai_responses200_response.rb +159 -0
- data/lib/mencoro/models/list_competitors200_response.rb +159 -0
- data/lib/mencoro/models/list_invitations200_response.rb +158 -0
- data/lib/mencoro/models/list_keyword_listings200_response.rb +180 -0
- data/lib/mencoro/models/list_members200_response.rb +158 -0
- data/lib/mencoro/models/list_organizations200_response.rb +158 -0
- data/lib/mencoro/models/list_projects200_response.rb +159 -0
- data/lib/mencoro/models/list_query_clusters200_response.rb +159 -0
- data/lib/mencoro/models/list_search_snapshots200_response.rb +159 -0
- data/lib/mencoro/models/list_shopping_snapshots200_response.rb +159 -0
- data/lib/mencoro/models/me_resource.rb +394 -0
- data/lib/mencoro/models/member_resource.rb +322 -0
- data/lib/mencoro/models/operation_effect.rb +204 -0
- data/lib/mencoro/models/organization_resource.rb +326 -0
- data/lib/mencoro/models/preview_organization_operation200_response.rb +236 -0
- data/lib/mencoro/models/preview_organization_operation200_response_organization.rb +158 -0
- data/lib/mencoro/models/preview_organization_operation_request.rb +213 -0
- data/lib/mencoro/models/project_detail_resource.rb +380 -0
- data/lib/mencoro/models/project_detail_resource_competitors_inner.rb +178 -0
- data/lib/mencoro/models/project_resource.rb +422 -0
- data/lib/mencoro/models/projected_monthly_checks_resource.rb +211 -0
- data/lib/mencoro/models/query_cluster_resource.rb +229 -0
- data/lib/mencoro/models/report_ai_response_request.rb +227 -0
- data/lib/mencoro/models/search_result_resource.rb +284 -0
- data/lib/mencoro/models/search_snapshot_resource.rb +302 -0
- data/lib/mencoro/models/search_tracked_queries200_response.rb +158 -0
- data/lib/mencoro/models/shopping_offer_resource.rb +381 -0
- data/lib/mencoro/models/shopping_snapshot_resource.rb +302 -0
- data/lib/mencoro/models/start_brand_discovery_job_request.rb +185 -0
- data/lib/mencoro/models/start_brand_name_suggestion_job_request.rb +287 -0
- data/lib/mencoro/models/start_clustering_job_request_data.rb +249 -0
- data/lib/mencoro/models/start_keyword_discovery_job_request.rb +266 -0
- data/lib/mencoro/models/start_prompt_discovery_job_request.rb +276 -0
- data/lib/mencoro/models/submitted_checks_resource.rb +195 -0
- data/lib/mencoro/models/subscription_resource.rb +362 -0
- data/lib/mencoro/models/tracked_query_count_resource.rb +193 -0
- data/lib/mencoro/models/tracked_query_detail_resource.rb +440 -0
- data/lib/mencoro/models/tracked_query_resource.rb +492 -0
- data/lib/mencoro/models/tracked_query_usage_resource.rb +175 -0
- data/lib/mencoro/models/update_organization_request.rb +195 -0
- data/lib/mencoro/models/update_project_brand_profile_request.rb +218 -0
- data/lib/mencoro/models/update_project_request.rb +182 -0
- data/lib/mencoro/version.rb +15 -0
- data/lib/mencoro.rb +169 -0
- data/mencoro.gemspec +41 -0
- data/spec/api/account_api_spec.rb +57 -0
- data/spec/api/analytics_api_spec.rb +318 -0
- data/spec/api/billing_api_spec.rb +47 -0
- data/spec/api/captures_api_spec.rb +93 -0
- data/spec/api/clusters_api_spec.rb +126 -0
- data/spec/api/discovery_api_spec.rb +94 -0
- data/spec/api/invitations_api_spec.rb +83 -0
- data/spec/api/jobs_api_spec.rb +48 -0
- data/spec/api/members_api_spec.rb +111 -0
- data/spec/api/organization_operations_api_spec.rb +47 -0
- data/spec/api/organizations_api_spec.rb +181 -0
- data/spec/api/projects_api_spec.rb +229 -0
- data/spec/api/tracked_queries_api_spec.rb +344 -0
- data/spec/models/accepted_job_resource_spec.rb +48 -0
- data/spec/models/ai_response_report_resource_spec.rb +70 -0
- data/spec/models/ai_response_resource_spec.rb +90 -0
- data/spec/models/apply_clustering_job_outcome_clusters_inner_spec.rb +48 -0
- data/spec/models/apply_clustering_job_outcome_failed_inner_spec.rb +48 -0
- data/spec/models/apply_clustering_job_outcome_skipped_clusters_inner_spec.rb +42 -0
- data/spec/models/apply_clustering_job_outcome_spec.rb +60 -0
- data/spec/models/apply_clustering_job_outcome_successful_inner_spec.rb +42 -0
- data/spec/models/async_job_resource_spec.rb +62 -0
- data/spec/models/batch_change_tracked_query_check_frequency_request_data_spec.rb +46 -0
- data/spec/models/batch_change_tracked_query_passes_request_data_spec.rb +42 -0
- data/spec/models/batch_create_query_clusters_outcome_failed_inner_spec.rb +48 -0
- data/spec/models/batch_create_query_clusters_outcome_spec.rb +42 -0
- data/spec/models/batch_create_query_clusters_outcome_successful_inner_spec.rb +42 -0
- data/spec/models/batch_create_query_clusters_request_data_spec.rb +36 -0
- data/spec/models/batch_create_tracked_queries_request_data_spec.rb +80 -0
- data/spec/models/batch_create_tracked_queries_result_resource_failed_inner_spec.rb +60 -0
- data/spec/models/batch_create_tracked_queries_result_resource_spec.rb +42 -0
- data/spec/models/batch_create_tracked_queries_result_resource_successful_inner_spec.rb +54 -0
- data/spec/models/batch_force_check_tracked_queries200_response_failed_inner_spec.rb +48 -0
- data/spec/models/batch_force_check_tracked_queries200_response_spec.rb +42 -0
- data/spec/models/batch_pause_tracked_queries200_response_failed_inner_spec.rb +48 -0
- data/spec/models/batch_pause_tracked_queries200_response_spec.rb +42 -0
- data/spec/models/batch_pause_tracked_queries200_response_successful_inner_spec.rb +36 -0
- data/spec/models/batch_resume_tracked_queries200_response_spec.rb +42 -0
- data/spec/models/batch_targets_request_data_spec.rb +36 -0
- data/spec/models/batch_write_outcome_failed_inner_spec.rb +48 -0
- data/spec/models/batch_write_outcome_spec.rb +42 -0
- data/spec/models/brand_profile_resource_spec.rb +54 -0
- data/spec/models/bulk_add_clusters_to_tracked_queries200_response_spec.rb +42 -0
- data/spec/models/bulk_add_clusters_to_tracked_queries_request_spec.rb +42 -0
- data/spec/models/bulk_remove_clusters_from_tracked_queries200_response_spec.rb +42 -0
- data/spec/models/bulk_remove_clusters_from_tracked_queries_request_spec.rb +42 -0
- data/spec/models/change_member_role_request_spec.rb +40 -0
- data/spec/models/change_tracked_query_check_frequency_request_data_spec.rb +40 -0
- data/spec/models/change_tracked_query_passes_request_data_spec.rb +36 -0
- data/spec/models/citation_resource_spec.rb +90 -0
- data/spec/models/cluster_membership_request_data_spec.rb +36 -0
- data/spec/models/competitor_resource_spec.rb +54 -0
- data/spec/models/create_competitor_request_spec.rb +48 -0
- data/spec/models/create_invitation200_response_spec.rb +52 -0
- data/spec/models/create_invitation201_response_spec.rb +86 -0
- data/spec/models/create_invitation_request_spec.rb +46 -0
- data/spec/models/create_organization201_response_spec.rb +48 -0
- data/spec/models/create_organization_request_spec.rb +36 -0
- data/spec/models/create_project_request_competitors_inner_spec.rb +48 -0
- data/spec/models/create_project_request_spec.rb +54 -0
- data/spec/models/create_query_cluster409_response_spec.rb +48 -0
- data/spec/models/create_query_cluster_request_spec.rb +36 -0
- data/spec/models/delete_query_cluster200_response_spec.rb +48 -0
- data/spec/models/entitlements_resource_spec.rb +104 -0
- data/spec/models/get_available_filters200_response_clusters_inner_spec.rb +42 -0
- data/spec/models/get_available_filters200_response_spec.rb +48 -0
- data/spec/models/get_me_stats200_response_organizations_spec.rb +36 -0
- data/spec/models/get_me_stats200_response_projects_spec.rb +42 -0
- data/spec/models/get_me_stats200_response_spec.rb +42 -0
- data/spec/models/get_membership_stats200_response_spec.rb +72 -0
- data/spec/models/get_mention_samples400_response_details_value_inner_spec.rb +48 -0
- data/spec/models/get_mention_samples400_response_spec.rb +54 -0
- data/spec/models/get_metric_glossary200_response_metrics_inner_spec.rb +76 -0
- data/spec/models/get_metric_glossary200_response_spec.rb +36 -0
- data/spec/models/get_organization_overview200_response_aggregate_spec.rb +72 -0
- data/spec/models/get_organization_overview200_response_projects_inner_spec.rb +78 -0
- data/spec/models/get_organization_overview200_response_spec.rb +42 -0
- data/spec/models/get_organization_stats200_response_invitations_spec.rb +36 -0
- data/spec/models/get_organization_stats200_response_members_spec.rb +36 -0
- data/spec/models/get_organization_stats200_response_projects_spec.rb +42 -0
- data/spec/models/get_organization_stats200_response_spec.rb +48 -0
- data/spec/models/get_share_of_voice_formula200_response_spec.rb +54 -0
- data/spec/models/get_tracking_coverage200_response_sample_inner_spec.rb +70 -0
- data/spec/models/get_tracking_coverage200_response_spec.rb +72 -0
- data/spec/models/invitation_resource_spec.rb +80 -0
- data/spec/models/keyword_listing_resource_mention_type_counts_spec.rb +60 -0
- data/spec/models/keyword_listing_resource_spec.rb +262 -0
- data/spec/models/list_ai_responses200_response_spec.rb +42 -0
- data/spec/models/list_competitors200_response_spec.rb +42 -0
- data/spec/models/list_invitations200_response_spec.rb +42 -0
- data/spec/models/list_keyword_listings200_response_spec.rb +54 -0
- data/spec/models/list_members200_response_spec.rb +42 -0
- data/spec/models/list_organizations200_response_spec.rb +42 -0
- data/spec/models/list_projects200_response_spec.rb +42 -0
- data/spec/models/list_query_clusters200_response_spec.rb +42 -0
- data/spec/models/list_search_snapshots200_response_spec.rb +42 -0
- data/spec/models/list_shopping_snapshots200_response_spec.rb +42 -0
- data/spec/models/me_resource_spec.rb +92 -0
- data/spec/models/member_resource_spec.rb +74 -0
- data/spec/models/operation_effect_spec.rb +48 -0
- data/spec/models/organization_resource_spec.rb +86 -0
- data/spec/models/preview_organization_operation200_response_organization_spec.rb +42 -0
- data/spec/models/preview_organization_operation200_response_spec.rb +84 -0
- data/spec/models/preview_organization_operation_request_spec.rb +58 -0
- data/spec/models/project_detail_resource_competitors_inner_spec.rb +54 -0
- data/spec/models/project_detail_resource_spec.rb +82 -0
- data/spec/models/project_resource_spec.rb +136 -0
- data/spec/models/projected_monthly_checks_resource_spec.rb +42 -0
- data/spec/models/query_cluster_resource_spec.rb +48 -0
- data/spec/models/report_ai_response_request_spec.rb +52 -0
- data/spec/models/search_result_resource_spec.rb +78 -0
- data/spec/models/search_snapshot_resource_spec.rb +66 -0
- data/spec/models/search_tracked_queries200_response_spec.rb +42 -0
- data/spec/models/shopping_offer_resource_spec.rb +96 -0
- data/spec/models/shopping_snapshot_resource_spec.rb +66 -0
- data/spec/models/start_brand_discovery_job_request_spec.rb +42 -0
- data/spec/models/start_brand_name_suggestion_job_request_spec.rb +54 -0
- data/spec/models/start_clustering_job_request_data_spec.rb +52 -0
- data/spec/models/start_keyword_discovery_job_request_spec.rb +54 -0
- data/spec/models/start_prompt_discovery_job_request_spec.rb +54 -0
- data/spec/models/submitted_checks_resource_spec.rb +42 -0
- data/spec/models/subscription_resource_spec.rb +120 -0
- data/spec/models/tracked_query_count_resource_spec.rb +42 -0
- data/spec/models/tracked_query_detail_resource_spec.rb +108 -0
- data/spec/models/tracked_query_resource_spec.rb +150 -0
- data/spec/models/tracked_query_usage_resource_spec.rb +36 -0
- data/spec/models/update_organization_request_spec.rb +48 -0
- data/spec/models/update_project_brand_profile_request_spec.rb +42 -0
- data/spec/models/update_project_request_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- metadata +641 -0
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Mencoro API
|
|
3
|
+
|
|
4
|
+
#Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@mencoro.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Mencoro
|
|
16
|
+
class OrganizationsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Archive an organization
|
|
23
|
+
# Minimum role: owner. Archiving also archives the active projects of the organization, cancels its pending invitations and cancels its subscription at the end of the current billing period. Those effects are applied by background subscribers, so a 200 means the organization was archived, not that every effect has finished. Preview it first to see exactly what will be touched.
|
|
24
|
+
# @param organization_id [String]
|
|
25
|
+
# @param x_mencoro_confirmation [String] The `confirmation.token` returned by POST /api/v1/organization-operation-previews for this exact action, organization and body. Single use, valid for five minutes, and bound to the effects the preview declared: if the organization gained a project or lost an invitation in between, it is refused with 409 rather than doing more than was agreed. Without it the call answers 428.
|
|
26
|
+
# @param idempotency_key [String] Repeat it to retry a lost response. The replay is answered from the record without claiming the confirmation again, so a retry is never refused for presenting a confirmation the first attempt already spent.
|
|
27
|
+
# @param [Hash] opts the optional parameters
|
|
28
|
+
# @return [OrganizationResource]
|
|
29
|
+
def archive_organization(organization_id, x_mencoro_confirmation, idempotency_key, opts = {})
|
|
30
|
+
data, _status_code, _headers = archive_organization_with_http_info(organization_id, x_mencoro_confirmation, idempotency_key, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Archive an organization
|
|
35
|
+
# Minimum role: owner. Archiving also archives the active projects of the organization, cancels its pending invitations and cancels its subscription at the end of the current billing period. Those effects are applied by background subscribers, so a 200 means the organization was archived, not that every effect has finished. Preview it first to see exactly what will be touched.
|
|
36
|
+
# @param organization_id [String]
|
|
37
|
+
# @param x_mencoro_confirmation [String] The `confirmation.token` returned by POST /api/v1/organization-operation-previews for this exact action, organization and body. Single use, valid for five minutes, and bound to the effects the preview declared: if the organization gained a project or lost an invitation in between, it is refused with 409 rather than doing more than was agreed. Without it the call answers 428.
|
|
38
|
+
# @param idempotency_key [String] Repeat it to retry a lost response. The replay is answered from the record without claiming the confirmation again, so a retry is never refused for presenting a confirmation the first attempt already spent.
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [Array<(OrganizationResource, Integer, Hash)>] OrganizationResource data, response status code and response headers
|
|
41
|
+
def archive_organization_with_http_info(organization_id, x_mencoro_confirmation, idempotency_key, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.archive_organization ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'organization_id' is set
|
|
46
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.archive_organization"
|
|
48
|
+
end
|
|
49
|
+
# verify the required parameter 'x_mencoro_confirmation' is set
|
|
50
|
+
if @api_client.config.client_side_validation && x_mencoro_confirmation.nil?
|
|
51
|
+
fail ArgumentError, "Missing the required parameter 'x_mencoro_confirmation' when calling OrganizationsApi.archive_organization"
|
|
52
|
+
end
|
|
53
|
+
# verify the required parameter 'idempotency_key' is set
|
|
54
|
+
if @api_client.config.client_side_validation && idempotency_key.nil?
|
|
55
|
+
fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling OrganizationsApi.archive_organization"
|
|
56
|
+
end
|
|
57
|
+
if @api_client.config.client_side_validation && idempotency_key.to_s.length > 255
|
|
58
|
+
fail ArgumentError, 'invalid value for "idempotency_key" when calling OrganizationsApi.archive_organization, the character length must be smaller than or equal to 255.'
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
|
|
62
|
+
fail ArgumentError, 'invalid value for "idempotency_key" when calling OrganizationsApi.archive_organization, the character length must be greater than or equal to 8.'
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# resource path
|
|
66
|
+
local_var_path = '/api/v1/organizations/{organizationId}/archive'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
67
|
+
|
|
68
|
+
# query parameters
|
|
69
|
+
query_params = opts[:query_params] || {}
|
|
70
|
+
|
|
71
|
+
# header parameters
|
|
72
|
+
header_params = opts[:header_params] || {}
|
|
73
|
+
# HTTP header 'Accept' (if needed)
|
|
74
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
75
|
+
header_params[:'X-Mencoro-Confirmation'] = x_mencoro_confirmation
|
|
76
|
+
header_params[:'Idempotency-Key'] = idempotency_key
|
|
77
|
+
|
|
78
|
+
# form parameters
|
|
79
|
+
form_params = opts[:form_params] || {}
|
|
80
|
+
|
|
81
|
+
# http body (model)
|
|
82
|
+
post_body = opts[:debug_body]
|
|
83
|
+
|
|
84
|
+
# return_type
|
|
85
|
+
return_type = opts[:debug_return_type] || 'OrganizationResource'
|
|
86
|
+
|
|
87
|
+
# auth_names
|
|
88
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
89
|
+
|
|
90
|
+
new_options = opts.merge(
|
|
91
|
+
:operation => :"OrganizationsApi.archive_organization",
|
|
92
|
+
:header_params => header_params,
|
|
93
|
+
:query_params => query_params,
|
|
94
|
+
:form_params => form_params,
|
|
95
|
+
:body => post_body,
|
|
96
|
+
:auth_names => auth_names,
|
|
97
|
+
:return_type => return_type
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
101
|
+
if @api_client.config.debugging
|
|
102
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#archive_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
103
|
+
end
|
|
104
|
+
return data, status_code, headers
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Count the tracked queries an organization has configured
|
|
108
|
+
# Minimum role: viewer. How many tracked queries the organization has configured, counted live in PostgreSQL — the write model — over EVERY project it owns, archived projects included, and over every tracked query in them, active and paused alike. It is deliberately a DIFFERENT number from `aggregate.totalTrackedQueries` in getOrganizationOverview: that one sums a per-project copy held in the Elasticsearch read model and covers ACTIVE projects only, so it excludes archived projects and can lag behind a change that already shows here. Expect the two to disagree and do not treat either as wrong. This figure does reconcile exactly with countTrackedQueries, which counts one project through the same counter in the same store: sum its unfiltered `count` over every project, archived included, and you get this number. For the ACTIVE subset and what it will consume, call getOrganizationProjectedMonthlyChecks, which ranges over the same projects. Do NOT derive the paused count by subtracting one from the other: this number is read live from Postgres while that one is served from a cache invalidated by background subscribers, so the two can disagree while that invalidation catches up and the difference is then a count of nothing. For how many projects this ranges over, read `projects.total` and `projects.active` from getOrganizationStats. The value is never null: 0 means none are configured. This operation takes no query parameters — the population is fixed, and a parameter it cannot honour is rejected with 400 rather than silently ignored.
|
|
109
|
+
# @param organization_id [String]
|
|
110
|
+
# @param [Hash] opts the optional parameters
|
|
111
|
+
# @return [TrackedQueryUsageResource]
|
|
112
|
+
def count_organization_tracked_queries(organization_id, opts = {})
|
|
113
|
+
data, _status_code, _headers = count_organization_tracked_queries_with_http_info(organization_id, opts)
|
|
114
|
+
data
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Count the tracked queries an organization has configured
|
|
118
|
+
# Minimum role: viewer. How many tracked queries the organization has configured, counted live in PostgreSQL — the write model — over EVERY project it owns, archived projects included, and over every tracked query in them, active and paused alike. It is deliberately a DIFFERENT number from `aggregate.totalTrackedQueries` in getOrganizationOverview: that one sums a per-project copy held in the Elasticsearch read model and covers ACTIVE projects only, so it excludes archived projects and can lag behind a change that already shows here. Expect the two to disagree and do not treat either as wrong. This figure does reconcile exactly with countTrackedQueries, which counts one project through the same counter in the same store: sum its unfiltered `count` over every project, archived included, and you get this number. For the ACTIVE subset and what it will consume, call getOrganizationProjectedMonthlyChecks, which ranges over the same projects. Do NOT derive the paused count by subtracting one from the other: this number is read live from Postgres while that one is served from a cache invalidated by background subscribers, so the two can disagree while that invalidation catches up and the difference is then a count of nothing. For how many projects this ranges over, read `projects.total` and `projects.active` from getOrganizationStats. The value is never null: 0 means none are configured. This operation takes no query parameters — the population is fixed, and a parameter it cannot honour is rejected with 400 rather than silently ignored.
|
|
119
|
+
# @param organization_id [String]
|
|
120
|
+
# @param [Hash] opts the optional parameters
|
|
121
|
+
# @return [Array<(TrackedQueryUsageResource, Integer, Hash)>] TrackedQueryUsageResource data, response status code and response headers
|
|
122
|
+
def count_organization_tracked_queries_with_http_info(organization_id, opts = {})
|
|
123
|
+
if @api_client.config.debugging
|
|
124
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.count_organization_tracked_queries ...'
|
|
125
|
+
end
|
|
126
|
+
# verify the required parameter 'organization_id' is set
|
|
127
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
128
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.count_organization_tracked_queries"
|
|
129
|
+
end
|
|
130
|
+
# resource path
|
|
131
|
+
local_var_path = '/api/v1/organizations/{organizationId}/usage/tracked-queries'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
132
|
+
|
|
133
|
+
# query parameters
|
|
134
|
+
query_params = opts[:query_params] || {}
|
|
135
|
+
|
|
136
|
+
# header parameters
|
|
137
|
+
header_params = opts[:header_params] || {}
|
|
138
|
+
# HTTP header 'Accept' (if needed)
|
|
139
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
140
|
+
|
|
141
|
+
# form parameters
|
|
142
|
+
form_params = opts[:form_params] || {}
|
|
143
|
+
|
|
144
|
+
# http body (model)
|
|
145
|
+
post_body = opts[:debug_body]
|
|
146
|
+
|
|
147
|
+
# return_type
|
|
148
|
+
return_type = opts[:debug_return_type] || 'TrackedQueryUsageResource'
|
|
149
|
+
|
|
150
|
+
# auth_names
|
|
151
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
152
|
+
|
|
153
|
+
new_options = opts.merge(
|
|
154
|
+
:operation => :"OrganizationsApi.count_organization_tracked_queries",
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => return_type
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#count_organization_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
166
|
+
end
|
|
167
|
+
return data, status_code, headers
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Create an organization
|
|
171
|
+
# Requires a key scoped to all organizations and the \"organization:manage\" capability: a key limited to named organizations cannot widen its own reach by creating one. Preview it first and send the confirmation in X-Mencoro-Confirmation together with an Idempotency-Key.
|
|
172
|
+
# @param x_mencoro_confirmation [String]
|
|
173
|
+
# @param idempotency_key [String]
|
|
174
|
+
# @param create_organization_request [CreateOrganizationRequest]
|
|
175
|
+
# @param [Hash] opts the optional parameters
|
|
176
|
+
# @return [CreateOrganization201Response]
|
|
177
|
+
def create_organization(x_mencoro_confirmation, idempotency_key, create_organization_request, opts = {})
|
|
178
|
+
data, _status_code, _headers = create_organization_with_http_info(x_mencoro_confirmation, idempotency_key, create_organization_request, opts)
|
|
179
|
+
data
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Create an organization
|
|
183
|
+
# Requires a key scoped to all organizations and the \"organization:manage\" capability: a key limited to named organizations cannot widen its own reach by creating one. Preview it first and send the confirmation in X-Mencoro-Confirmation together with an Idempotency-Key.
|
|
184
|
+
# @param x_mencoro_confirmation [String]
|
|
185
|
+
# @param idempotency_key [String]
|
|
186
|
+
# @param create_organization_request [CreateOrganizationRequest]
|
|
187
|
+
# @param [Hash] opts the optional parameters
|
|
188
|
+
# @return [Array<(CreateOrganization201Response, Integer, Hash)>] CreateOrganization201Response data, response status code and response headers
|
|
189
|
+
def create_organization_with_http_info(x_mencoro_confirmation, idempotency_key, create_organization_request, opts = {})
|
|
190
|
+
if @api_client.config.debugging
|
|
191
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.create_organization ...'
|
|
192
|
+
end
|
|
193
|
+
# verify the required parameter 'x_mencoro_confirmation' is set
|
|
194
|
+
if @api_client.config.client_side_validation && x_mencoro_confirmation.nil?
|
|
195
|
+
fail ArgumentError, "Missing the required parameter 'x_mencoro_confirmation' when calling OrganizationsApi.create_organization"
|
|
196
|
+
end
|
|
197
|
+
# verify the required parameter 'idempotency_key' is set
|
|
198
|
+
if @api_client.config.client_side_validation && idempotency_key.nil?
|
|
199
|
+
fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling OrganizationsApi.create_organization"
|
|
200
|
+
end
|
|
201
|
+
# verify the required parameter 'create_organization_request' is set
|
|
202
|
+
if @api_client.config.client_side_validation && create_organization_request.nil?
|
|
203
|
+
fail ArgumentError, "Missing the required parameter 'create_organization_request' when calling OrganizationsApi.create_organization"
|
|
204
|
+
end
|
|
205
|
+
# resource path
|
|
206
|
+
local_var_path = '/api/v1/organizations'
|
|
207
|
+
|
|
208
|
+
# query parameters
|
|
209
|
+
query_params = opts[:query_params] || {}
|
|
210
|
+
|
|
211
|
+
# header parameters
|
|
212
|
+
header_params = opts[:header_params] || {}
|
|
213
|
+
# HTTP header 'Accept' (if needed)
|
|
214
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
215
|
+
# HTTP header 'Content-Type'
|
|
216
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
217
|
+
if !content_type.nil?
|
|
218
|
+
header_params['Content-Type'] = content_type
|
|
219
|
+
end
|
|
220
|
+
header_params[:'X-Mencoro-Confirmation'] = x_mencoro_confirmation
|
|
221
|
+
header_params[:'Idempotency-Key'] = idempotency_key
|
|
222
|
+
|
|
223
|
+
# form parameters
|
|
224
|
+
form_params = opts[:form_params] || {}
|
|
225
|
+
|
|
226
|
+
# http body (model)
|
|
227
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_request)
|
|
228
|
+
|
|
229
|
+
# return_type
|
|
230
|
+
return_type = opts[:debug_return_type] || 'CreateOrganization201Response'
|
|
231
|
+
|
|
232
|
+
# auth_names
|
|
233
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
234
|
+
|
|
235
|
+
new_options = opts.merge(
|
|
236
|
+
:operation => :"OrganizationsApi.create_organization",
|
|
237
|
+
:header_params => header_params,
|
|
238
|
+
:query_params => query_params,
|
|
239
|
+
:form_params => form_params,
|
|
240
|
+
:body => post_body,
|
|
241
|
+
:auth_names => auth_names,
|
|
242
|
+
:return_type => return_type
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
246
|
+
if @api_client.config.debugging
|
|
247
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
248
|
+
end
|
|
249
|
+
return data, status_code, headers
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Get an organization's plan allowance and consumption
|
|
253
|
+
# Minimum role: owner. Returns what the current plan allows, how much of it has been consumed and when the allowance next resets, taken from the most recent subscription contract whether it is running or cancelled. An organization that has never subscribed answers `status: \"none\"` with every budget and consumption field null — null means \"no plan on file, so not known\", which is deliberately distinct from a budget or a consumption of zero. Commercial and provider details (prices, Stripe identifiers, internal tier codes) are not part of this contract.
|
|
254
|
+
# @param organization_id [String]
|
|
255
|
+
# @param [Hash] opts the optional parameters
|
|
256
|
+
# @return [EntitlementsResource]
|
|
257
|
+
def get_entitlements(organization_id, opts = {})
|
|
258
|
+
data, _status_code, _headers = get_entitlements_with_http_info(organization_id, opts)
|
|
259
|
+
data
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Get an organization's plan allowance and consumption
|
|
263
|
+
# Minimum role: owner. Returns what the current plan allows, how much of it has been consumed and when the allowance next resets, taken from the most recent subscription contract whether it is running or cancelled. An organization that has never subscribed answers `status: \"none\"` with every budget and consumption field null — null means \"no plan on file, so not known\", which is deliberately distinct from a budget or a consumption of zero. Commercial and provider details (prices, Stripe identifiers, internal tier codes) are not part of this contract.
|
|
264
|
+
# @param organization_id [String]
|
|
265
|
+
# @param [Hash] opts the optional parameters
|
|
266
|
+
# @return [Array<(EntitlementsResource, Integer, Hash)>] EntitlementsResource data, response status code and response headers
|
|
267
|
+
def get_entitlements_with_http_info(organization_id, opts = {})
|
|
268
|
+
if @api_client.config.debugging
|
|
269
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.get_entitlements ...'
|
|
270
|
+
end
|
|
271
|
+
# verify the required parameter 'organization_id' is set
|
|
272
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
273
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.get_entitlements"
|
|
274
|
+
end
|
|
275
|
+
# resource path
|
|
276
|
+
local_var_path = '/api/v1/organizations/{organizationId}/entitlements'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
277
|
+
|
|
278
|
+
# query parameters
|
|
279
|
+
query_params = opts[:query_params] || {}
|
|
280
|
+
|
|
281
|
+
# header parameters
|
|
282
|
+
header_params = opts[:header_params] || {}
|
|
283
|
+
# HTTP header 'Accept' (if needed)
|
|
284
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
285
|
+
|
|
286
|
+
# form parameters
|
|
287
|
+
form_params = opts[:form_params] || {}
|
|
288
|
+
|
|
289
|
+
# http body (model)
|
|
290
|
+
post_body = opts[:debug_body]
|
|
291
|
+
|
|
292
|
+
# return_type
|
|
293
|
+
return_type = opts[:debug_return_type] || 'EntitlementsResource'
|
|
294
|
+
|
|
295
|
+
# auth_names
|
|
296
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
297
|
+
|
|
298
|
+
new_options = opts.merge(
|
|
299
|
+
:operation => :"OrganizationsApi.get_entitlements",
|
|
300
|
+
:header_params => header_params,
|
|
301
|
+
:query_params => query_params,
|
|
302
|
+
:form_params => form_params,
|
|
303
|
+
:body => post_body,
|
|
304
|
+
:auth_names => auth_names,
|
|
305
|
+
:return_type => return_type
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
309
|
+
if @api_client.config.debugging
|
|
310
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#get_entitlements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
311
|
+
end
|
|
312
|
+
return data, status_code, headers
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# Membership, project and invitation counts for an organization
|
|
316
|
+
# Minimum role: owner. Pre-computed counts of the organization's members, projects and outstanding invitations, read from a materialized view that is refreshed periodically — `computedAt` says when the snapshot was taken, so a member added since the last refresh is not counted yet. Every count is always an integer and a zero means zero; an organization whose row has not been computed yet answers 404 with code `organization_membership_stats_not_found`, never a body of zeros, so \"none\" and \"not known yet\" are never confused. Counts cover the whole organization, active and inactive alike: `totalMembersCount` includes suspended members, and `totalProjectsCount` includes archived projects. `pendingInvitationsCount` counts only invitations that are still pending and not yet expired.
|
|
317
|
+
# @param organization_id [String]
|
|
318
|
+
# @param [Hash] opts the optional parameters
|
|
319
|
+
# @return [GetMembershipStats200Response]
|
|
320
|
+
def get_membership_stats(organization_id, opts = {})
|
|
321
|
+
data, _status_code, _headers = get_membership_stats_with_http_info(organization_id, opts)
|
|
322
|
+
data
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
# Membership, project and invitation counts for an organization
|
|
326
|
+
# Minimum role: owner. Pre-computed counts of the organization's members, projects and outstanding invitations, read from a materialized view that is refreshed periodically — `computedAt` says when the snapshot was taken, so a member added since the last refresh is not counted yet. Every count is always an integer and a zero means zero; an organization whose row has not been computed yet answers 404 with code `organization_membership_stats_not_found`, never a body of zeros, so \"none\" and \"not known yet\" are never confused. Counts cover the whole organization, active and inactive alike: `totalMembersCount` includes suspended members, and `totalProjectsCount` includes archived projects. `pendingInvitationsCount` counts only invitations that are still pending and not yet expired.
|
|
327
|
+
# @param organization_id [String]
|
|
328
|
+
# @param [Hash] opts the optional parameters
|
|
329
|
+
# @return [Array<(GetMembershipStats200Response, Integer, Hash)>] GetMembershipStats200Response data, response status code and response headers
|
|
330
|
+
def get_membership_stats_with_http_info(organization_id, opts = {})
|
|
331
|
+
if @api_client.config.debugging
|
|
332
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.get_membership_stats ...'
|
|
333
|
+
end
|
|
334
|
+
# verify the required parameter 'organization_id' is set
|
|
335
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
336
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.get_membership_stats"
|
|
337
|
+
end
|
|
338
|
+
# resource path
|
|
339
|
+
local_var_path = '/api/v1/organizations/{organizationId}/membership-stats'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
340
|
+
|
|
341
|
+
# query parameters
|
|
342
|
+
query_params = opts[:query_params] || {}
|
|
343
|
+
|
|
344
|
+
# header parameters
|
|
345
|
+
header_params = opts[:header_params] || {}
|
|
346
|
+
# HTTP header 'Accept' (if needed)
|
|
347
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
348
|
+
|
|
349
|
+
# form parameters
|
|
350
|
+
form_params = opts[:form_params] || {}
|
|
351
|
+
|
|
352
|
+
# http body (model)
|
|
353
|
+
post_body = opts[:debug_body]
|
|
354
|
+
|
|
355
|
+
# return_type
|
|
356
|
+
return_type = opts[:debug_return_type] || 'GetMembershipStats200Response'
|
|
357
|
+
|
|
358
|
+
# auth_names
|
|
359
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
360
|
+
|
|
361
|
+
new_options = opts.merge(
|
|
362
|
+
:operation => :"OrganizationsApi.get_membership_stats",
|
|
363
|
+
:header_params => header_params,
|
|
364
|
+
:query_params => query_params,
|
|
365
|
+
:form_params => form_params,
|
|
366
|
+
:body => post_body,
|
|
367
|
+
:auth_names => auth_names,
|
|
368
|
+
:return_type => return_type
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
372
|
+
if @api_client.config.debugging
|
|
373
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#get_membership_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
374
|
+
end
|
|
375
|
+
return data, status_code, headers
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Get an organization
|
|
379
|
+
# Minimum role: viewer. An organization outside the key's scope, or one the caller is not an active member of, answers 404 - the API never confirms that an inaccessible organization exists.
|
|
380
|
+
# @param organization_id [String]
|
|
381
|
+
# @param [Hash] opts the optional parameters
|
|
382
|
+
# @return [OrganizationResource]
|
|
383
|
+
def get_organization(organization_id, opts = {})
|
|
384
|
+
data, _status_code, _headers = get_organization_with_http_info(organization_id, opts)
|
|
385
|
+
data
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
# Get an organization
|
|
389
|
+
# Minimum role: viewer. An organization outside the key's scope, or one the caller is not an active member of, answers 404 - the API never confirms that an inaccessible organization exists.
|
|
390
|
+
# @param organization_id [String]
|
|
391
|
+
# @param [Hash] opts the optional parameters
|
|
392
|
+
# @return [Array<(OrganizationResource, Integer, Hash)>] OrganizationResource data, response status code and response headers
|
|
393
|
+
def get_organization_with_http_info(organization_id, opts = {})
|
|
394
|
+
if @api_client.config.debugging
|
|
395
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.get_organization ...'
|
|
396
|
+
end
|
|
397
|
+
# verify the required parameter 'organization_id' is set
|
|
398
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
399
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.get_organization"
|
|
400
|
+
end
|
|
401
|
+
# resource path
|
|
402
|
+
local_var_path = '/api/v1/organizations/{organizationId}'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
403
|
+
|
|
404
|
+
# query parameters
|
|
405
|
+
query_params = opts[:query_params] || {}
|
|
406
|
+
|
|
407
|
+
# header parameters
|
|
408
|
+
header_params = opts[:header_params] || {}
|
|
409
|
+
# HTTP header 'Accept' (if needed)
|
|
410
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
411
|
+
|
|
412
|
+
# form parameters
|
|
413
|
+
form_params = opts[:form_params] || {}
|
|
414
|
+
|
|
415
|
+
# http body (model)
|
|
416
|
+
post_body = opts[:debug_body]
|
|
417
|
+
|
|
418
|
+
# return_type
|
|
419
|
+
return_type = opts[:debug_return_type] || 'OrganizationResource'
|
|
420
|
+
|
|
421
|
+
# auth_names
|
|
422
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
423
|
+
|
|
424
|
+
new_options = opts.merge(
|
|
425
|
+
:operation => :"OrganizationsApi.get_organization",
|
|
426
|
+
:header_params => header_params,
|
|
427
|
+
:query_params => query_params,
|
|
428
|
+
:form_params => form_params,
|
|
429
|
+
:body => post_body,
|
|
430
|
+
:auth_names => auth_names,
|
|
431
|
+
:return_type => return_type
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
435
|
+
if @api_client.config.debugging
|
|
436
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
437
|
+
end
|
|
438
|
+
return data, status_code, headers
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
# Project a month of check consumption from the current tracking configuration
|
|
442
|
+
# Minimum role: viewer. What the organization's current configuration would consume in a month, in check budget units — the same unit `checkBudget` and `checksAvailable` are counted in by the entitlements operation — so the two are directly comparable when sizing a plan. The arithmetic is published so it can be reproduced rather than trusted: for each ACTIVE tracked query, runs per month (daily 30, weekly 4, monthly 1) multiplied by its nPasses, summed. A weekly query bills 4, not 4.345: a month is modelled as 30 days and 4 weeks, a planning convention rather than a calendar. Take `checkFrequency` and `nPasses` from the tracked-query listing and the arithmetic will match — though the two sides are read from different places and settle at different times: this figure is computed in the Postgres write model and served from a cache that background subscribers invalidate, while that listing reads an Elasticsearch projection. Immediately after a write the two can disagree; neither is wrong, they are catching up. PAUSED queries are excluded from both figures; archived PROJECTS are not — archiving a project does not pause its tracked queries, so they still count here, exactly as they do in countOrganizationTrackedQueries. `activeTrackedQueryCount` describes the same population as that count, minus the paused queries — but do not compute the difference to learn how many are paused: THIS OPERATION IS CACHED and that one is read live, so the two can disagree while the cache is invalidated in the background. This is a projection of the configuration, not a forecast of what will actually be spent: it does not look at the remaining plan budget, does not know which checks will be skipped or retried, and reserves and debits nothing. It is also not the `checkCost` of countTrackedQueries, which prices one round over one project rather than a month over the organization. Both values are never null: 0 means nothing is scheduled. This operation takes no query parameters — the population is fixed, and a parameter it cannot honour is rejected with 400 rather than silently ignored.
|
|
443
|
+
# @param organization_id [String]
|
|
444
|
+
# @param [Hash] opts the optional parameters
|
|
445
|
+
# @return [ProjectedMonthlyChecksResource]
|
|
446
|
+
def get_organization_projected_monthly_checks(organization_id, opts = {})
|
|
447
|
+
data, _status_code, _headers = get_organization_projected_monthly_checks_with_http_info(organization_id, opts)
|
|
448
|
+
data
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
# Project a month of check consumption from the current tracking configuration
|
|
452
|
+
# Minimum role: viewer. What the organization's current configuration would consume in a month, in check budget units — the same unit `checkBudget` and `checksAvailable` are counted in by the entitlements operation — so the two are directly comparable when sizing a plan. The arithmetic is published so it can be reproduced rather than trusted: for each ACTIVE tracked query, runs per month (daily 30, weekly 4, monthly 1) multiplied by its nPasses, summed. A weekly query bills 4, not 4.345: a month is modelled as 30 days and 4 weeks, a planning convention rather than a calendar. Take `checkFrequency` and `nPasses` from the tracked-query listing and the arithmetic will match — though the two sides are read from different places and settle at different times: this figure is computed in the Postgres write model and served from a cache that background subscribers invalidate, while that listing reads an Elasticsearch projection. Immediately after a write the two can disagree; neither is wrong, they are catching up. PAUSED queries are excluded from both figures; archived PROJECTS are not — archiving a project does not pause its tracked queries, so they still count here, exactly as they do in countOrganizationTrackedQueries. `activeTrackedQueryCount` describes the same population as that count, minus the paused queries — but do not compute the difference to learn how many are paused: THIS OPERATION IS CACHED and that one is read live, so the two can disagree while the cache is invalidated in the background. This is a projection of the configuration, not a forecast of what will actually be spent: it does not look at the remaining plan budget, does not know which checks will be skipped or retried, and reserves and debits nothing. It is also not the `checkCost` of countTrackedQueries, which prices one round over one project rather than a month over the organization. Both values are never null: 0 means nothing is scheduled. This operation takes no query parameters — the population is fixed, and a parameter it cannot honour is rejected with 400 rather than silently ignored.
|
|
453
|
+
# @param organization_id [String]
|
|
454
|
+
# @param [Hash] opts the optional parameters
|
|
455
|
+
# @return [Array<(ProjectedMonthlyChecksResource, Integer, Hash)>] ProjectedMonthlyChecksResource data, response status code and response headers
|
|
456
|
+
def get_organization_projected_monthly_checks_with_http_info(organization_id, opts = {})
|
|
457
|
+
if @api_client.config.debugging
|
|
458
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.get_organization_projected_monthly_checks ...'
|
|
459
|
+
end
|
|
460
|
+
# verify the required parameter 'organization_id' is set
|
|
461
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
462
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.get_organization_projected_monthly_checks"
|
|
463
|
+
end
|
|
464
|
+
# resource path
|
|
465
|
+
local_var_path = '/api/v1/organizations/{organizationId}/usage/projected-monthly-checks'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
466
|
+
|
|
467
|
+
# query parameters
|
|
468
|
+
query_params = opts[:query_params] || {}
|
|
469
|
+
|
|
470
|
+
# header parameters
|
|
471
|
+
header_params = opts[:header_params] || {}
|
|
472
|
+
# HTTP header 'Accept' (if needed)
|
|
473
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
474
|
+
|
|
475
|
+
# form parameters
|
|
476
|
+
form_params = opts[:form_params] || {}
|
|
477
|
+
|
|
478
|
+
# http body (model)
|
|
479
|
+
post_body = opts[:debug_body]
|
|
480
|
+
|
|
481
|
+
# return_type
|
|
482
|
+
return_type = opts[:debug_return_type] || 'ProjectedMonthlyChecksResource'
|
|
483
|
+
|
|
484
|
+
# auth_names
|
|
485
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
486
|
+
|
|
487
|
+
new_options = opts.merge(
|
|
488
|
+
:operation => :"OrganizationsApi.get_organization_projected_monthly_checks",
|
|
489
|
+
:header_params => header_params,
|
|
490
|
+
:query_params => query_params,
|
|
491
|
+
:form_params => form_params,
|
|
492
|
+
:body => post_body,
|
|
493
|
+
:auth_names => auth_names,
|
|
494
|
+
:return_type => return_type
|
|
495
|
+
)
|
|
496
|
+
|
|
497
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
498
|
+
if @api_client.config.debugging
|
|
499
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#get_organization_projected_monthly_checks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
500
|
+
end
|
|
501
|
+
return data, status_code, headers
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
# Headline counts for an organization
|
|
505
|
+
# Minimum role: viewer. Active members, projects (total and active) and pending invitations, in one call. Every value is a count and is always known: 0 means the organization really has none of that thing, and no field is ever null. `members.total` counts ACTIVE memberships only, so a suspended member is not included; `projects.total` counts every project including archived ones, and `projects.active` the non-archived subset. This is a current-state snapshot and takes no date window.
|
|
506
|
+
# @param organization_id [String]
|
|
507
|
+
# @param [Hash] opts the optional parameters
|
|
508
|
+
# @return [GetOrganizationStats200Response]
|
|
509
|
+
def get_organization_stats(organization_id, opts = {})
|
|
510
|
+
data, _status_code, _headers = get_organization_stats_with_http_info(organization_id, opts)
|
|
511
|
+
data
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
# Headline counts for an organization
|
|
515
|
+
# Minimum role: viewer. Active members, projects (total and active) and pending invitations, in one call. Every value is a count and is always known: 0 means the organization really has none of that thing, and no field is ever null. `members.total` counts ACTIVE memberships only, so a suspended member is not included; `projects.total` counts every project including archived ones, and `projects.active` the non-archived subset. This is a current-state snapshot and takes no date window.
|
|
516
|
+
# @param organization_id [String]
|
|
517
|
+
# @param [Hash] opts the optional parameters
|
|
518
|
+
# @return [Array<(GetOrganizationStats200Response, Integer, Hash)>] GetOrganizationStats200Response data, response status code and response headers
|
|
519
|
+
def get_organization_stats_with_http_info(organization_id, opts = {})
|
|
520
|
+
if @api_client.config.debugging
|
|
521
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.get_organization_stats ...'
|
|
522
|
+
end
|
|
523
|
+
# verify the required parameter 'organization_id' is set
|
|
524
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
525
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.get_organization_stats"
|
|
526
|
+
end
|
|
527
|
+
# resource path
|
|
528
|
+
local_var_path = '/api/v1/organizations/{organizationId}/stats'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
529
|
+
|
|
530
|
+
# query parameters
|
|
531
|
+
query_params = opts[:query_params] || {}
|
|
532
|
+
|
|
533
|
+
# header parameters
|
|
534
|
+
header_params = opts[:header_params] || {}
|
|
535
|
+
# HTTP header 'Accept' (if needed)
|
|
536
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
537
|
+
|
|
538
|
+
# form parameters
|
|
539
|
+
form_params = opts[:form_params] || {}
|
|
540
|
+
|
|
541
|
+
# http body (model)
|
|
542
|
+
post_body = opts[:debug_body]
|
|
543
|
+
|
|
544
|
+
# return_type
|
|
545
|
+
return_type = opts[:debug_return_type] || 'GetOrganizationStats200Response'
|
|
546
|
+
|
|
547
|
+
# auth_names
|
|
548
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
549
|
+
|
|
550
|
+
new_options = opts.merge(
|
|
551
|
+
:operation => :"OrganizationsApi.get_organization_stats",
|
|
552
|
+
:header_params => header_params,
|
|
553
|
+
:query_params => query_params,
|
|
554
|
+
:form_params => form_params,
|
|
555
|
+
:body => post_body,
|
|
556
|
+
:auth_names => auth_names,
|
|
557
|
+
:return_type => return_type
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
561
|
+
if @api_client.config.debugging
|
|
562
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#get_organization_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
563
|
+
end
|
|
564
|
+
return data, status_code, headers
|
|
565
|
+
end
|
|
566
|
+
|
|
567
|
+
# List accessible organizations
|
|
568
|
+
# Returns the organizations the key's owner is an active member of, narrowed to the key's scope. A key scoped to all organizations also sees organizations joined after it was created.Send `Accept: text/csv` to receive the same page as a CSV download instead of JSON: same filters, same authorization, same page window and the same maximum of 100 rows — it is this page in another format, not a bulk export, so a whole collection is still read by paging. The CSV carries no `total`, because a table whose every row is a record has nowhere to put one; read it from the JSON representation of the same request. Cells beginning with `=`, `+`, `-` or `@` are prefixed with an apostrophe so a spreadsheet treats them as text rather than running them as formulas.
|
|
569
|
+
# @param [Hash] opts the optional parameters
|
|
570
|
+
# @option opts [Integer] :limit (default to 20)
|
|
571
|
+
# @option opts [Integer] :offset (default to 0)
|
|
572
|
+
# @option opts [String] :search
|
|
573
|
+
# @option opts [String] :status
|
|
574
|
+
# @option opts [String] :sort_by (default to 'createdAt')
|
|
575
|
+
# @option opts [String] :sort_order (default to 'desc')
|
|
576
|
+
# @return [ListOrganizations200Response]
|
|
577
|
+
def list_organizations(opts = {})
|
|
578
|
+
data, _status_code, _headers = list_organizations_with_http_info(opts)
|
|
579
|
+
data
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
# List accessible organizations
|
|
583
|
+
# Returns the organizations the key's owner is an active member of, narrowed to the key's scope. A key scoped to all organizations also sees organizations joined after it was created.Send `Accept: text/csv` to receive the same page as a CSV download instead of JSON: same filters, same authorization, same page window and the same maximum of 100 rows — it is this page in another format, not a bulk export, so a whole collection is still read by paging. The CSV carries no `total`, because a table whose every row is a record has nowhere to put one; read it from the JSON representation of the same request. Cells beginning with `=`, `+`, `-` or `@` are prefixed with an apostrophe so a spreadsheet treats them as text rather than running them as formulas.
|
|
584
|
+
# @param [Hash] opts the optional parameters
|
|
585
|
+
# @option opts [Integer] :limit (default to 20)
|
|
586
|
+
# @option opts [Integer] :offset (default to 0)
|
|
587
|
+
# @option opts [String] :search
|
|
588
|
+
# @option opts [String] :status
|
|
589
|
+
# @option opts [String] :sort_by (default to 'createdAt')
|
|
590
|
+
# @option opts [String] :sort_order (default to 'desc')
|
|
591
|
+
# @return [Array<(ListOrganizations200Response, Integer, Hash)>] ListOrganizations200Response data, response status code and response headers
|
|
592
|
+
def list_organizations_with_http_info(opts = {})
|
|
593
|
+
if @api_client.config.debugging
|
|
594
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.list_organizations ...'
|
|
595
|
+
end
|
|
596
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
597
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.list_organizations, must be smaller than or equal to 100.'
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
601
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.list_organizations, must be greater than or equal to 1.'
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
605
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling OrganizationsApi.list_organizations, must be greater than or equal to 0.'
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 100
|
|
609
|
+
fail ArgumentError, 'invalid value for "opts[:"search"]" when calling OrganizationsApi.list_organizations, the character length must be smaller than or equal to 100.'
|
|
610
|
+
end
|
|
611
|
+
|
|
612
|
+
allowable_values = ["active", "archived"]
|
|
613
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
|
614
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
|
615
|
+
end
|
|
616
|
+
allowable_values = ["createdAt", "name"]
|
|
617
|
+
if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
|
|
618
|
+
fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
|
|
619
|
+
end
|
|
620
|
+
allowable_values = ["asc", "desc"]
|
|
621
|
+
if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
|
|
622
|
+
fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
|
|
623
|
+
end
|
|
624
|
+
# resource path
|
|
625
|
+
local_var_path = '/api/v1/organizations'
|
|
626
|
+
|
|
627
|
+
# query parameters
|
|
628
|
+
query_params = opts[:query_params] || {}
|
|
629
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
630
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
631
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
632
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
633
|
+
query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
|
|
634
|
+
query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
|
635
|
+
|
|
636
|
+
# header parameters
|
|
637
|
+
header_params = opts[:header_params] || {}
|
|
638
|
+
# HTTP header 'Accept' (if needed)
|
|
639
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv']) unless header_params['Accept']
|
|
640
|
+
|
|
641
|
+
# form parameters
|
|
642
|
+
form_params = opts[:form_params] || {}
|
|
643
|
+
|
|
644
|
+
# http body (model)
|
|
645
|
+
post_body = opts[:debug_body]
|
|
646
|
+
|
|
647
|
+
# return_type
|
|
648
|
+
return_type = opts[:debug_return_type] || 'ListOrganizations200Response'
|
|
649
|
+
|
|
650
|
+
# auth_names
|
|
651
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
652
|
+
|
|
653
|
+
new_options = opts.merge(
|
|
654
|
+
:operation => :"OrganizationsApi.list_organizations",
|
|
655
|
+
:header_params => header_params,
|
|
656
|
+
:query_params => query_params,
|
|
657
|
+
:form_params => form_params,
|
|
658
|
+
:body => post_body,
|
|
659
|
+
:auth_names => auth_names,
|
|
660
|
+
:return_type => return_type
|
|
661
|
+
)
|
|
662
|
+
|
|
663
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
664
|
+
if @api_client.config.debugging
|
|
665
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
666
|
+
end
|
|
667
|
+
return data, status_code, headers
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
# Restore an archived organization
|
|
671
|
+
# Minimum role: owner. Restoring reinstates the projects that were archived as part of archiving this organization - projects archived on their own stay archived - and aborts a pending subscription cancellation. Invitations cancelled by the archive are not reinstated. Preview it first to see which effects are reversible.
|
|
672
|
+
# @param organization_id [String]
|
|
673
|
+
# @param x_mencoro_confirmation [String]
|
|
674
|
+
# @param idempotency_key [String]
|
|
675
|
+
# @param [Hash] opts the optional parameters
|
|
676
|
+
# @return [OrganizationResource]
|
|
677
|
+
def restore_organization(organization_id, x_mencoro_confirmation, idempotency_key, opts = {})
|
|
678
|
+
data, _status_code, _headers = restore_organization_with_http_info(organization_id, x_mencoro_confirmation, idempotency_key, opts)
|
|
679
|
+
data
|
|
680
|
+
end
|
|
681
|
+
|
|
682
|
+
# Restore an archived organization
|
|
683
|
+
# Minimum role: owner. Restoring reinstates the projects that were archived as part of archiving this organization - projects archived on their own stay archived - and aborts a pending subscription cancellation. Invitations cancelled by the archive are not reinstated. Preview it first to see which effects are reversible.
|
|
684
|
+
# @param organization_id [String]
|
|
685
|
+
# @param x_mencoro_confirmation [String]
|
|
686
|
+
# @param idempotency_key [String]
|
|
687
|
+
# @param [Hash] opts the optional parameters
|
|
688
|
+
# @return [Array<(OrganizationResource, Integer, Hash)>] OrganizationResource data, response status code and response headers
|
|
689
|
+
def restore_organization_with_http_info(organization_id, x_mencoro_confirmation, idempotency_key, opts = {})
|
|
690
|
+
if @api_client.config.debugging
|
|
691
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.restore_organization ...'
|
|
692
|
+
end
|
|
693
|
+
# verify the required parameter 'organization_id' is set
|
|
694
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
695
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.restore_organization"
|
|
696
|
+
end
|
|
697
|
+
# verify the required parameter 'x_mencoro_confirmation' is set
|
|
698
|
+
if @api_client.config.client_side_validation && x_mencoro_confirmation.nil?
|
|
699
|
+
fail ArgumentError, "Missing the required parameter 'x_mencoro_confirmation' when calling OrganizationsApi.restore_organization"
|
|
700
|
+
end
|
|
701
|
+
# verify the required parameter 'idempotency_key' is set
|
|
702
|
+
if @api_client.config.client_side_validation && idempotency_key.nil?
|
|
703
|
+
fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling OrganizationsApi.restore_organization"
|
|
704
|
+
end
|
|
705
|
+
# resource path
|
|
706
|
+
local_var_path = '/api/v1/organizations/{organizationId}/restore'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
707
|
+
|
|
708
|
+
# query parameters
|
|
709
|
+
query_params = opts[:query_params] || {}
|
|
710
|
+
|
|
711
|
+
# header parameters
|
|
712
|
+
header_params = opts[:header_params] || {}
|
|
713
|
+
# HTTP header 'Accept' (if needed)
|
|
714
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
715
|
+
header_params[:'X-Mencoro-Confirmation'] = x_mencoro_confirmation
|
|
716
|
+
header_params[:'Idempotency-Key'] = idempotency_key
|
|
717
|
+
|
|
718
|
+
# form parameters
|
|
719
|
+
form_params = opts[:form_params] || {}
|
|
720
|
+
|
|
721
|
+
# http body (model)
|
|
722
|
+
post_body = opts[:debug_body]
|
|
723
|
+
|
|
724
|
+
# return_type
|
|
725
|
+
return_type = opts[:debug_return_type] || 'OrganizationResource'
|
|
726
|
+
|
|
727
|
+
# auth_names
|
|
728
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
729
|
+
|
|
730
|
+
new_options = opts.merge(
|
|
731
|
+
:operation => :"OrganizationsApi.restore_organization",
|
|
732
|
+
:header_params => header_params,
|
|
733
|
+
:query_params => query_params,
|
|
734
|
+
:form_params => form_params,
|
|
735
|
+
:body => post_body,
|
|
736
|
+
:auth_names => auth_names,
|
|
737
|
+
:return_type => return_type
|
|
738
|
+
)
|
|
739
|
+
|
|
740
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
741
|
+
if @api_client.config.debugging
|
|
742
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#restore_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
743
|
+
end
|
|
744
|
+
return data, status_code, headers
|
|
745
|
+
end
|
|
746
|
+
|
|
747
|
+
# Update an organization profile
|
|
748
|
+
# Minimum role: owner. A partial update: omit a field to leave it alone, send it as null to clear it. Preview it first; the confirmation is bound to the current values, so an edit made by somebody else in between invalidates it rather than being silently overwritten. The organization image is deliberately NOT writable here, although the Mencoro app accepts one in the equivalent call: a published JSON API is the wrong place to carry a 10MB base64 blob in a body that also has to be fingerprinted for idempotency and digested for the confirmation. The image stays readable as `imageUrl`; changing it is done in the app.
|
|
749
|
+
# @param organization_id [String]
|
|
750
|
+
# @param x_mencoro_confirmation [String]
|
|
751
|
+
# @param idempotency_key [String]
|
|
752
|
+
# @param update_organization_request [UpdateOrganizationRequest]
|
|
753
|
+
# @param [Hash] opts the optional parameters
|
|
754
|
+
# @return [OrganizationResource]
|
|
755
|
+
def update_organization(organization_id, x_mencoro_confirmation, idempotency_key, update_organization_request, opts = {})
|
|
756
|
+
data, _status_code, _headers = update_organization_with_http_info(organization_id, x_mencoro_confirmation, idempotency_key, update_organization_request, opts)
|
|
757
|
+
data
|
|
758
|
+
end
|
|
759
|
+
|
|
760
|
+
# Update an organization profile
|
|
761
|
+
# Minimum role: owner. A partial update: omit a field to leave it alone, send it as null to clear it. Preview it first; the confirmation is bound to the current values, so an edit made by somebody else in between invalidates it rather than being silently overwritten. The organization image is deliberately NOT writable here, although the Mencoro app accepts one in the equivalent call: a published JSON API is the wrong place to carry a 10MB base64 blob in a body that also has to be fingerprinted for idempotency and digested for the confirmation. The image stays readable as `imageUrl`; changing it is done in the app.
|
|
762
|
+
# @param organization_id [String]
|
|
763
|
+
# @param x_mencoro_confirmation [String]
|
|
764
|
+
# @param idempotency_key [String]
|
|
765
|
+
# @param update_organization_request [UpdateOrganizationRequest]
|
|
766
|
+
# @param [Hash] opts the optional parameters
|
|
767
|
+
# @return [Array<(OrganizationResource, Integer, Hash)>] OrganizationResource data, response status code and response headers
|
|
768
|
+
def update_organization_with_http_info(organization_id, x_mencoro_confirmation, idempotency_key, update_organization_request, opts = {})
|
|
769
|
+
if @api_client.config.debugging
|
|
770
|
+
@api_client.config.logger.debug 'Calling API: OrganizationsApi.update_organization ...'
|
|
771
|
+
end
|
|
772
|
+
# verify the required parameter 'organization_id' is set
|
|
773
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
|
774
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.update_organization"
|
|
775
|
+
end
|
|
776
|
+
# verify the required parameter 'x_mencoro_confirmation' is set
|
|
777
|
+
if @api_client.config.client_side_validation && x_mencoro_confirmation.nil?
|
|
778
|
+
fail ArgumentError, "Missing the required parameter 'x_mencoro_confirmation' when calling OrganizationsApi.update_organization"
|
|
779
|
+
end
|
|
780
|
+
# verify the required parameter 'idempotency_key' is set
|
|
781
|
+
if @api_client.config.client_side_validation && idempotency_key.nil?
|
|
782
|
+
fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling OrganizationsApi.update_organization"
|
|
783
|
+
end
|
|
784
|
+
# verify the required parameter 'update_organization_request' is set
|
|
785
|
+
if @api_client.config.client_side_validation && update_organization_request.nil?
|
|
786
|
+
fail ArgumentError, "Missing the required parameter 'update_organization_request' when calling OrganizationsApi.update_organization"
|
|
787
|
+
end
|
|
788
|
+
# resource path
|
|
789
|
+
local_var_path = '/api/v1/organizations/{organizationId}'.sub('{organizationId}', CGI.escape(organization_id.to_s))
|
|
790
|
+
|
|
791
|
+
# query parameters
|
|
792
|
+
query_params = opts[:query_params] || {}
|
|
793
|
+
|
|
794
|
+
# header parameters
|
|
795
|
+
header_params = opts[:header_params] || {}
|
|
796
|
+
# HTTP header 'Accept' (if needed)
|
|
797
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
798
|
+
# HTTP header 'Content-Type'
|
|
799
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
800
|
+
if !content_type.nil?
|
|
801
|
+
header_params['Content-Type'] = content_type
|
|
802
|
+
end
|
|
803
|
+
header_params[:'X-Mencoro-Confirmation'] = x_mencoro_confirmation
|
|
804
|
+
header_params[:'Idempotency-Key'] = idempotency_key
|
|
805
|
+
|
|
806
|
+
# form parameters
|
|
807
|
+
form_params = opts[:form_params] || {}
|
|
808
|
+
|
|
809
|
+
# http body (model)
|
|
810
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_organization_request)
|
|
811
|
+
|
|
812
|
+
# return_type
|
|
813
|
+
return_type = opts[:debug_return_type] || 'OrganizationResource'
|
|
814
|
+
|
|
815
|
+
# auth_names
|
|
816
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey']
|
|
817
|
+
|
|
818
|
+
new_options = opts.merge(
|
|
819
|
+
:operation => :"OrganizationsApi.update_organization",
|
|
820
|
+
:header_params => header_params,
|
|
821
|
+
:query_params => query_params,
|
|
822
|
+
:form_params => form_params,
|
|
823
|
+
:body => post_body,
|
|
824
|
+
:auth_names => auth_names,
|
|
825
|
+
:return_type => return_type
|
|
826
|
+
)
|
|
827
|
+
|
|
828
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
829
|
+
if @api_client.config.debugging
|
|
830
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#update_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
831
|
+
end
|
|
832
|
+
return data, status_code, headers
|
|
833
|
+
end
|
|
834
|
+
end
|
|
835
|
+
end
|