From 6c7865a33666d8955791f659881abfe932e1abf9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 31 Jan 2022 19:38:50 +0000 Subject: [PATCH] feat: update client libraries to support Database operations PiperOrigin-RevId: 419710013 Source-Link: https://github.com/googleapis/googleapis/commit/b7c9d05c60f87c05c8701e67c6ef24699846a42d Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae498279c4e71cd4aa6e0655e92a693df97472c4 Copy-Tag: eyJwIjoiTW9uaXRvcmluZy8uT3dsQm90LnlhbWwiLCJoIjoiYWU0OTgyNzljNGU3MWNkNGFhNmUwNjU1ZTkyYTY5M2RmOTc0NzJjNCJ9 --- .../Google/Monitoring/V3/Alert.php | Bin 0 -> 4452 bytes .../Google/Monitoring/V3/AlertService.php | 64 + .../Google/Monitoring/V3/Common.php | Bin 0 -> 2529 bytes .../Google/Monitoring/V3/DroppedLabels.php | 33 + .../Google/Monitoring/V3/Group.php | 37 + .../Google/Monitoring/V3/GroupService.php | Bin 0 -> 3720 bytes .../Google/Monitoring/V3/Metric.php | Bin 0 -> 2818 bytes .../Google/Monitoring/V3/MetricService.php | Bin 0 -> 7301 bytes .../Google/Monitoring/V3/MutationRecord.php | 32 + .../Google/Monitoring/V3/Notification.php | Bin 0 -> 2852 bytes .../Monitoring/V3/NotificationService.php | 98 ++ .../Google/Monitoring/V3/QueryService.php | 34 + .../Google/Monitoring/V3/Service.php | Bin 0 -> 4829 bytes .../Google/Monitoring/V3/ServiceService.php | 95 ++ .../Google/Monitoring/V3/SpanContext.php | 29 + .../Google/Monitoring/V3/Uptime.php | Bin 0 -> 3626 bytes .../Google/Monitoring/V3/UptimeService.php | 73 + .../Cloud/Monitoring/V3/Aggregation.php | 389 ++++++ .../Monitoring/V3/Aggregation/Aligner.php | 269 ++++ .../Monitoring/V3/Aggregation/Reducer.php | 191 +++ .../Monitoring/V3/Aggregation_Aligner.php | 16 + .../Monitoring/V3/Aggregation_Reducer.php | 16 + .../Cloud/Monitoring/V3/AlertPolicy.php | 707 ++++++++++ .../V3/AlertPolicy/AlertStrategy.php | 133 ++ .../AlertStrategy/NotificationRateLimit.php | 81 ++ .../Monitoring/V3/AlertPolicy/Condition.php | 340 +++++ .../V3/AlertPolicy/Condition/LogMatch.php | 151 +++ .../AlertPolicy/Condition/MetricAbsence.php | 300 +++++ .../AlertPolicy/Condition/MetricThreshold.php | 529 ++++++++ .../MonitoringQueryLanguageCondition.php | 219 +++ .../V3/AlertPolicy/Condition/Trigger.php | 118 ++ .../V3/AlertPolicy/ConditionCombinerType.php | 77 ++ .../V3/AlertPolicy/Documentation.php | 125 ++ .../V3/AlertPolicyServiceGrpcClient.php | 121 ++ .../V3/AlertPolicy_AlertStrategy.php | 16 + ...cy_AlertStrategy_NotificationRateLimit.php | 16 + .../Monitoring/V3/AlertPolicy_Condition.php | 16 + .../V3/AlertPolicy_ConditionCombinerType.php | 16 + .../V3/AlertPolicy_Condition_LogMatch.php | 16 + .../AlertPolicy_Condition_MetricAbsence.php | 16 + .../AlertPolicy_Condition_MetricThreshold.php | 16 + ...ition_MonitoringQueryLanguageCondition.php | 16 + .../V3/AlertPolicy_Condition_Trigger.php | 16 + .../V3/AlertPolicy_Documentation.php | 16 + .../Google/Cloud/Monitoring/V3/BasicSli.php | 269 ++++ .../V3/BasicSli/AvailabilityCriteria.php | 36 + .../V3/BasicSli/LatencyCriteria.php | 84 ++ .../V3/BasicSli_AvailabilityCriteria.php | 16 + .../V3/BasicSli_LatencyCriteria.php | 16 + .../Cloud/Monitoring/V3/ComparisonType.php | 90 ++ .../V3/CreateAlertPolicyRequest.php | 155 +++ .../Monitoring/V3/CreateGroupRequest.php | 157 +++ .../V3/CreateMetricDescriptorRequest.php | 127 ++ .../V3/CreateNotificationChannelRequest.php | 135 ++ .../V3/CreateServiceLevelObjectiveRequest.php | 165 +++ .../Monitoring/V3/CreateServiceRequest.php | 157 +++ .../Monitoring/V3/CreateTimeSeriesError.php | 135 ++ .../Monitoring/V3/CreateTimeSeriesRequest.php | 129 ++ .../Monitoring/V3/CreateTimeSeriesSummary.php | 135 ++ .../V3/CreateTimeSeriesSummary/Error.php | 114 ++ .../V3/CreateTimeSeriesSummary_Error.php | 16 + .../V3/CreateUptimeCheckConfigRequest.php | 119 ++ .../V3/DeleteAlertPolicyRequest.php | 75 ++ .../Monitoring/V3/DeleteGroupRequest.php | 114 ++ .../V3/DeleteMetricDescriptorRequest.php | 79 ++ .../V3/DeleteNotificationChannelRequest.php | 117 ++ .../V3/DeleteServiceLevelObjectiveRequest.php | 71 + .../Monitoring/V3/DeleteServiceRequest.php | 71 + .../V3/DeleteUptimeCheckConfigRequest.php | 71 + .../Cloud/Monitoring/V3/DistributionCut.php | 127 ++ .../Cloud/Monitoring/V3/DroppedLabels.php | 80 ++ .../Monitoring/V3/GetAlertPolicyRequest.php | 71 + .../Cloud/Monitoring/V3/GetGroupRequest.php | 71 + .../V3/GetMetricDescriptorRequest.php | 79 ++ .../GetMonitoredResourceDescriptorRequest.php | 79 ++ ...etNotificationChannelDescriptorRequest.php | 71 + .../V3/GetNotificationChannelRequest.php | 71 + ...ficationChannelVerificationCodeRequest.php | 151 +++ ...icationChannelVerificationCodeResponse.php | 131 ++ .../V3/GetServiceLevelObjectiveRequest.php | 117 ++ .../Cloud/Monitoring/V3/GetServiceRequest.php | 71 + .../V3/GetUptimeCheckConfigRequest.php | 71 + .../src/Google/Cloud/Monitoring/V3/Group.php | 257 ++++ .../Cloud/Monitoring/V3/GroupResourceType.php | 66 + .../Monitoring/V3/GroupServiceGrpcClient.php | 137 ++ .../Cloud/Monitoring/V3/InternalChecker.php | 270 ++++ .../Monitoring/V3/InternalChecker/State.php | 74 ++ .../Monitoring/V3/InternalChecker_State.php | 16 + .../Google/Cloud/Monitoring/V3/LabelValue.php | 141 ++ .../V3/ListAlertPoliciesRequest.php | 267 ++++ .../V3/ListAlertPoliciesResponse.php | 147 +++ .../Monitoring/V3/ListGroupMembersRequest.php | 261 ++++ .../V3/ListGroupMembersResponse.php | 143 ++ .../Cloud/Monitoring/V3/ListGroupsRequest.php | 295 +++++ .../Monitoring/V3/ListGroupsResponse.php | 109 ++ .../V3/ListMetricDescriptorsRequest.php | 209 +++ .../V3/ListMetricDescriptorsResponse.php | 113 ++ ...istMonitoredResourceDescriptorsRequest.php | 201 +++ ...stMonitoredResourceDescriptorsResponse.php | 113 ++ ...tNotificationChannelDescriptorsRequest.php | 183 +++ ...NotificationChannelDescriptorsResponse.php | 117 ++ .../V3/ListNotificationChannelsRequest.php | 279 ++++ .../V3/ListNotificationChannelsResponse.php | 151 +++ .../V3/ListServiceLevelObjectivesRequest.php | 239 ++++ .../V3/ListServiceLevelObjectivesResponse.php | 109 ++ .../Monitoring/V3/ListServicesRequest.php | 261 ++++ .../Monitoring/V3/ListServicesResponse.php | 109 ++ .../Monitoring/V3/ListTimeSeriesRequest.php | 457 +++++++ .../ListTimeSeriesRequest/TimeSeriesView.php | 59 + .../ListTimeSeriesRequest_TimeSeriesView.php | 16 + .../Monitoring/V3/ListTimeSeriesResponse.php | 201 +++ .../V3/ListUptimeCheckConfigsRequest.php | 163 +++ .../V3/ListUptimeCheckConfigsResponse.php | 155 +++ .../V3/ListUptimeCheckIpsRequest.php | 129 ++ .../V3/ListUptimeCheckIpsResponse.php | 125 ++ .../Monitoring/V3/MetricServiceGrpcClient.php | 188 +++ .../Cloud/Monitoring/V3/MutationRecord.php | 111 ++ .../Monitoring/V3/NotificationChannel.php | 586 ++++++++ .../VerificationStatus.php | 76 ++ .../V3/NotificationChannelDescriptor.php | 326 +++++ .../NotificationChannelServiceGrpcClient.php | 217 +++ ...NotificationChannel_VerificationStatus.php | 16 + .../src/Google/Cloud/Monitoring/V3/Point.php | 153 +++ .../Google/Cloud/Monitoring/V3/QueryError.php | 115 ++ .../Cloud/Monitoring/V3/QueryErrorList.php | 105 ++ .../Monitoring/V3/QueryServiceGrpcClient.php | 52 + .../Monitoring/V3/QueryTimeSeriesRequest.php | 193 +++ .../Monitoring/V3/QueryTimeSeriesResponse.php | 195 +++ .../src/Google/Cloud/Monitoring/V3/Range.php | 101 ++ .../Cloud/Monitoring/V3/RequestBasedSli.php | 121 ++ ...ficationChannelVerificationCodeRequest.php | 67 + .../Google/Cloud/Monitoring/V3/Service.php | 420 ++++++ .../Cloud/Monitoring/V3/Service/AppEngine.php | 78 ++ .../Monitoring/V3/Service/CloudEndpoints.php | 78 ++ .../Monitoring/V3/Service/ClusterIstio.php | 198 +++ .../Cloud/Monitoring/V3/Service/Custom.php | 37 + .../V3/Service/IstioCanonicalService.php | 171 +++ .../Cloud/Monitoring/V3/Service/MeshIstio.php | 151 +++ .../Cloud/Monitoring/V3/Service/Telemetry.php | 74 ++ .../Monitoring/V3/ServiceLevelIndicator.php | 153 +++ .../Monitoring/V3/ServiceLevelObjective.php | 338 +++++ .../V3/ServiceLevelObjective/View.php | 71 + .../V3/ServiceLevelObjective_View.php | 16 + .../V3/ServiceMonitoringServiceGrpcClient.php | 188 +++ .../Cloud/Monitoring/V3/ServiceTier.php | 73 + .../Cloud/Monitoring/V3/Service_AppEngine.php | 16 + .../Monitoring/V3/Service_CloudEndpoints.php | 16 + .../Monitoring/V3/Service_ClusterIstio.php | 16 + .../Cloud/Monitoring/V3/Service_Custom.php | 16 + .../V3/Service_IstioCanonicalService.php | 16 + .../Cloud/Monitoring/V3/Service_MeshIstio.php | 16 + .../Cloud/Monitoring/V3/Service_Telemetry.php | 16 + .../Cloud/Monitoring/V3/SpanContext.php | 91 ++ .../Cloud/Monitoring/V3/TextLocator.php | 303 +++++ .../Monitoring/V3/TextLocator/Position.php | 108 ++ .../Monitoring/V3/TextLocator_Position.php | 16 + .../Cloud/Monitoring/V3/TimeInterval.php | 152 +++ .../Google/Cloud/Monitoring/V3/TimeSeries.php | 404 ++++++ .../Cloud/Monitoring/V3/TimeSeriesData.php | 114 ++ .../V3/TimeSeriesData/PointData.php | 116 ++ .../V3/TimeSeriesData_PointData.php | 16 + .../Monitoring/V3/TimeSeriesDescriptor.php | 101 ++ .../TimeSeriesDescriptor/ValueDescriptor.php | 184 +++ .../TimeSeriesDescriptor_ValueDescriptor.php | 16 + .../Cloud/Monitoring/V3/TimeSeriesRatio.php | 180 +++ .../Google/Cloud/Monitoring/V3/TypedValue.php | 213 +++ .../V3/UpdateAlertPolicyRequest.php | 201 +++ .../Monitoring/V3/UpdateGroupRequest.php | 115 ++ .../V3/UpdateNotificationChannelRequest.php | 133 ++ .../V3/UpdateServiceLevelObjectiveRequest.php | 125 ++ .../Monitoring/V3/UpdateServiceRequest.php | 125 ++ .../V3/UpdateUptimeCheckConfigRequest.php | 169 +++ .../Cloud/Monitoring/V3/UptimeCheckConfig.php | 617 +++++++++ .../V3/UptimeCheckConfig/ContentMatcher.php | 116 ++ .../ContentMatcher/ContentMatcherOption.php | 89 ++ .../V3/UptimeCheckConfig/HttpCheck.php | 538 ++++++++ .../HttpCheck/BasicAuthentication.php | 107 ++ .../HttpCheck/ContentType.php | 58 + .../HttpCheck/RequestMethod.php | 64 + .../V3/UptimeCheckConfig/ResourceGroup.php | 113 ++ .../V3/UptimeCheckConfig/TcpCheck.php | 78 ++ .../V3/UptimeCheckConfig_ContentMatcher.php | 16 + ...ig_ContentMatcher_ContentMatcherOption.php | 16 + .../V3/UptimeCheckConfig_HttpCheck.php | 16 + ...ckConfig_HttpCheck_BasicAuthentication.php | 16 + ...ptimeCheckConfig_HttpCheck_ContentType.php | 16 + ...imeCheckConfig_HttpCheck_RequestMethod.php | 16 + .../V3/UptimeCheckConfig_ResourceGroup.php | 16 + .../V3/UptimeCheckConfig_TcpCheck.php | 16 + .../Cloud/Monitoring/V3/UptimeCheckIp.php | 160 +++ .../Cloud/Monitoring/V3/UptimeCheckRegion.php | 78 ++ .../V3/UptimeCheckServiceGrpcClient.php | 138 ++ .../V3/VerifyNotificationChannelRequest.php | 125 ++ .../Cloud/Monitoring/V3/WindowsBasedSli.php | 236 ++++ .../V3/WindowsBasedSli/MetricRange.php | 125 ++ .../WindowsBasedSli/PerformanceThreshold.php | 146 ++ .../V3/WindowsBasedSli_MetricRange.php | 16 + .../WindowsBasedSli_PerformanceThreshold.php | 16 + .../v3/src/V3/AlertPolicyServiceClient.php | 34 + .../Gapic/AlertPolicyServiceGapicClient.php | 671 ++++++++++ .../src/V3/Gapic/GroupServiceGapicClient.php | 757 +++++++++++ .../src/V3/Gapic/MetricServiceGapicClient.php | 1176 +++++++++++++++++ .../NotificationChannelServiceGapicClient.php | 1068 +++++++++++++++ .../src/V3/Gapic/QueryServiceGapicClient.php | 258 ++++ .../ServiceMonitoringServiceGapicClient.php | 1054 +++++++++++++++ .../Gapic/UptimeCheckServiceGapicClient.php | 688 ++++++++++ .../v3/src/V3/GroupServiceClient.php | 34 + .../v3/src/V3/MetricServiceClient.php | 34 + .../V3/NotificationChannelServiceClient.php | 34 + .../v3/src/V3/QueryServiceClient.php | 34 + .../src/V3/ServiceMonitoringServiceClient.php | 34 + .../v3/src/V3/UptimeCheckServiceClient.php | 34 + .../Monitoring/v3/src/V3/gapic_metadata.json | 307 +++++ .../alert_policy_service_client_config.json | 69 + ...alert_policy_service_descriptor_config.php | 18 + ...lert_policy_service_rest_client_config.php | 66 + .../group_service_client_config.json | 86 ++ .../group_service_descriptor_config.php | 28 + .../group_service_rest_client_config.php | 77 ++ .../metric_service_client_config.json | 101 ++ .../metric_service_descriptor_config.php | 38 + .../metric_service_rest_client_config.php | 135 ++ ...ication_channel_service_client_config.json | 94 ++ ...tion_channel_service_descriptor_config.php | 28 + ...ion_channel_service_rest_client_config.php | 124 ++ .../query_service_client_config.json | 27 + .../query_service_descriptor_config.php | 18 + .../query_service_rest_client_config.php | 20 + ...vice_monitoring_service_client_config.json | 94 ++ ...e_monitoring_service_descriptor_config.php | 28 + ..._monitoring_service_rest_client_config.php | 124 ++ .../uptime_check_service_client_config.json | 74 ++ ...uptime_check_service_descriptor_config.php | 28 + ...ptime_check_service_rest_client_config.php | 70 + .../Unit/V3/AlertPolicyServiceClientTest.php | 408 ++++++ .../tests/Unit/V3/GroupServiceClientTest.php | 500 +++++++ .../tests/Unit/V3/MetricServiceClientTest.php | 716 ++++++++++ .../NotificationChannelServiceClientTest.php | 764 +++++++++++ .../tests/Unit/V3/QueryServiceClientTest.php | 145 ++ .../V3/ServiceMonitoringServiceClientTest.php | 749 +++++++++++ .../Unit/V3/UptimeCheckServiceClientTest.php | 482 +++++++ 241 files changed, 35790 insertions(+) create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Alert.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/UptimeService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation_Aligner.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation_Reducer.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicyServiceGrpcClient.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy_NotificationRateLimit.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_ConditionCombinerType.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_LogMatch.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_MetricAbsence.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_MetricThreshold.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_MonitoringQueryLanguageCondition.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_Trigger.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Documentation.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli_AvailabilityCriteria.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli_LatencyCriteria.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary_Error.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupServiceGrpcClient.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker_State.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest_TimeSeriesView.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MetricServiceGrpcClient.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelServiceGrpcClient.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel_VerificationStatus.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryServiceGrpcClient.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective_View.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceMonitoringServiceGrpcClient.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_AppEngine.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_CloudEndpoints.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_ClusterIstio.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_Custom.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_IstioCanonicalService.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_MeshIstio.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_Telemetry.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator_Position.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData_PointData.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor_ValueDescriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher_ContentMatcherOption.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck_BasicAuthentication.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck_ContentType.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck_RequestMethod.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ResourceGroup.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_TcpCheck.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckServiceGrpcClient.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli_MetricRange.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli_PerformanceThreshold.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/MetricServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/NotificationChannelServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/QueryServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/ServiceMonitoringServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/UptimeCheckServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/gapic_metadata.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Alert.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Alert.php new file mode 100644 index 0000000000000000000000000000000000000000..e681f2e916eae3ce2a8adc9123c8930a12da8710 GIT binary patch literal 4452 zcmcgwOK;mo5Vqv_HS#NK8)j4_U=kN`l7>R8wn^wZfnK%+_*K6G1Of<(TG4DNlI6p# zV))uW&_n+~Pd)S(^i-gS_S93)1$y(Z=y3TEmB_K=LwzyD-T8KR=KE%5`Nb>i#De?$ z1~sTHyR^aA+q`>1dCN9kQ!#bE?lqg#<`uJLX*#t9o-gn6JG+N`rCdF{i>8k0*$NeT z)ihO|=31tqxu&fdYVI_jlhMQ#7#M&dx2R*u3gtKUirdtc8?r0cHke&)JGQGG=T`v~ zU3MJ4;M>C)@c3tWbzM_<$CX|Dx1>3ehD&L(uD!*5uklS;cPLuEKey=_imRCh?;GqI z3SEB42blicCCkKfuJO@M_WYycv1?VsrM4mKwK8=STeI+3dpK1TRqDnL^WQ8#443uc zv?jkC>`@fo+vFPW+8#}=&hs{PJ=<7i`}P6O9ra1GPfwrp9{cKSEn zx0KoeZrHoTh7sqE5kTcNmQ zOUv0|1OruN@AlLk$`uj9DUW(iX@#+nY!-}g?wxQhlProL*9bj++4#4iTf_0i(B8I` zoUa1U2?p-{y9gPk<~HG$ZSf@f>PPx?HEa!_D%;i1PGmlp{3SVm1}SwcF$srX|y8 zVA3%Shnr+DkFSO)MK+`g;~1H`hRK#2#j{MWJR86qwZ}{k+ZH8{VT>AbU8fE1Ci6-* zLW)8s6frd&%eqI&5{#c>p2VHEIl^X>Xf_5)2uMzD!-8SDT2oV)#w6uLHVofk(|FPe zvIaAXO@pC;GaN9ir3kBwv_iMoee-uH$7KdE-+*aWOeDwk3zgdD7MOJ(WMITN2+gv2 znCfQ742)q^T_jmZ#+xwF(ppq<(a#)XV)pMTnCOHt;_f8w;C=4;ft?_4U@qp0-WZ_V!qk!SQMWR!Un_4kL)oA#wz>9c;Po_*?h)nOS);IB>zYS15yB=)ksQ zS2>{#NjFt)o?(AF2=Z) zbu9q>F7Vt>RxL}mHODl#8wfnTa*0wgv4rzjYFUJtn6MJ&4UcjoXr98HGai)#mcBA8 zx1xi_Nhhk%qzq%oTi^5C7z=Gan%kWwdXqj3TK2CLOa*}md720VD;>SVFw(D=l1B<8 z)ZdYYuYaUpQ!pOMqxWePm}R9(qTgZGQji}Ga?USW)j@n1Eh4ZQR*A7#G0T1q^S$1a z3=Drw+hHo4f{}m#EDeh3=c(*ZDd4XX9zi=M?-1ty_pHb@J( zv*gd~A(oq1Kd^tzodplqLrFa zunSSxNi-Gvh_>Z}ktYDM=bDnDn-1jyJzcK7Y!McE<2-~>%;K6E)z%MSJcXHeTe>UQ zeouylm>gaG*CNc7cDIYwor-j{bFfz_RoAPP^6U^9gWi9>`DIoFo(#K zfhb3iTfe1%Lv8hBND%_X`Pb{c)SH)K6R(WUDM>ia{}~O|YHYNY{JenQ7cSDb17lHS2^; literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php new file mode 100644 index 00000000000..b5ca2fc73a9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php @@ -0,0 +1,64 @@ +internalAddGeneratedFile( + ' +ç +(google/monitoring/v3/alert_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto google/monitoring/v3/alert.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"• +CreateAlertPolicyRequest; +name ( B-àAúA\'%monitoring.googleapis.com/AlertPolicy< + alert_policy ( 2!.google.monitoring.v3.AlertPolicyBàA"T +GetAlertPolicyRequest; +name ( B-àAúA\' +%monitoring.googleapis.com/AlertPolicy"  +ListAlertPoliciesRequest; +name ( B-àAúA\'%monitoring.googleapis.com/AlertPolicy +filter (  +order_by (  + page_size ( + +page_token ( "ƒ +ListAlertPoliciesResponse9 +alert_policies ( 2!.google.monitoring.v3.AlertPolicy +next_page_token (  + +total_size ("‰ +UpdateAlertPolicyRequest/ + update_mask ( 2.google.protobuf.FieldMask< + alert_policy ( 2!.google.monitoring.v3.AlertPolicyBàA"W +DeleteAlertPolicyRequest; +name ( B-àAúA\' +%monitoring.googleapis.com/AlertPolicy2ž +AlertPolicyService¨ +ListAlertPolicies..google.monitoring.v3.ListAlertPoliciesRequest/.google.monitoring.v3.ListAlertPoliciesResponse"2‚Óä“%#/v3/{name=projects/*}/alertPoliciesÚAname– +GetAlertPolicy+.google.monitoring.v3.GetAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"4‚Óä“\'%/v3/{name=projects/*/alertPolicies/*}ÚAnameµ +CreateAlertPolicy..google.monitoring.v3.CreateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"M‚Óä“3"#/v3/{name=projects/*}/alertPolicies: alert_policyÚAname,alert_policy‘ +DeleteAlertPolicy..google.monitoring.v3.DeleteAlertPolicyRequest.google.protobuf.Empty"4‚Óä“\'*%/v3/{name=projects/*/alertPolicies/*}ÚAnameË +UpdateAlertPolicy..google.monitoring.v3.UpdateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"c‚Óä“B22/v3/{alert_policy.name=projects/*/alertPolicies/*}: alert_policyÚAupdate_mask,alert_policy©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÉ +com.google.monitoring.v3BAlertServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..57253ec061b46a8802a4af348013c122a6e1b60f GIT binary patch literal 2529 zcmbVO*>2lL6tyI;BQG@LB&yJ5;s%Huq*P$l0YcX)XlX1HkSJB6g`f~XP~?aqK$8R) z18(6j=m+$z9}u7q{f55vQ~DLXTqIJCk{0!gJm>D`-WlHSzIWfb=xf}jHucni>UeUC zgLf3Wo)b8lW8q0Sol*~L&b4b=)Z;L2^{~{FF=>hN6EO9i(9?%Z%ZYMdgZS*q{jX6yj{j4=GU z;lwgE><4N9KTl0xF(H_#TINrX`5B(7mQTU-L)~d;Yk}$5I5Ozj8m%4S#Al@Y)ODcJ zGdxSB9~BRUk3~D6o~>Hr7WFmHbfK_5sPeo)gE?gpQaeh+M()fht|dA0{0B*%;lK-N zK03x84MNX8jq{Ei+|Berof|qB@_UUw6@ye;pk5AW`A6+2U>*)h|=Sc(|Zjbv>;r z8Mo?J_vOJX^+e(DeE}i))}{JLwL;1sAT)tiDmT%oQox1U=H&|e5S5{rSKp>^5#SQQ zkI=U6z&O$rF9BXi@TfDkk>aa>Zvp-av3jm&sdNpb<>LyM)~C8Am+$Q5%J~Lbi}N|O z&~`+9JduE~FVH5nbtS5)5+zkWuFl-d2;t_vVmXAMXR2B@wqeeU@ zYy&ZH%MAOP+JWLy&vf*dq4M!(A4HuE7fTQes)`Tl)K_AA>cz?K9v{uj7JAC%Vsb(h zka}zz9cZ58`!h!#)k6&&Mb!Q$M}x$GeT?=D&k0>+a;r>DYUzGu4VP+Lhrg82#w^+{ zLPAGuON!K!2(!ZO0TJ=JMLM#;6xg}KK#&PjgaO%46huiTgMP0Q!6ld`CiO$!%1W=( zA_HcX-9cLk+7%@R<&MHzrkuI%5ax*?qK=%2U$TA{tXD;dwnGERQ6-Y`~>w7vO}*y{MKHUu1GKCt0L&>m!mA z7>dkW&IZUVFP8wD+s}V1pk4S>x~gaTjvYN}Y!y9f_PTvxAP%9kSJJRgn&O2>S}@c= zLQd9}VXW^#(PS?|9U0iX2a$x(oGE?n{cN;N0lKNj6`Ux zERw;!^nm9D>A5fzn~);&Uzw(x7c4?W=^xG>V2`=j<*)BX*r?JWxESEYWy`5j>oZdoL_BV vxB0vHMPkhJv7F~KbDkeHChKt?jc4<3<%?uz$gLP3T`ywIWDB@McL@Chz@p&O literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php new file mode 100644 index 00000000000..7e7a042ea75 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' +” +)google/monitoring/v3/dropped_labels.protogoogle.monitoring.v3"| + DroppedLabels= +label ( 2..google.monitoring.v3.DroppedLabels.LabelEntry, + +LabelEntry +key (  +value ( :8BÊ +com.google.monitoring.v3BDroppedLabelsProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php new file mode 100644 index 00000000000..e3e95437843 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' +ˆ + google/monitoring/v3/group.protogoogle.monitoring.v3"€ +Group +name (  + display_name (  + parent_name (  +filter (  + +is_cluster (:™êA• +monitoring.googleapis.com/Group!projects/{project}/groups/{group}+organizations/{organization}/groups/{group}folders/{folder}/groups/{group}*B +com.google.monitoring.v3B +GroupProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php new file mode 100644 index 0000000000000000000000000000000000000000..d1d73f8f1d70065325437a917d7875e7194675c7 GIT binary patch literal 3720 zcmb_f&u<$=6vj@IIuoE|)DqXF?Zi!q8DjTeb4Xs z;1;T37Y7E#7HS?N+QG;VJnEUAgPOfo3kS&by1wn;KtX7C4}GwAfbQ=;I#_0|#Onnn z)==B?+74E`o@-Mtu-&%WFRSgq>-i0WgT8HIMFa)FHM*GihKW&azgoxCuncPGHQ}$< zV}Jdyyaj;i7=)l2kMm&|20Q_X{rSD7W1EOjgR-9$n>1{;vu!x`S1gTf)G{1`S%9;) zt)6RA+j9|j*mF%>x`V=)+;+wHSlZht0<_O7!K$D?aw!g6!_jv!F$3FYS?)7aO>1Ks z*N=ZG-I3e!aCQroLX4Vr2IMxPK@X>QM<~Fw7r0vjHxFZ^ZMvj0|= z;mrhx5(Z@@AqvBz3V&Dui)P1mtN^!CGnZMV7LZm!#ZTpOle{BnylO)$CR*sOW=}=zod=SCZc-9hu~6;NhYu7=^llp ziF!1)#Kor>0Cxh+POhQh!Wu>4#+|cm%J2SNiP4VFws)c&>At=LzJB zx(?t+KL0uZ>;DS>DS*4!!Kb1}JfE_LkWnMRW-lOiALn_+a>d^=U@7i?9e0~J7&A^| zTgA6Y7|1c6W}s*md^KXAVCg)38{~vKvN8*fE^HQulkULoVsS(>%ik*Rkro6ZzHb?Nru+8P(3`Mm44;iqK8dx|Y%aqAPDBck$ZWqrjffj1li;B2` zuD7`W!5ZGKnC)9yK&N z9u;x-h?=xEVUvE&fY)L|%JGLAQS1@K9h8ZJGO4*F@m*1{5`6P~9;tG4C7%kvWS&*7 zrVtIDq&|M#Ap6oS+sltvZtNKR< z|hbI|n z8+)56hvjF{qOOZoJ^l1zZ?Au{*F$Gb6YH8*k1vv%c35uC2^{6s_>Q_BzGhO7pOFtA NVHrM9PQVEO{{e**?2Z5c literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php new file mode 100644 index 0000000000000000000000000000000000000000..af2fd6043edc140b45ec7f9647d667b7f4903583 GIT binary patch literal 2818 zcmbtW-EJCJ5DqxlFt}J*xh|qgbxhKl^k=CcN|kk-HiXoP64#`qzKB*r%kF`!vh1$T z?pkpx-}bW4(5qhbHG0>J_C5L(o%6E`BoJej8{nMz=I5I^Gjs3j@MQ=$$RYJ9vtsIy z;TefvQWCNt4(z}q!(=p~jM%{>bUn&+Lb}J~yW>82)P2(5MQ9Wx%%%nz2f^5*%}L<9 zall-E+&pbJCp2cRtqW}czBQpyXxWq;_Buy2wj3+A%tHY*k20Wn(%uKKJu8X`N}&Sy z83=yDWazmziDE0pubXZ(aM74+dG1f>`2iVOUPKZ4w(KbJ?br=`!U4y=O&hm})X8OU zh5<%;KvGwFJa`P;eB#HH`IcvPX=F1u#K3weY8Yc0XO!`i#w}%*t8+)BA$>HAx12m6 zF-z#IbwU`86Xx#=zqx|*?3cNKs0X2IcHIbh874d?!9|jXFsnv~Vx$7oa&`aqNDgWZWs}lUcak6}Vi*??}GQjh(2fuE? z?u7-eZA%e-`UdpVc5O!itI%4w$d{9=D?yCO6WqBtwrW_5!_U5?e`pPy>X_MVeJ(?6Ui^V!5^=v zN^4dA{%7h^MtRao^05v)&Wplq82P)PQHF2i6|>m z-Nj$E*H999=YO;>VSN=Bcu~nGr`?73VtjEpCvlJ=Rz0E>o_GBPz)URL07IN}17Tm} ztoZnf_CAzR^PSu3n5S(Gk9S~`k0*bu&iP|1J-*V}P#vTG9N>9E+1Vq;0;aWK!wYN+ zhpXxYyGux-uj6M@P}_nH+$ADwEZa}1{#zc({TYD@tjocp3akSaoXIR6gh7NmL*Oea zKE2QuWiW_TwP^@+OLoY}i{U}@R^po~q>7{9kTXS~z!{zVa{B;R73~_H5 jQ@CNAw1?}$kM>?Rq(7HS)yxjIbpH~Pa!opibAbN9od*lm}08cb7$0K zrn~8f6j`MW3l^-XVnJ9zQLLzf9R)@41E>_m0ydOZEVA;7H4BP!AN`!3kw)N+M}5yZ z_k7=Z+|#%3f7RJ@&<%NuSj5$R(vo)%Wq*&zj%)k2VRz--pxq{}Y}h@=>=L&k%Nvj7 zZ$5q|Z*IK*>^i7=cHkOBl{>cG>5^*CwoKo4O{-JguUC7-cTJ<|5qIA-NQGHN$kKbn zb995qTTj-uiLbYGUvF$N1C8y-K;wCR86l&qd!7tZVCX5ggN~34|D0gAYZ|iW>puK< z)AX7q>}~2@^92A|k=uILBVeIlwjEf8Z`zhj6&_m#SzMC2O)7iSu>tss9D4MGasfOv z-nV?>T6(v!K|I4X9l-enL{+sz{D?vNWN}GsOU;>Wd6E05s(ntb$i5qp_)MM3jXVnz7qqSO5sXT;^vKS>dP4xxz%PLwrb1T8GbI}U0EV@o* zzdnCO7|NL58@^zscL!k{6`Yt>eDw6W^En$UqTIgBTmdFKR;*IP&q0ttLA$r#_sE8VkbT3OHOD=Ia&onngbGn+b22(~6I7ZINNzWvQdUBI?lj zs8fC_p*I-^ERS;n^&l0f8Vghzmxcr?W9hunanZE_j){nT1!11mIq`Ti6^^V&17q-A zG*4rYkq?Ovso=y5D$od2C_k6bwRM-k3^mdoBhh^yUF@TU)kUE;l$Es$5L-n@*EUF( zjOgGeRPx=bVc%Rl3VNsGk`6m0S)VG@uIFoOu^@hcE_=kVt(NW{Hj@?# z0P0K@X3>=Gwusx@JuFUACh#^I-#5uY@fG-Mrl#gQkxMB9#z}q-7C5w2dz=EB+4eY1 zcU2k-XeK6@s^cj%{_tCm9?gCM7tkwT+tfBTcb?8l%C96em)%|z>0MOtfm=Gs zl=Bh9o8dtfipyx0d_s(XPA*O2y0+^zVheqLGs_V(a8j3(f5eqV>JzRjCpk`R9<#3(B-UW zn-m;maE3pcM5h}aD@ynsG|A6rQT;gtt%02Kj~rT_2E866FusZ|`tZ`wZ8|m-Qq!;l z%ZDJ+lz9VP@&dyko|jsrhuH*PN0X`G)WhJU%PxyqY+GU2=O3U6PJ$94pOsU@}ueTMB{^7?N6_vSNX{(UgGiR5|Zg2+e2nb zypj+8G(A!K^Q-4o=Mh%4AN>9EpNxG8*XS&MM910{n5=0}@T#Tb@UkO*H;n`8ooH+f z#($B}Tf?V6yqxdlaIFyHndehwgMoojJP*uJEY(u!IK=Y@iJ$S=F~`HTd>AZNnYk;R z3+4xOj{!O&D(^8MOSrL+hXlfs-7WO}7ZSRZGX>&z^F7ZI4Ot&LZz=bfgD^|y`Pc7W zlHNbVftx=^;sIRcOP|fr?=VO2!$6SdX%3TW{{(uX&C$Xr_l>3)=$^|TIR|0MmkzPa zg<%TcZY%7rBBZ-?4!Zv%p&6QNaZkp#!(Gw`T3RY}seCqJk+?sW7~d9_^XaB103Yc- zYAoPev5@U{bjy6fulQ)^Nl0GDZ^wddy9@IrYfiDqiFTDmh`&jf!@0RkCr|t{3C(5? zYkVgkR#q-#VNhUJ8QfdSsc==PbfV2NC#lAZd*vf8d%vS^MD>D#CqDZfdOI)Zq?;vu{6+DLvnfNuvc$F6Z@ zRb}g{x*gpTsw%8&|B^;|yT!{;me0M0b uaZk&rE%mWBNOX4+-0|)DLUemy<{z>W-@WJ?s%hkW^J0?x+te{SM(DqUU-yIn literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php new file mode 100644 index 00000000000..605c2f19932 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' +ï +*google/monitoring/v3/mutation_record.protogoogle.monitoring.v3"U +MutationRecord/ + mutate_time ( 2.google.protobuf.Timestamp + +mutated_by ( BË +com.google.monitoring.v3BMutationRecordProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php new file mode 100644 index 0000000000000000000000000000000000000000..dc1082ca1ed5b54f14dbd455a679447889d93041 GIT binary patch literal 2852 zcmbVO(N5z=6s-dbyAu|+W~I8RXa^RFEL$8kQPtK!s*nVVR6+zHt5%kxi8Be)8jm%$ zQ?V$2(n@{lOFy9h(0&S^(1)tmV<&MSbkogK?78R8opa9_-@UKhOBcPsN7SK$__TxD z*VwdjKB^y_P@i;&Ps}3;H%~@zvsu_h$g+v&;aVaM zxUsEe0DiVzW1JihbNAwnrhs{n&2cSYbUl1e`h+&A!A@&Mz~1L5q-y2Av6(LZwvT_u;9-;y?kGRCJFgCB+f2bbqQ>CyiOJfm^DXWnk2 zp=Oz1fk0;8a}s?Lgx%)O8MV0R%${Y`!`FhiE*0K%sBHaCk;RQJbvmQI9)k9>qfUf< z*+RdpAaiR*)vM2=KpjpW+e7acGHWrMxGZOruqQ1LOOHlY$$Xet7BTbj()!em!KJW4 z9I`z%Rq(1IQ6+0*9nTsEEmNRKMhfg)Wh zJ+WsIt$2a!asd}t%V*G7?Gd1s^Xo&@1l{^M6@6yW21FjDG)3J(OG(zXMJQo8|G^L( zZ8>(zuc_P8&nfgpB570{1bRAfpZjl$4uRbtsO5XPoA}>g;)1+KDg;^)(XAmi|(xvm6VY;DJ^#l0kG>IKhbsw!*f=XG$ z_STjpXmbdf|~J&HYHP<164PdejeV)TH-~)R#); zGqiG-$hSZ?UL$o1M=#JP&Fb0l;c>atI6kel&Ksr1#d+(Zc3!WR;dQn0>^*fEp^I7+ z2G0s8^6}^?W&ESumi|`IPJ*AeTU#y8W@xaLlNexHv8M;>H%aHtV&n%i?agA~2hqy* z!Ji7!;0BwjlY{q@hN_1HQC<1I7+=giZWE`c!%=cQ>PS`Q#@tQLgS%sXe@|tO(XXqs}>OwNTc7~ZDVBCuh|b;B6L4Wn6TFUUFyTcc0*r_rdDn9M?x RGHc3ICL^O6YJdg^{R>8)zxx0H literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php new file mode 100644 index 00000000000..c99cbe7ef68 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php @@ -0,0 +1,98 @@ +internalAddGeneratedFile( + ' +×% +/google/monitoring/v3/notification_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto\'google/monitoring/v3/notification.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"¡ +)ListNotificationChannelDescriptorsRequestM +name ( B?àAúA97monitoring.googleapis.com/NotificationChannelDescriptor + page_size ( + +page_token ( "— +*ListNotificationChannelDescriptorsResponseP +channel_descriptors ( 23.google.monitoring.v3.NotificationChannelDescriptor +next_page_token ( "x +\'GetNotificationChannelDescriptorRequestM +name ( B?àAúA9 +7monitoring.googleapis.com/NotificationChannelDescriptor"µ + CreateNotificationChannelRequestC +name ( B5àAúA/-monitoring.googleapis.com/NotificationChannelL +notification_channel ( 2).google.monitoring.v3.NotificationChannelBàA"¯ +ListNotificationChannelsRequestC +name ( B5àAúA/-monitoring.googleapis.com/NotificationChannel +filter (  +order_by (  + page_size ( + +page_token ( "™ + ListNotificationChannelsResponseH +notification_channels ( 2).google.monitoring.v3.NotificationChannel +next_page_token (  + +total_size ("d +GetNotificationChannelRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel"¡ + UpdateNotificationChannelRequest/ + update_mask ( 2.google.protobuf.FieldMaskL +notification_channel ( 2).google.monitoring.v3.NotificationChannelBàA"v + DeleteNotificationChannelRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel +force ("u +.SendNotificationChannelVerificationCodeRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel"¥ +-GetNotificationChannelVerificationCodeRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel/ + expire_time ( 2.google.protobuf.Timestamp"o +.GetNotificationChannelVerificationCodeResponse +code ( / + expire_time ( 2.google.protobuf.Timestamp"z + VerifyNotificationChannelRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel +code ( BàA2ê +NotificationChannelServiceì +"ListNotificationChannelDescriptors?.google.monitoring.v3.ListNotificationChannelDescriptorsRequest@.google.monitoring.v3.ListNotificationChannelDescriptorsResponse"C‚Óä“64/v3/{name=projects/*}/notificationChannelDescriptorsÚAnameÝ + GetNotificationChannelDescriptor=.google.monitoring.v3.GetNotificationChannelDescriptorRequest3.google.monitoring.v3.NotificationChannelDescriptor"E‚Óä“86/v3/{name=projects/*/notificationChannelDescriptors/*}ÚAnameÄ +ListNotificationChannels5.google.monitoring.v3.ListNotificationChannelsRequest6.google.monitoring.v3.ListNotificationChannelsResponse"9‚Óä“,*/v3/{name=projects/*}/notificationChannelsÚAnameµ +GetNotificationChannel3.google.monitoring.v3.GetNotificationChannelRequest).google.monitoring.v3.NotificationChannel";‚Óä“.,/v3/{name=projects/*/notificationChannels/*}ÚAnameä +CreateNotificationChannel6.google.monitoring.v3.CreateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"d‚Óä“B"*/v3/{name=projects/*}/notificationChannels:notification_channelÚAname,notification_channelƒ +UpdateNotificationChannel6.google.monitoring.v3.UpdateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"‚‚Óä“Y2A/v3/{notification_channel.name=projects/*/notificationChannels/*}:notification_channelÚA update_mask,notification_channel® +DeleteNotificationChannel6.google.monitoring.v3.DeleteNotificationChannelRequest.google.protobuf.Empty"A‚Óä“.*,/v3/{name=projects/*/notificationChannels/*}ÚA +name,forceÜ +\'SendNotificationChannelVerificationCodeD.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.google.protobuf.Empty"S‚Óä“F"A/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode:*ÚAname‡ +&GetNotificationChannelVerificationCodeC.google.monitoring.v3.GetNotificationChannelVerificationCodeRequestD.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse"R‚Óä“E"@/v3/{name=projects/*/notificationChannels/*}:getVerificationCode:*ÚAnameÊ +VerifyNotificationChannel6.google.monitoring.v3.VerifyNotificationChannelRequest).google.monitoring.v3.NotificationChannel"J‚Óä“8"3/v3/{name=projects/*/notificationChannels/*}:verify:*ÚA name,code©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÐ +com.google.monitoring.v3BNotificationServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php new file mode 100644 index 00000000000..fbd9c9ead5a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' +ô +(google/monitoring/v3/query_service.protogoogle.monitoring.v3google/api/label.proto!google/monitoring/v3/metric.proto)google/monitoring/v3/metric_service.protogoogle/api/client.proto2Þ + QueryService¡ +QueryTimeSeries,.google.monitoring.v3.QueryTimeSeriesRequest-.google.monitoring.v3.QueryTimeSeriesResponse"1‚Óä“+"&/v3/{name=projects/*}/timeSeries:query:*©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÉ +com.google.monitoring.v3BQueryServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php new file mode 100644 index 0000000000000000000000000000000000000000..4aef5a25c910eb09570d9548699de28059943c14 GIT binary patch literal 4829 zcmbVQOLNm!6hFA@T@k80?Q`aX05zUV#~2&tG>yR_3bXQzFWEtV7pcn zX-|a)cnuo<3zCLQZ7qte82`IMBa`BB)N<)7wEeEuwA_dw_ONU-@$8uTp2h%=J)5k2 zq6wW$_DbNRuXnZ7mKt*(U9VTYn1r6?*4Ig7hcrOfYA9+LEfRNw#-6NvB9CS2Xj5Ae zHX6nuBkyW)n2`R{H7z7@5_-3}-Autj_pkbhNUa65{(utKDU&^`L;cV&dS3OE90h$s zWX{G$b;GfqAWJZc;~&_C?oiBqY_)^&u{-+#saGtQc#aj;NJxEWG?=IF#yu*NwdOe8 z+&nFOgP2i=m99;CKF_e8t(0>?t}jT=M;; z;rDSG6DhDP1!8o(XiLY$*4;(>(D50t$mX}o#0Pz z!L*%3vER;3J={g@Pv97zzPDBcrEIY+$oN&Up*eY76cny9`T#7 zV7q?epav)KF*8wahAX*#yp9S3ZKN1fRDn6$MXN|?(g?Yi%WyT<-lc{^sth5#LH6xQ z4KS8B+XzVUyKs&lZrYZIZ3?J^(}6PL6}9Pa1l#xiRs zl~>DW@v=&%W&Zk2M$?{1{@NSrWYX7%itN9OIwJj zSrNyZurQP-H47)dBl|Lnb1>Dh+=S$Ki5nAND8_Hf+qGX6SnlgpqRz2RMLJIJ;!`n5 z)sL||eM{^(D!!I~9i(F#AIV@Js6{_)Sss1GvxhJGe~tuPZu+i6LKGE$j1*F?m1hB{ zL%f(aDG3WdO~V;!*%s*#_i=;SMmyvk&5c!EM%{vQDLY(-#%;jC;>01%>62ak^w?_P zCstDkJF(?kE>D!AmS8^gT^AP_*?@CXygtvTD$_2nr$Z6z`4)D)!M4rY?)>V76vbM* zJ~-15R~szlSzgMwQ%qk{JEgQ$4~9!0B251MIaK%@CU+@$iGyTux4QAQ`Rvit+D4`N zpt`ZXctV|l$p_E2wiYKaPBRdvBKyqS2r_SXdTEq>DMVdf1QtnQA*!<3qX z;2u#;m*?G2X>*{y=x6E}#C`u0cE(`(`)gIMX-XN}v6%LSf0e<)=+U$UnT8cn+l*Yw zxtd+QIGQPCCic{&NU(dX(|n)c24*6dh^C%h{dhF+i4a9Rak}`ISX}T}%d6>q@x92;!U!25p?w=Pk{0WYj4)zq>IC1PVkuPD^>R1#< z9(8HF&pTjt^@!=49;C1JK`J4|U4mK|lr=cz;zy5X@5^?fj}Avy&z6wxsmPy&rBTZB z_hDg3SiO$3eh=II9`;Fj-qF3JJP)&&UlYGMxV434n0jJ)Ey5;2n|gc_DEx=@1CN4I z_(g$*q0FI+i#P`yGxlTLS@`nKp+}~Ut?Ag1DT$u2*3YA~hG(0!^uxA=-?2L>r|^WYU`Za`CYFcO5HrqP6085s@pNx< zQ*`|E2LWm=moeovUo8%dQ?>3;913SQ_QAdIz%DF4IUHPwb(} zK-ccWnMT@3nJryCZ1o(csp6JAm_H@$bGV^q`{JmchAjKmV?4&nl51R-aUuZ6F|Mq_ zq70hs2)vR>zJ>;1Pnc&+nx;v)ez4F29QdT_(o gEj6aO9i^+?FZS!=wxsWJ<;aT_E-9`*4&VUbKM24fmjD0& literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php new file mode 100644 index 00000000000..f1b7d60262f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php @@ -0,0 +1,95 @@ +internalAddGeneratedFile( + ' +ð +*google/monitoring/v3/service_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"google/monitoring/v3/service.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"š +CreateServiceRequest9 +parent ( B)àAúA#!monitoring.googleapis.com/Service + +service_id ( 3 +service ( 2.google.monitoring.v3.ServiceBàA"L +GetServiceRequest7 +name ( B)àAúA# +!monitoring.googleapis.com/Service"‡ +ListServicesRequest9 +parent ( B)àAúA#!monitoring.googleapis.com/Service +filter (  + page_size ( + +page_token ( "` +ListServicesResponse/ +services ( 2.google.monitoring.v3.Service +next_page_token ( "| +UpdateServiceRequest3 +service ( 2.google.monitoring.v3.ServiceBàA/ + update_mask ( 2.google.protobuf.FieldMask"O +DeleteServiceRequest7 +name ( B)àAúA# +!monitoring.googleapis.com/Service"Ö +"CreateServiceLevelObjectiveRequest9 +parent ( B)àAúA# +!monitoring.googleapis.com/Service" +service_level_objective_id ( Q +service_level_objective ( 2+.google.monitoring.v3.ServiceLevelObjectiveBàA"¨ +GetServiceLevelObjectiveRequestE +name ( B7àAúA1 +/monitoring.googleapis.com/ServiceLevelObjective> +view (20.google.monitoring.v3.ServiceLevelObjective.View"Õ +!ListServiceLevelObjectivesRequest9 +parent ( B)àAúA# +!monitoring.googleapis.com/Service +filter (  + page_size ( + +page_token ( > +view (20.google.monitoring.v3.ServiceLevelObjective.View"Œ +"ListServiceLevelObjectivesResponseM +service_level_objectives ( 2+.google.monitoring.v3.ServiceLevelObjective +next_page_token ( "¨ +"UpdateServiceLevelObjectiveRequestQ +service_level_objective ( 2+.google.monitoring.v3.ServiceLevelObjectiveBàA/ + update_mask ( 2.google.protobuf.FieldMask"k +"DeleteServiceLevelObjectiveRequestE +name ( B7àAúA1 +/monitoring.googleapis.com/ServiceLevelObjective2ê +ServiceMonitoringService— + CreateService*.google.monitoring.v3.CreateServiceRequest.google.monitoring.v3.Service";‚Óä“$"/v3/{parent=*/*}/services:serviceÚAparent,service~ + +GetService\'.google.monitoring.v3.GetServiceRequest.google.monitoring.v3.Service"(‚Óä“/v3/{name=*/*/services/*}ÚAname‘ + ListServices).google.monitoring.v3.ListServicesRequest*.google.monitoring.v3.ListServicesResponse"*‚Óä“/v3/{parent=*/*}/servicesÚAparent˜ + UpdateService*.google.monitoring.v3.UpdateServiceRequest.google.monitoring.v3.Service"<‚Óä“,2!/v3/{service.name=*/*/services/*}:serviceÚAservice} + DeleteService*.google.monitoring.v3.DeleteServiceRequest.google.protobuf.Empty"(‚Óä“*/v3/{name=*/*/services/*}ÚAnameú +CreateServiceLevelObjective8.google.monitoring.v3.CreateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"t‚Óä“M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:service_level_objectiveÚAparent,service_level_objectiveÁ +GetServiceLevelObjective5.google.monitoring.v3.GetServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"A‚Óä“42/v3/{name=*/*/services/*/serviceLevelObjectives/*}ÚAnameÔ +ListServiceLevelObjectives7.google.monitoring.v3.ListServiceLevelObjectivesRequest8.google.monitoring.v3.ListServiceLevelObjectivesResponse"C‚Óä“42/v3/{parent=*/*/services/*}/serviceLevelObjectivesÚAparentŒ +UpdateServiceLevelObjective8.google.monitoring.v3.UpdateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"…‚Óä“e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:service_level_objectiveÚAservice_level_objective² +DeleteServiceLevelObjective8.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.google.protobuf.Empty"A‚Óä“4*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}ÚAname©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÕ +com.google.monitoring.v3BServiceMonitoringServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php new file mode 100644 index 00000000000..959e03af5ad --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' +´ +\'google/monitoring/v3/span_context.protogoogle.monitoring.v3" + SpanContext + span_name ( BÈ +com.google.monitoring.v3BSpanContextProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php new file mode 100644 index 0000000000000000000000000000000000000000..21923666291b47451344a8584380eb32b4275512 GIT binary patch literal 3626 zcmb7HTXWh*6b|?T9DKowlVE1jQE1vYPAgj6TjV+!0Sabn0|RoBw#;Z`X#v$(Qgunk z$@p({`V%_+8-444=xZPH(uY3wrDseYy+yQYJVwehGZ4v0Sv8C_X_7+p)%nSFje zv{4i<7`e^+Za~i7&hswu1J~MOc2fl><6pfgfs!0E4i+&wB#OUy>e;EH%fzoQH4aHF zK%8JC#iLF0DYS%Fn}xMVP;<z)CVS3I;J673h zlC3U7$|C+xwtJYLVGB7(4|GR;ZCfNi%U15dvO|cg;?+M8-B(Q`KhHKqn4_2=`4oOG zl^+SyoD$AiC3LAsaTDg)4{jN<`^|1!t~Q=E>$wD%g;Zz1*`yyy zF_}*k|6PWakU`ANs%`bn!IfOy0xk+SG1NG`%vrdIkVI5%T`;My9WaZ~Dg4yz?S5>xylFa>`1Sdnr$ApD? zXkxPEPp+y*(Z^~Y!n{LV(>7Q(v*oo|M~pZjrU|zJDOv*Uz|W`IegAW|4LRLL>R7&d zr1@y1>*X{23>x`Ge8IaShbgA=d!aZdLCzy11R~4g0D0@>0W~g_dk@~JvO}lg_D~K+x1}ibq!-!IQmzcdDOjmvm-c(CLgT;w-bCgsx@02?s8=t`97*GDO zL-Lf4m%G4F6YEs)eBswQ$c$mYy`b>?F(4j>nfOD@BF)TF`RR0{FT!)I3W3V>U@t>8 zNY7N@5!LfX%JsX~q?Jl_-i7oM%&f8@N4L*=g0($wHihnYyfC4Nk*syVX^4$>L{_ zo%AfHeA|}K$ab3cn;_=^VWga8U{(7kWKNMWrJm z$v0Qc$E0du^0S3wm~9n*PQdE44emoIR$EO)ZYt`Yq*Qn0j@oJ~jaKuVyEkE(o|78Q zuG&>PVcWU`H*ug;&u=8T6<7?lb=8hsmtW>)xLdG7&rUASivJ|uN`EKd(V6lX_E&6C zo`Az^=>m(nt*A$Pr8m*9lTyIOP1Y^YPi&UB8LovDPSx4!2`Ag`K(ox(jB$AA?B_Mq zJnq{g%F)uB@W(Yo6B`wPbX*rJtH80YhRr%GZIqKm3l`5f-f*}tVcunBodM?Z8hS=5 zY6D27ksVf;sGe~ErlV?xfkt@YM6^LB298J+NrU;jhz2Chepf=$0L;t#omN}Uv7~of z`^t_g?a7@+Rl=m_U_t6OB(*Kk!Ka#=-S{3>E>wB$F06HAl?nyMp4eXI-4FrTi zX+SJC29!<_IQc5tIz{Pk$wHkye}wAD4vcu3!q=1VeDjZZv)5z0y?E@$?H)do-X`yc s!lKCbMR9NZh7!f+n+NmEj?D+-sr#ew@p0y@a_KvToeWinternalAddGeneratedFile( + ' +Ê +)google/monitoring/v3/uptime_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.proto!google/monitoring/v3/uptime.protogoogle/protobuf/duration.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"‹ +ListUptimeCheckConfigsRequestC +parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfig + page_size ( + +page_token ( "” +ListUptimeCheckConfigsResponseE +uptime_check_configs ( 2\'.google.monitoring.v3.UptimeCheckConfig +next_page_token (  + +total_size ("` +GetUptimeCheckConfigRequestA +name ( B3àAúA- ++monitoring.googleapis.com/UptimeCheckConfig"° +CreateUptimeCheckConfigRequestC +parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfigI +uptime_check_config ( 2\'.google.monitoring.v3.UptimeCheckConfigBàA"œ +UpdateUptimeCheckConfigRequest/ + update_mask ( 2.google.protobuf.FieldMaskI +uptime_check_config ( 2\'.google.monitoring.v3.UptimeCheckConfigBàA"c +DeleteUptimeCheckConfigRequestA +name ( B3àAúA- ++monitoring.googleapis.com/UptimeCheckConfig"B +ListUptimeCheckIpsRequest + page_size ( + +page_token ( "t +ListUptimeCheckIpsResponse= +uptime_check_ips ( 2#.google.monitoring.v3.UptimeCheckIp +next_page_token ( 2½ + +UptimeCheckServiceÀ +ListUptimeCheckConfigs3.google.monitoring.v3.ListUptimeCheckConfigsRequest4.google.monitoring.v3.ListUptimeCheckConfigsResponse";‚Óä“,*/v3/{parent=projects/*}/uptimeCheckConfigsÚAparent­ +GetUptimeCheckConfig1.google.monitoring.v3.GetUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"9‚Óä“,*/v3/{name=projects/*/uptimeCheckConfigs/*}ÚAnameÞ +CreateUptimeCheckConfig4.google.monitoring.v3.CreateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"d‚Óä“A"*/v3/{parent=projects/*}/uptimeCheckConfigs:uptime_check_configÚAparent,uptime_check_configë +UpdateUptimeCheckConfig4.google.monitoring.v3.UpdateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"q‚Óä“U2>/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}:uptime_check_configÚAuptime_check_config¢ +DeleteUptimeCheckConfig4.google.monitoring.v3.DeleteUptimeCheckConfigRequest.google.protobuf.Empty"9‚Óä“,**/v3/{name=projects/*/uptimeCheckConfigs/*}ÚAname“ +ListUptimeCheckIps/.google.monitoring.v3.ListUptimeCheckIpsRequest0.google.monitoring.v3.ListUptimeCheckIpsResponse"‚Óä“/v3/uptimeCheckIps©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÊ +com.google.monitoring.v3BUptimeServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php new file mode 100644 index 00000000000..b5acffa4411 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php @@ -0,0 +1,389 @@ +google.monitoring.v3.Aggregation + */ +class Aggregation extends \Google\Protobuf\Internal\Message +{ + /** + * The `alignment_period` specifies a time interval, in seconds, that is used + * to divide the data in all the + * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of + * time. This will be done before the per-series aligner can be applied to + * the data. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. + * + * Generated from protobuf field .google.protobuf.Duration alignment_period = 1; + */ + protected $alignment_period = null; + /** + * An `Aligner` describes how to bring the data points in a single + * time series into temporal alignment. Except for `ALIGN_NONE`, all + * alignments cause all the data points in an `alignment_period` to be + * mathematically grouped together, resulting in a single data point for + * each `alignment_period` with end timestamp at the end of the period. + * Not all alignment operations may be applied to all time series. The valid + * choices depend on the `metric_kind` and `value_type` of the original time + * series. Alignment can change the `metric_kind` or the `value_type` of + * the time series. + * Time series data must be aligned in order to perform cross-time + * series reduction. If `cross_series_reducer` is specified, then + * `per_series_aligner` must be specified and not equal to `ALIGN_NONE` + * and `alignment_period` must be specified; otherwise, an error is + * returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation.Aligner per_series_aligner = 2; + */ + protected $per_series_aligner = 0; + /** + * The reduction operation to be used to combine time series into a single + * time series, where the value of each data point in the resulting series is + * a function of all the already aligned values in the input time series. + * Not all reducer operations can be applied to all time series. The valid + * choices depend on the `metric_kind` and the `value_type` of the original + * time series. Reduction can yield a time series with a different + * `metric_kind` or `value_type` than the input time series. + * Time series data must first be aligned (see `per_series_aligner`) in order + * to perform cross-time series reduction. If `cross_series_reducer` is + * specified, then `per_series_aligner` must be specified, and must not be + * `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an + * error is returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation.Reducer cross_series_reducer = 4; + */ + protected $cross_series_reducer = 0; + /** + * The set of fields to preserve when `cross_series_reducer` is + * specified. The `group_by_fields` determine how the time series are + * partitioned into subsets prior to applying the aggregation + * operation. Each subset contains time series that have the same + * value for each of the grouping fields. Each individual time + * series is a member of exactly one subset. The + * `cross_series_reducer` is applied to each subset of time series. + * It is not possible to reduce across different resource types, so + * this field implicitly contains `resource.type`. Fields not + * specified in `group_by_fields` are aggregated away. If + * `group_by_fields` is not specified and all the time series have + * the same resource type, then the time series are aggregated into + * a single output time series. If `cross_series_reducer` is not + * defined, this field is ignored. + * + * Generated from protobuf field repeated string group_by_fields = 5; + */ + private $group_by_fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $alignment_period + * The `alignment_period` specifies a time interval, in seconds, that is used + * to divide the data in all the + * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of + * time. This will be done before the per-series aligner can be applied to + * the data. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. + * @type int $per_series_aligner + * An `Aligner` describes how to bring the data points in a single + * time series into temporal alignment. Except for `ALIGN_NONE`, all + * alignments cause all the data points in an `alignment_period` to be + * mathematically grouped together, resulting in a single data point for + * each `alignment_period` with end timestamp at the end of the period. + * Not all alignment operations may be applied to all time series. The valid + * choices depend on the `metric_kind` and `value_type` of the original time + * series. Alignment can change the `metric_kind` or the `value_type` of + * the time series. + * Time series data must be aligned in order to perform cross-time + * series reduction. If `cross_series_reducer` is specified, then + * `per_series_aligner` must be specified and not equal to `ALIGN_NONE` + * and `alignment_period` must be specified; otherwise, an error is + * returned. + * @type int $cross_series_reducer + * The reduction operation to be used to combine time series into a single + * time series, where the value of each data point in the resulting series is + * a function of all the already aligned values in the input time series. + * Not all reducer operations can be applied to all time series. The valid + * choices depend on the `metric_kind` and the `value_type` of the original + * time series. Reduction can yield a time series with a different + * `metric_kind` or `value_type` than the input time series. + * Time series data must first be aligned (see `per_series_aligner`) in order + * to perform cross-time series reduction. If `cross_series_reducer` is + * specified, then `per_series_aligner` must be specified, and must not be + * `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an + * error is returned. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $group_by_fields + * The set of fields to preserve when `cross_series_reducer` is + * specified. The `group_by_fields` determine how the time series are + * partitioned into subsets prior to applying the aggregation + * operation. Each subset contains time series that have the same + * value for each of the grouping fields. Each individual time + * series is a member of exactly one subset. The + * `cross_series_reducer` is applied to each subset of time series. + * It is not possible to reduce across different resource types, so + * this field implicitly contains `resource.type`. Fields not + * specified in `group_by_fields` are aggregated away. If + * `group_by_fields` is not specified and all the time series have + * the same resource type, then the time series are aggregated into + * a single output time series. If `cross_series_reducer` is not + * defined, this field is ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Common::initOnce(); + parent::__construct($data); + } + + /** + * The `alignment_period` specifies a time interval, in seconds, that is used + * to divide the data in all the + * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of + * time. This will be done before the per-series aligner can be applied to + * the data. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. + * + * Generated from protobuf field .google.protobuf.Duration alignment_period = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getAlignmentPeriod() + { + return $this->alignment_period; + } + + public function hasAlignmentPeriod() + { + return isset($this->alignment_period); + } + + public function clearAlignmentPeriod() + { + unset($this->alignment_period); + } + + /** + * The `alignment_period` specifies a time interval, in seconds, that is used + * to divide the data in all the + * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of + * time. This will be done before the per-series aligner can be applied to + * the data. + * The value must be at least 60 seconds. If a per-series + * aligner other than `ALIGN_NONE` is specified, this field is required or an + * error is returned. If no per-series aligner is specified, or the aligner + * `ALIGN_NONE` is specified, then this field is ignored. + * The maximum value of the `alignment_period` is 104 weeks (2 years) for + * charts, and 90,000 seconds (25 hours) for alerting policies. + * + * Generated from protobuf field .google.protobuf.Duration alignment_period = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setAlignmentPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->alignment_period = $var; + + return $this; + } + + /** + * An `Aligner` describes how to bring the data points in a single + * time series into temporal alignment. Except for `ALIGN_NONE`, all + * alignments cause all the data points in an `alignment_period` to be + * mathematically grouped together, resulting in a single data point for + * each `alignment_period` with end timestamp at the end of the period. + * Not all alignment operations may be applied to all time series. The valid + * choices depend on the `metric_kind` and `value_type` of the original time + * series. Alignment can change the `metric_kind` or the `value_type` of + * the time series. + * Time series data must be aligned in order to perform cross-time + * series reduction. If `cross_series_reducer` is specified, then + * `per_series_aligner` must be specified and not equal to `ALIGN_NONE` + * and `alignment_period` must be specified; otherwise, an error is + * returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation.Aligner per_series_aligner = 2; + * @return int + */ + public function getPerSeriesAligner() + { + return $this->per_series_aligner; + } + + /** + * An `Aligner` describes how to bring the data points in a single + * time series into temporal alignment. Except for `ALIGN_NONE`, all + * alignments cause all the data points in an `alignment_period` to be + * mathematically grouped together, resulting in a single data point for + * each `alignment_period` with end timestamp at the end of the period. + * Not all alignment operations may be applied to all time series. The valid + * choices depend on the `metric_kind` and `value_type` of the original time + * series. Alignment can change the `metric_kind` or the `value_type` of + * the time series. + * Time series data must be aligned in order to perform cross-time + * series reduction. If `cross_series_reducer` is specified, then + * `per_series_aligner` must be specified and not equal to `ALIGN_NONE` + * and `alignment_period` must be specified; otherwise, an error is + * returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation.Aligner per_series_aligner = 2; + * @param int $var + * @return $this + */ + public function setPerSeriesAligner($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation\Aligner::class); + $this->per_series_aligner = $var; + + return $this; + } + + /** + * The reduction operation to be used to combine time series into a single + * time series, where the value of each data point in the resulting series is + * a function of all the already aligned values in the input time series. + * Not all reducer operations can be applied to all time series. The valid + * choices depend on the `metric_kind` and the `value_type` of the original + * time series. Reduction can yield a time series with a different + * `metric_kind` or `value_type` than the input time series. + * Time series data must first be aligned (see `per_series_aligner`) in order + * to perform cross-time series reduction. If `cross_series_reducer` is + * specified, then `per_series_aligner` must be specified, and must not be + * `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an + * error is returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation.Reducer cross_series_reducer = 4; + * @return int + */ + public function getCrossSeriesReducer() + { + return $this->cross_series_reducer; + } + + /** + * The reduction operation to be used to combine time series into a single + * time series, where the value of each data point in the resulting series is + * a function of all the already aligned values in the input time series. + * Not all reducer operations can be applied to all time series. The valid + * choices depend on the `metric_kind` and the `value_type` of the original + * time series. Reduction can yield a time series with a different + * `metric_kind` or `value_type` than the input time series. + * Time series data must first be aligned (see `per_series_aligner`) in order + * to perform cross-time series reduction. If `cross_series_reducer` is + * specified, then `per_series_aligner` must be specified, and must not be + * `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an + * error is returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation.Reducer cross_series_reducer = 4; + * @param int $var + * @return $this + */ + public function setCrossSeriesReducer($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation\Reducer::class); + $this->cross_series_reducer = $var; + + return $this; + } + + /** + * The set of fields to preserve when `cross_series_reducer` is + * specified. The `group_by_fields` determine how the time series are + * partitioned into subsets prior to applying the aggregation + * operation. Each subset contains time series that have the same + * value for each of the grouping fields. Each individual time + * series is a member of exactly one subset. The + * `cross_series_reducer` is applied to each subset of time series. + * It is not possible to reduce across different resource types, so + * this field implicitly contains `resource.type`. Fields not + * specified in `group_by_fields` are aggregated away. If + * `group_by_fields` is not specified and all the time series have + * the same resource type, then the time series are aggregated into + * a single output time series. If `cross_series_reducer` is not + * defined, this field is ignored. + * + * Generated from protobuf field repeated string group_by_fields = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGroupByFields() + { + return $this->group_by_fields; + } + + /** + * The set of fields to preserve when `cross_series_reducer` is + * specified. The `group_by_fields` determine how the time series are + * partitioned into subsets prior to applying the aggregation + * operation. Each subset contains time series that have the same + * value for each of the grouping fields. Each individual time + * series is a member of exactly one subset. The + * `cross_series_reducer` is applied to each subset of time series. + * It is not possible to reduce across different resource types, so + * this field implicitly contains `resource.type`. Fields not + * specified in `group_by_fields` are aggregated away. If + * `group_by_fields` is not specified and all the time series have + * the same resource type, then the time series are aggregated into + * a single output time series. If `cross_series_reducer` is not + * defined, this field is ignored. + * + * Generated from protobuf field repeated string group_by_fields = 5; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGroupByFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->group_by_fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php new file mode 100644 index 00000000000..9f2767800da --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php @@ -0,0 +1,269 @@ +google.monitoring.v3.Aggregation.Aligner + */ +class Aligner +{ + /** + * No alignment. Raw data is returned. Not valid if cross-series reduction + * is requested. The `value_type` of the result is the same as the + * `value_type` of the input. + * + * Generated from protobuf enum ALIGN_NONE = 0; + */ + const ALIGN_NONE = 0; + /** + * Align and convert to + * [DELTA][google.api.MetricDescriptor.MetricKind.DELTA]. + * The output is `delta = y1 - y0`. + * This alignment is valid for + * [CUMULATIVE][google.api.MetricDescriptor.MetricKind.CUMULATIVE] and + * `DELTA` metrics. If the selected alignment period results in periods + * with no data, then the aligned value for such a period is created by + * interpolation. The `value_type` of the aligned result is the same as + * the `value_type` of the input. + * + * Generated from protobuf enum ALIGN_DELTA = 1; + */ + const ALIGN_DELTA = 1; + /** + * Align and convert to a rate. The result is computed as + * `rate = (y1 - y0)/(t1 - t0)`, or "delta over time". + * Think of this aligner as providing the slope of the line that passes + * through the value at the start and at the end of the `alignment_period`. + * This aligner is valid for `CUMULATIVE` + * and `DELTA` metrics with numeric values. If the selected alignment + * period results in periods with no data, then the aligned value for + * such a period is created by interpolation. The output is a `GAUGE` + * metric with `value_type` `DOUBLE`. + * If, by "rate", you mean "percentage change", see the + * `ALIGN_PERCENT_CHANGE` aligner instead. + * + * Generated from protobuf enum ALIGN_RATE = 2; + */ + const ALIGN_RATE = 2; + /** + * Align by interpolating between adjacent points around the alignment + * period boundary. This aligner is valid for `GAUGE` metrics with + * numeric values. The `value_type` of the aligned result is the same as the + * `value_type` of the input. + * + * Generated from protobuf enum ALIGN_INTERPOLATE = 3; + */ + const ALIGN_INTERPOLATE = 3; + /** + * Align by moving the most recent data point before the end of the + * alignment period to the boundary at the end of the alignment + * period. This aligner is valid for `GAUGE` metrics. The `value_type` of + * the aligned result is the same as the `value_type` of the input. + * + * Generated from protobuf enum ALIGN_NEXT_OLDER = 4; + */ + const ALIGN_NEXT_OLDER = 4; + /** + * Align the time series by returning the minimum value in each alignment + * period. This aligner is valid for `GAUGE` and `DELTA` metrics with + * numeric values. The `value_type` of the aligned result is the same as + * the `value_type` of the input. + * + * Generated from protobuf enum ALIGN_MIN = 10; + */ + const ALIGN_MIN = 10; + /** + * Align the time series by returning the maximum value in each alignment + * period. This aligner is valid for `GAUGE` and `DELTA` metrics with + * numeric values. The `value_type` of the aligned result is the same as + * the `value_type` of the input. + * + * Generated from protobuf enum ALIGN_MAX = 11; + */ + const ALIGN_MAX = 11; + /** + * Align the time series by returning the mean value in each alignment + * period. This aligner is valid for `GAUGE` and `DELTA` metrics with + * numeric values. The `value_type` of the aligned result is `DOUBLE`. + * + * Generated from protobuf enum ALIGN_MEAN = 12; + */ + const ALIGN_MEAN = 12; + /** + * Align the time series by returning the number of values in each alignment + * period. This aligner is valid for `GAUGE` and `DELTA` metrics with + * numeric or Boolean values. The `value_type` of the aligned result is + * `INT64`. + * + * Generated from protobuf enum ALIGN_COUNT = 13; + */ + const ALIGN_COUNT = 13; + /** + * Align the time series by returning the sum of the values in each + * alignment period. This aligner is valid for `GAUGE` and `DELTA` + * metrics with numeric and distribution values. The `value_type` of the + * aligned result is the same as the `value_type` of the input. + * + * Generated from protobuf enum ALIGN_SUM = 14; + */ + const ALIGN_SUM = 14; + /** + * Align the time series by returning the standard deviation of the values + * in each alignment period. This aligner is valid for `GAUGE` and + * `DELTA` metrics with numeric values. The `value_type` of the output is + * `DOUBLE`. + * + * Generated from protobuf enum ALIGN_STDDEV = 15; + */ + const ALIGN_STDDEV = 15; + /** + * Align the time series by returning the number of `True` values in + * each alignment period. This aligner is valid for `GAUGE` metrics with + * Boolean values. The `value_type` of the output is `INT64`. + * + * Generated from protobuf enum ALIGN_COUNT_TRUE = 16; + */ + const ALIGN_COUNT_TRUE = 16; + /** + * Align the time series by returning the number of `False` values in + * each alignment period. This aligner is valid for `GAUGE` metrics with + * Boolean values. The `value_type` of the output is `INT64`. + * + * Generated from protobuf enum ALIGN_COUNT_FALSE = 24; + */ + const ALIGN_COUNT_FALSE = 24; + /** + * Align the time series by returning the ratio of the number of `True` + * values to the total number of values in each alignment period. This + * aligner is valid for `GAUGE` metrics with Boolean values. The output + * value is in the range [0.0, 1.0] and has `value_type` `DOUBLE`. + * + * Generated from protobuf enum ALIGN_FRACTION_TRUE = 17; + */ + const ALIGN_FRACTION_TRUE = 17; + /** + * Align the time series by using [percentile + * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + * data point in each alignment period is the 99th percentile of all data + * points in the period. This aligner is valid for `GAUGE` and `DELTA` + * metrics with distribution values. The output is a `GAUGE` metric with + * `value_type` `DOUBLE`. + * + * Generated from protobuf enum ALIGN_PERCENTILE_99 = 18; + */ + const ALIGN_PERCENTILE_99 = 18; + /** + * Align the time series by using [percentile + * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + * data point in each alignment period is the 95th percentile of all data + * points in the period. This aligner is valid for `GAUGE` and `DELTA` + * metrics with distribution values. The output is a `GAUGE` metric with + * `value_type` `DOUBLE`. + * + * Generated from protobuf enum ALIGN_PERCENTILE_95 = 19; + */ + const ALIGN_PERCENTILE_95 = 19; + /** + * Align the time series by using [percentile + * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + * data point in each alignment period is the 50th percentile of all data + * points in the period. This aligner is valid for `GAUGE` and `DELTA` + * metrics with distribution values. The output is a `GAUGE` metric with + * `value_type` `DOUBLE`. + * + * Generated from protobuf enum ALIGN_PERCENTILE_50 = 20; + */ + const ALIGN_PERCENTILE_50 = 20; + /** + * Align the time series by using [percentile + * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + * data point in each alignment period is the 5th percentile of all data + * points in the period. This aligner is valid for `GAUGE` and `DELTA` + * metrics with distribution values. The output is a `GAUGE` metric with + * `value_type` `DOUBLE`. + * + * Generated from protobuf enum ALIGN_PERCENTILE_05 = 21; + */ + const ALIGN_PERCENTILE_05 = 21; + /** + * Align and convert to a percentage change. This aligner is valid for + * `GAUGE` and `DELTA` metrics with numeric values. This alignment returns + * `((current - previous)/previous) * 100`, where the value of `previous` is + * determined based on the `alignment_period`. + * If the values of `current` and `previous` are both 0, then the returned + * value is 0. If only `previous` is 0, the returned value is infinity. + * A 10-minute moving mean is computed at each point of the alignment period + * prior to the above calculation to smooth the metric and prevent false + * positives from very short-lived spikes. The moving mean is only + * applicable for data whose values are `>= 0`. Any values `< 0` are + * treated as a missing datapoint, and are ignored. While `DELTA` + * metrics are accepted by this alignment, special care should be taken that + * the values for the metric will always be positive. The output is a + * `GAUGE` metric with `value_type` `DOUBLE`. + * + * Generated from protobuf enum ALIGN_PERCENT_CHANGE = 23; + */ + const ALIGN_PERCENT_CHANGE = 23; + + private static $valueToName = [ + self::ALIGN_NONE => 'ALIGN_NONE', + self::ALIGN_DELTA => 'ALIGN_DELTA', + self::ALIGN_RATE => 'ALIGN_RATE', + self::ALIGN_INTERPOLATE => 'ALIGN_INTERPOLATE', + self::ALIGN_NEXT_OLDER => 'ALIGN_NEXT_OLDER', + self::ALIGN_MIN => 'ALIGN_MIN', + self::ALIGN_MAX => 'ALIGN_MAX', + self::ALIGN_MEAN => 'ALIGN_MEAN', + self::ALIGN_COUNT => 'ALIGN_COUNT', + self::ALIGN_SUM => 'ALIGN_SUM', + self::ALIGN_STDDEV => 'ALIGN_STDDEV', + self::ALIGN_COUNT_TRUE => 'ALIGN_COUNT_TRUE', + self::ALIGN_COUNT_FALSE => 'ALIGN_COUNT_FALSE', + self::ALIGN_FRACTION_TRUE => 'ALIGN_FRACTION_TRUE', + self::ALIGN_PERCENTILE_99 => 'ALIGN_PERCENTILE_99', + self::ALIGN_PERCENTILE_95 => 'ALIGN_PERCENTILE_95', + self::ALIGN_PERCENTILE_50 => 'ALIGN_PERCENTILE_50', + self::ALIGN_PERCENTILE_05 => 'ALIGN_PERCENTILE_05', + self::ALIGN_PERCENT_CHANGE => 'ALIGN_PERCENT_CHANGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Aligner::class, \Google\Cloud\Monitoring\V3\Aggregation_Aligner::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php new file mode 100644 index 00000000000..c5d065c3b4e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php @@ -0,0 +1,191 @@ +google.monitoring.v3.Aggregation.Reducer + */ +class Reducer +{ + /** + * No cross-time series reduction. The output of the `Aligner` is + * returned. + * + * Generated from protobuf enum REDUCE_NONE = 0; + */ + const REDUCE_NONE = 0; + /** + * Reduce by computing the mean value across time series for each + * alignment period. This reducer is valid for + * [DELTA][google.api.MetricDescriptor.MetricKind.DELTA] and + * [GAUGE][google.api.MetricDescriptor.MetricKind.GAUGE] metrics with + * numeric or distribution values. The `value_type` of the output is + * [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + * + * Generated from protobuf enum REDUCE_MEAN = 1; + */ + const REDUCE_MEAN = 1; + /** + * Reduce by computing the minimum value across time series for each + * alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics + * with numeric values. The `value_type` of the output is the same as the + * `value_type` of the input. + * + * Generated from protobuf enum REDUCE_MIN = 2; + */ + const REDUCE_MIN = 2; + /** + * Reduce by computing the maximum value across time series for each + * alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics + * with numeric values. The `value_type` of the output is the same as the + * `value_type` of the input. + * + * Generated from protobuf enum REDUCE_MAX = 3; + */ + const REDUCE_MAX = 3; + /** + * Reduce by computing the sum across time series for each + * alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics + * with numeric and distribution values. The `value_type` of the output is + * the same as the `value_type` of the input. + * + * Generated from protobuf enum REDUCE_SUM = 4; + */ + const REDUCE_SUM = 4; + /** + * Reduce by computing the standard deviation across time series + * for each alignment period. This reducer is valid for `DELTA` and + * `GAUGE` metrics with numeric or distribution values. The `value_type` + * of the output is `DOUBLE`. + * + * Generated from protobuf enum REDUCE_STDDEV = 5; + */ + const REDUCE_STDDEV = 5; + /** + * Reduce by computing the number of data points across time series + * for each alignment period. This reducer is valid for `DELTA` and + * `GAUGE` metrics of numeric, Boolean, distribution, and string + * `value_type`. The `value_type` of the output is `INT64`. + * + * Generated from protobuf enum REDUCE_COUNT = 6; + */ + const REDUCE_COUNT = 6; + /** + * Reduce by computing the number of `True`-valued data points across time + * series for each alignment period. This reducer is valid for `DELTA` and + * `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output + * is `INT64`. + * + * Generated from protobuf enum REDUCE_COUNT_TRUE = 7; + */ + const REDUCE_COUNT_TRUE = 7; + /** + * Reduce by computing the number of `False`-valued data points across time + * series for each alignment period. This reducer is valid for `DELTA` and + * `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output + * is `INT64`. + * + * Generated from protobuf enum REDUCE_COUNT_FALSE = 15; + */ + const REDUCE_COUNT_FALSE = 15; + /** + * Reduce by computing the ratio of the number of `True`-valued data points + * to the total number of data points for each alignment period. This + * reducer is valid for `DELTA` and `GAUGE` metrics of Boolean `value_type`. + * The output value is in the range [0.0, 1.0] and has `value_type` + * `DOUBLE`. + * + * Generated from protobuf enum REDUCE_FRACTION_TRUE = 8; + */ + const REDUCE_FRACTION_TRUE = 8; + /** + * Reduce by computing the [99th + * percentile](https://en.wikipedia.org/wiki/Percentile) of data points + * across time series for each alignment period. This reducer is valid for + * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + * of the output is `DOUBLE`. + * + * Generated from protobuf enum REDUCE_PERCENTILE_99 = 9; + */ + const REDUCE_PERCENTILE_99 = 9; + /** + * Reduce by computing the [95th + * percentile](https://en.wikipedia.org/wiki/Percentile) of data points + * across time series for each alignment period. This reducer is valid for + * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + * of the output is `DOUBLE`. + * + * Generated from protobuf enum REDUCE_PERCENTILE_95 = 10; + */ + const REDUCE_PERCENTILE_95 = 10; + /** + * Reduce by computing the [50th + * percentile](https://en.wikipedia.org/wiki/Percentile) of data points + * across time series for each alignment period. This reducer is valid for + * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + * of the output is `DOUBLE`. + * + * Generated from protobuf enum REDUCE_PERCENTILE_50 = 11; + */ + const REDUCE_PERCENTILE_50 = 11; + /** + * Reduce by computing the [5th + * percentile](https://en.wikipedia.org/wiki/Percentile) of data points + * across time series for each alignment period. This reducer is valid for + * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + * of the output is `DOUBLE`. + * + * Generated from protobuf enum REDUCE_PERCENTILE_05 = 12; + */ + const REDUCE_PERCENTILE_05 = 12; + + private static $valueToName = [ + self::REDUCE_NONE => 'REDUCE_NONE', + self::REDUCE_MEAN => 'REDUCE_MEAN', + self::REDUCE_MIN => 'REDUCE_MIN', + self::REDUCE_MAX => 'REDUCE_MAX', + self::REDUCE_SUM => 'REDUCE_SUM', + self::REDUCE_STDDEV => 'REDUCE_STDDEV', + self::REDUCE_COUNT => 'REDUCE_COUNT', + self::REDUCE_COUNT_TRUE => 'REDUCE_COUNT_TRUE', + self::REDUCE_COUNT_FALSE => 'REDUCE_COUNT_FALSE', + self::REDUCE_FRACTION_TRUE => 'REDUCE_FRACTION_TRUE', + self::REDUCE_PERCENTILE_99 => 'REDUCE_PERCENTILE_99', + self::REDUCE_PERCENTILE_95 => 'REDUCE_PERCENTILE_95', + self::REDUCE_PERCENTILE_50 => 'REDUCE_PERCENTILE_50', + self::REDUCE_PERCENTILE_05 => 'REDUCE_PERCENTILE_05', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Reducer::class, \Google\Cloud\Monitoring\V3\Aggregation_Reducer::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation_Aligner.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation_Aligner.php new file mode 100644 index 00000000000..39d191200d7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation_Aligner.php @@ -0,0 +1,16 @@ +google.monitoring.v3.AlertPolicy + */ +class AlertPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Required if the policy exists. The resource name for this policy. The + * format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy + * is created. When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the alerting policy passed as + * part of the request. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * A short name or phrase used to identify the policy in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple policies in the same project. The name is + * limited to 512 Unicode characters. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Documentation that is included with notifications and incidents related to + * this policy. Best practice is for the documentation to include information + * to help responders understand, mitigate, escalate, and correct the + * underlying problems detected by the alerting policy. Notification channels + * that have limited capacity might not show this documentation. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Documentation documentation = 13; + */ + protected $documentation = null; + /** + * User-supplied key/value data to be used for organizing and + * identifying the `AlertPolicy` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * + * Generated from protobuf field map user_labels = 16; + */ + private $user_labels; + /** + * A list of conditions for the policy. The conditions are combined by AND or + * OR according to the `combiner` field. If the combined conditions evaluate + * to true, then an incident is created. A policy can have from one to six + * conditions. + * If `condition_time_series_query_language` is present, it must be the only + * `condition`. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; + */ + private $conditions; + /** + * How to combine the results of multiple conditions to determine if an + * incident should be opened. + * If `condition_time_series_query_language` is present, this must be + * `COMBINE_UNSPECIFIED`. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.ConditionCombinerType combiner = 6; + */ + protected $combiner = 0; + /** + * Whether or not the policy is enabled. On write, the default interpretation + * if unset is that the policy is enabled. On read, clients should not make + * any assumption about the state if it has not been populated. The + * field should always be populated on List and Get operations, unless + * a field projection has been specified that strips it out. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; + */ + protected $enabled = null; + /** + * Read-only description of how the alert policy is invalid. OK if the alert + * policy is valid. If not OK, the alert policy will not generate incidents. + * + * Generated from protobuf field .google.rpc.Status validity = 18; + */ + protected $validity = null; + /** + * Identifies the notification channels to which notifications should be sent + * when incidents are opened or closed or when new violations occur on + * an already opened incident. Each element of this array corresponds to + * the `name` field in each of the + * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] + * objects that are returned from the [`ListNotificationChannels`] + * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * method. The format of the entries in this field is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channels = 14; + */ + private $notification_channels; + /** + * A read-only record of the creation of the alerting policy. If provided + * in a call to create or update, this field will be ignored. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 10; + */ + protected $creation_record = null; + /** + * A read-only record of the most recent change to the alerting policy. If + * provided in a call to create or update, this field will be ignored. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord mutation_record = 11; + */ + protected $mutation_record = null; + /** + * Control over how this alert policy's notification channels are notified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; + */ + protected $alert_strategy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required if the policy exists. The resource name for this policy. The + * format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy + * is created. When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the alerting policy passed as + * part of the request. + * @type string $display_name + * A short name or phrase used to identify the policy in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple policies in the same project. The name is + * limited to 512 Unicode characters. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation $documentation + * Documentation that is included with notifications and incidents related to + * this policy. Best practice is for the documentation to include information + * to help responders understand, mitigate, escalate, and correct the + * underlying problems detected by the alerting policy. Notification channels + * that have limited capacity might not show this documentation. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * User-supplied key/value data to be used for organizing and + * identifying the `AlertPolicy` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition[]|\Google\Protobuf\Internal\RepeatedField $conditions + * A list of conditions for the policy. The conditions are combined by AND or + * OR according to the `combiner` field. If the combined conditions evaluate + * to true, then an incident is created. A policy can have from one to six + * conditions. + * If `condition_time_series_query_language` is present, it must be the only + * `condition`. + * @type int $combiner + * How to combine the results of multiple conditions to determine if an + * incident should be opened. + * If `condition_time_series_query_language` is present, this must be + * `COMBINE_UNSPECIFIED`. + * @type \Google\Protobuf\BoolValue $enabled + * Whether or not the policy is enabled. On write, the default interpretation + * if unset is that the policy is enabled. On read, clients should not make + * any assumption about the state if it has not been populated. The + * field should always be populated on List and Get operations, unless + * a field projection has been specified that strips it out. + * @type \Google\Rpc\Status $validity + * Read-only description of how the alert policy is invalid. OK if the alert + * policy is valid. If not OK, the alert policy will not generate incidents. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $notification_channels + * Identifies the notification channels to which notifications should be sent + * when incidents are opened or closed or when new violations occur on + * an already opened incident. Each element of this array corresponds to + * the `name` field in each of the + * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] + * objects that are returned from the [`ListNotificationChannels`] + * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * method. The format of the entries in this field is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @type \Google\Cloud\Monitoring\V3\MutationRecord $creation_record + * A read-only record of the creation of the alerting policy. If provided + * in a call to create or update, this field will be ignored. + * @type \Google\Cloud\Monitoring\V3\MutationRecord $mutation_record + * A read-only record of the most recent change to the alerting policy. If + * provided in a call to create or update, this field will be ignored. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy $alert_strategy + * Control over how this alert policy's notification channels are notified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required if the policy exists. The resource name for this policy. The + * format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy + * is created. When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the alerting policy passed as + * part of the request. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required if the policy exists. The resource name for this policy. The + * format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy + * is created. When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the alerting policy passed as + * part of the request. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A short name or phrase used to identify the policy in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple policies in the same project. The name is + * limited to 512 Unicode characters. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A short name or phrase used to identify the policy in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple policies in the same project. The name is + * limited to 512 Unicode characters. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Documentation that is included with notifications and incidents related to + * this policy. Best practice is for the documentation to include information + * to help responders understand, mitigate, escalate, and correct the + * underlying problems detected by the alerting policy. Notification channels + * that have limited capacity might not show this documentation. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Documentation documentation = 13; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation|null + */ + public function getDocumentation() + { + return $this->documentation; + } + + public function hasDocumentation() + { + return isset($this->documentation); + } + + public function clearDocumentation() + { + unset($this->documentation); + } + + /** + * Documentation that is included with notifications and incidents related to + * this policy. Best practice is for the documentation to include information + * to help responders understand, mitigate, escalate, and correct the + * underlying problems detected by the alerting policy. Notification channels + * that have limited capacity might not show this documentation. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Documentation documentation = 13; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation $var + * @return $this + */ + public function setDocumentation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation::class); + $this->documentation = $var; + + return $this; + } + + /** + * User-supplied key/value data to be used for organizing and + * identifying the `AlertPolicy` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * + * Generated from protobuf field map user_labels = 16; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * User-supplied key/value data to be used for organizing and + * identifying the `AlertPolicy` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * + * Generated from protobuf field map user_labels = 16; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + + /** + * A list of conditions for the policy. The conditions are combined by AND or + * OR according to the `combiner` field. If the combined conditions evaluate + * to true, then an incident is created. A policy can have from one to six + * conditions. + * If `condition_time_series_query_language` is present, it must be the only + * `condition`. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * A list of conditions for the policy. The conditions are combined by AND or + * OR according to the `combiner` field. If the combined conditions evaluate + * to true, then an incident is created. A policy can have from one to six + * conditions. + * If `condition_time_series_query_language` is present, it must be the only + * `condition`. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * How to combine the results of multiple conditions to determine if an + * incident should be opened. + * If `condition_time_series_query_language` is present, this must be + * `COMBINE_UNSPECIFIED`. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.ConditionCombinerType combiner = 6; + * @return int + */ + public function getCombiner() + { + return $this->combiner; + } + + /** + * How to combine the results of multiple conditions to determine if an + * incident should be opened. + * If `condition_time_series_query_language` is present, this must be + * `COMBINE_UNSPECIFIED`. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.ConditionCombinerType combiner = 6; + * @param int $var + * @return $this + */ + public function setCombiner($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\ConditionCombinerType::class); + $this->combiner = $var; + + return $this; + } + + /** + * Whether or not the policy is enabled. On write, the default interpretation + * if unset is that the policy is enabled. On read, clients should not make + * any assumption about the state if it has not been populated. The + * field should always be populated on List and Get operations, unless + * a field projection has been specified that strips it out. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; + * @return \Google\Protobuf\BoolValue|null + */ + public function getEnabled() + { + return $this->enabled; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Returns the unboxed value from getEnabled() + + * Whether or not the policy is enabled. On write, the default interpretation + * if unset is that the policy is enabled. On read, clients should not make + * any assumption about the state if it has not been populated. The + * field should always be populated on List and Get operations, unless + * a field projection has been specified that strips it out. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; + * @return bool|null + */ + public function getEnabledUnwrapped() + { + return $this->readWrapperValue("enabled"); + } + + /** + * Whether or not the policy is enabled. On write, the default interpretation + * if unset is that the policy is enabled. On read, clients should not make + * any assumption about the state if it has not been populated. The + * field should always be populated on List and Get operations, unless + * a field projection has been specified that strips it out. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->enabled = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Whether or not the policy is enabled. On write, the default interpretation + * if unset is that the policy is enabled. On read, clients should not make + * any assumption about the state if it has not been populated. The + * field should always be populated on List and Get operations, unless + * a field projection has been specified that strips it out. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; + * @param bool|null $var + * @return $this + */ + public function setEnabledUnwrapped($var) + { + $this->writeWrapperValue("enabled", $var); + return $this;} + + /** + * Read-only description of how the alert policy is invalid. OK if the alert + * policy is valid. If not OK, the alert policy will not generate incidents. + * + * Generated from protobuf field .google.rpc.Status validity = 18; + * @return \Google\Rpc\Status|null + */ + public function getValidity() + { + return $this->validity; + } + + public function hasValidity() + { + return isset($this->validity); + } + + public function clearValidity() + { + unset($this->validity); + } + + /** + * Read-only description of how the alert policy is invalid. OK if the alert + * policy is valid. If not OK, the alert policy will not generate incidents. + * + * Generated from protobuf field .google.rpc.Status validity = 18; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setValidity($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->validity = $var; + + return $this; + } + + /** + * Identifies the notification channels to which notifications should be sent + * when incidents are opened or closed or when new violations occur on + * an already opened incident. Each element of this array corresponds to + * the `name` field in each of the + * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] + * objects that are returned from the [`ListNotificationChannels`] + * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * method. The format of the entries in this field is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channels = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationChannels() + { + return $this->notification_channels; + } + + /** + * Identifies the notification channels to which notifications should be sent + * when incidents are opened or closed or when new violations occur on + * an already opened incident. Each element of this array corresponds to + * the `name` field in each of the + * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] + * objects that are returned from the [`ListNotificationChannels`] + * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * method. The format of the entries in this field is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channels = 14; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationChannels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->notification_channels = $arr; + + return $this; + } + + /** + * A read-only record of the creation of the alerting policy. If provided + * in a call to create or update, this field will be ignored. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 10; + * @return \Google\Cloud\Monitoring\V3\MutationRecord|null + */ + public function getCreationRecord() + { + return $this->creation_record; + } + + public function hasCreationRecord() + { + return isset($this->creation_record); + } + + public function clearCreationRecord() + { + unset($this->creation_record); + } + + /** + * A read-only record of the creation of the alerting policy. If provided + * in a call to create or update, this field will be ignored. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 10; + * @param \Google\Cloud\Monitoring\V3\MutationRecord $var + * @return $this + */ + public function setCreationRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\MutationRecord::class); + $this->creation_record = $var; + + return $this; + } + + /** + * A read-only record of the most recent change to the alerting policy. If + * provided in a call to create or update, this field will be ignored. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord mutation_record = 11; + * @return \Google\Cloud\Monitoring\V3\MutationRecord|null + */ + public function getMutationRecord() + { + return $this->mutation_record; + } + + public function hasMutationRecord() + { + return isset($this->mutation_record); + } + + public function clearMutationRecord() + { + unset($this->mutation_record); + } + + /** + * A read-only record of the most recent change to the alerting policy. If + * provided in a call to create or update, this field will be ignored. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord mutation_record = 11; + * @param \Google\Cloud\Monitoring\V3\MutationRecord $var + * @return $this + */ + public function setMutationRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\MutationRecord::class); + $this->mutation_record = $var; + + return $this; + } + + /** + * Control over how this alert policy's notification channels are notified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy|null + */ + public function getAlertStrategy() + { + return $this->alert_strategy; + } + + public function hasAlertStrategy() + { + return isset($this->alert_strategy); + } + + public function clearAlertStrategy() + { + unset($this->alert_strategy); + } + + /** + * Control over how this alert policy's notification channels are notified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy $var + * @return $this + */ + public function setAlertStrategy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy::class); + $this->alert_strategy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php new file mode 100644 index 00000000000..03447c55f0f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php @@ -0,0 +1,133 @@ +google.monitoring.v3.AlertPolicy.AlertStrategy + */ +class AlertStrategy extends \Google\Protobuf\Internal\Message +{ + /** + * Required for alert policies with a `LogMatch` condition. + * This limit is not implemented for alert policies that are not log-based. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + */ + protected $notification_rate_limit = null; + /** + * If an alert policy that was active has no data for this long, any open + * incidents will close + * + * Generated from protobuf field .google.protobuf.Duration auto_close = 3; + */ + protected $auto_close = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationRateLimit $notification_rate_limit + * Required for alert policies with a `LogMatch` condition. + * This limit is not implemented for alert policies that are not log-based. + * @type \Google\Protobuf\Duration $auto_close + * If an alert policy that was active has no data for this long, any open + * incidents will close + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required for alert policies with a `LogMatch` condition. + * This limit is not implemented for alert policies that are not log-based. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationRateLimit|null + */ + public function getNotificationRateLimit() + { + return $this->notification_rate_limit; + } + + public function hasNotificationRateLimit() + { + return isset($this->notification_rate_limit); + } + + public function clearNotificationRateLimit() + { + unset($this->notification_rate_limit); + } + + /** + * Required for alert policies with a `LogMatch` condition. + * This limit is not implemented for alert policies that are not log-based. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationRateLimit $var + * @return $this + */ + public function setNotificationRateLimit($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationRateLimit::class); + $this->notification_rate_limit = $var; + + return $this; + } + + /** + * If an alert policy that was active has no data for this long, any open + * incidents will close + * + * Generated from protobuf field .google.protobuf.Duration auto_close = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getAutoClose() + { + return $this->auto_close; + } + + public function hasAutoClose() + { + return isset($this->auto_close); + } + + public function clearAutoClose() + { + unset($this->auto_close); + } + + /** + * If an alert policy that was active has no data for this long, any open + * incidents will close + * + * Generated from protobuf field .google.protobuf.Duration auto_close = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setAutoClose($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->auto_close = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AlertStrategy::class, \Google\Cloud\Monitoring\V3\AlertPolicy_AlertStrategy::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php new file mode 100644 index 00000000000..a487e3fd361 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php @@ -0,0 +1,81 @@ +google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit + */ +class NotificationRateLimit extends \Google\Protobuf\Internal\Message +{ + /** + * Not more than one notification per `period`. + * + * Generated from protobuf field .google.protobuf.Duration period = 1; + */ + protected $period = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $period + * Not more than one notification per `period`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Not more than one notification per `period`. + * + * Generated from protobuf field .google.protobuf.Duration period = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getPeriod() + { + return $this->period; + } + + public function hasPeriod() + { + return isset($this->period); + } + + public function clearPeriod() + { + unset($this->period); + } + + /** + * Not more than one notification per `period`. + * + * Generated from protobuf field .google.protobuf.Duration period = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->period = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NotificationRateLimit::class, \Google\Cloud\Monitoring\V3\AlertPolicy_AlertStrategy_NotificationRateLimit::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php new file mode 100644 index 00000000000..649b747bd1c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php @@ -0,0 +1,340 @@ +google.monitoring.v3.AlertPolicy.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * Required if the condition exists. The unique resource name for this + * condition. Its format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] + * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the + * condition is created as part of a new or updated alerting policy. + * When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the conditions of the + * requested alerting policy. Stackdriver Monitoring creates the + * condition identifiers and includes them in the new policy. + * When calling the + * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] + * method to update a policy, including a condition `name` causes the + * existing condition to be updated. Conditions without names are added to + * the updated policy. Existing conditions are deleted if they are not + * updated. + * Best practice is to preserve `[CONDITION_ID]` if you make only small + * changes, such as those to condition thresholds, durations, or trigger + * values. Otherwise, treat the change as a new condition and let the + * existing condition be deleted. + * + * Generated from protobuf field string name = 12; + */ + protected $name = ''; + /** + * A short name or phrase used to identify the condition in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple conditions in the same policy. + * + * Generated from protobuf field string display_name = 6; + */ + protected $display_name = ''; + protected $condition; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required if the condition exists. The unique resource name for this + * condition. Its format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] + * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the + * condition is created as part of a new or updated alerting policy. + * When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the conditions of the + * requested alerting policy. Stackdriver Monitoring creates the + * condition identifiers and includes them in the new policy. + * When calling the + * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] + * method to update a policy, including a condition `name` causes the + * existing condition to be updated. Conditions without names are added to + * the updated policy. Existing conditions are deleted if they are not + * updated. + * Best practice is to preserve `[CONDITION_ID]` if you make only small + * changes, such as those to condition thresholds, durations, or trigger + * values. Otherwise, treat the change as a new condition and let the + * existing condition be deleted. + * @type string $display_name + * A short name or phrase used to identify the condition in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple conditions in the same policy. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold $condition_threshold + * A condition that compares a time series against a threshold. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence $condition_absent + * A condition that checks that a time series continues to + * receive new data points. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch $condition_matched_log + * A condition that checks for log messages matching given constraints. If + * set, no other conditions can be present. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition $condition_monitoring_query_language + * A condition that uses the Monitoring Query Language to define + * alerts. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required if the condition exists. The unique resource name for this + * condition. Its format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] + * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the + * condition is created as part of a new or updated alerting policy. + * When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the conditions of the + * requested alerting policy. Stackdriver Monitoring creates the + * condition identifiers and includes them in the new policy. + * When calling the + * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] + * method to update a policy, including a condition `name` causes the + * existing condition to be updated. Conditions without names are added to + * the updated policy. Existing conditions are deleted if they are not + * updated. + * Best practice is to preserve `[CONDITION_ID]` if you make only small + * changes, such as those to condition thresholds, durations, or trigger + * values. Otherwise, treat the change as a new condition and let the + * existing condition be deleted. + * + * Generated from protobuf field string name = 12; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required if the condition exists. The unique resource name for this + * condition. Its format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] + * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the + * condition is created as part of a new or updated alerting policy. + * When calling the + * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] + * method, do not include the `name` field in the conditions of the + * requested alerting policy. Stackdriver Monitoring creates the + * condition identifiers and includes them in the new policy. + * When calling the + * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] + * method to update a policy, including a condition `name` causes the + * existing condition to be updated. Conditions without names are added to + * the updated policy. Existing conditions are deleted if they are not + * updated. + * Best practice is to preserve `[CONDITION_ID]` if you make only small + * changes, such as those to condition thresholds, durations, or trigger + * values. Otherwise, treat the change as a new condition and let the + * existing condition be deleted. + * + * Generated from protobuf field string name = 12; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A short name or phrase used to identify the condition in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple conditions in the same policy. + * + * Generated from protobuf field string display_name = 6; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A short name or phrase used to identify the condition in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple conditions in the same policy. + * + * Generated from protobuf field string display_name = 6; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * A condition that compares a time series against a threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold|null + */ + public function getConditionThreshold() + { + return $this->readOneof(1); + } + + public function hasConditionThreshold() + { + return $this->hasOneof(1); + } + + /** + * A condition that compares a time series against a threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold $var + * @return $this + */ + public function setConditionThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A condition that checks that a time series continues to + * receive new data points. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence|null + */ + public function getConditionAbsent() + { + return $this->readOneof(2); + } + + public function hasConditionAbsent() + { + return $this->hasOneof(2); + } + + /** + * A condition that checks that a time series continues to + * receive new data points. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence $var + * @return $this + */ + public function setConditionAbsent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A condition that checks for log messages matching given constraints. If + * set, no other conditions can be present. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch|null + */ + public function getConditionMatchedLog() + { + return $this->readOneof(20); + } + + public function hasConditionMatchedLog() + { + return $this->hasOneof(20); + } + + /** + * A condition that checks for log messages matching given constraints. If + * set, no other conditions can be present. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch $var + * @return $this + */ + public function setConditionMatchedLog($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch::class); + $this->writeOneof(20, $var); + + return $this; + } + + /** + * A condition that uses the Monitoring Query Language to define + * alerts. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition|null + */ + public function getConditionMonitoringQueryLanguage() + { + return $this->readOneof(19); + } + + public function hasConditionMonitoringQueryLanguage() + { + return $this->hasOneof(19); + } + + /** + * A condition that uses the Monitoring Query Language to define + * alerts. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition $var + * @return $this + */ + public function setConditionMonitoringQueryLanguage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition::class); + $this->writeOneof(19, $var); + + return $this; + } + + /** + * @return string + */ + public function getCondition() + { + return $this->whichOneof("condition"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Condition::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php new file mode 100644 index 00000000000..cd52e655a01 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php @@ -0,0 +1,151 @@ +google.monitoring.v3.AlertPolicy.Condition.LogMatch + */ +class LogMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A logs-based filter. See [Advanced Logs + * Queries](https://cloud.google.com/logging/docs/view/advanced-queries) + * for how this filter should be constructed. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Optional. A map from a label key to an extractor expression, which is + * used to extract the value for this label key. Each entry in this map is + * a specification for how data should be extracted from log entries that + * match `filter`. Each combination of extracted values is treated as a + * separate rule for the purposes of triggering notifications. Label keys + * and corresponding values can be used in notifications generated by this + * condition. + * Please see [the documentation on logs-based metric + * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) + * for syntax and examples. + * + * Generated from protobuf field map label_extractors = 2; + */ + private $label_extractors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * Required. A logs-based filter. See [Advanced Logs + * Queries](https://cloud.google.com/logging/docs/view/advanced-queries) + * for how this filter should be constructed. + * @type array|\Google\Protobuf\Internal\MapField $label_extractors + * Optional. A map from a label key to an extractor expression, which is + * used to extract the value for this label key. Each entry in this map is + * a specification for how data should be extracted from log entries that + * match `filter`. Each combination of extracted values is treated as a + * separate rule for the purposes of triggering notifications. Label keys + * and corresponding values can be used in notifications generated by this + * condition. + * Please see [the documentation on logs-based metric + * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) + * for syntax and examples. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required. A logs-based filter. See [Advanced Logs + * Queries](https://cloud.google.com/logging/docs/view/advanced-queries) + * for how this filter should be constructed. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A logs-based filter. See [Advanced Logs + * Queries](https://cloud.google.com/logging/docs/view/advanced-queries) + * for how this filter should be constructed. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. A map from a label key to an extractor expression, which is + * used to extract the value for this label key. Each entry in this map is + * a specification for how data should be extracted from log entries that + * match `filter`. Each combination of extracted values is treated as a + * separate rule for the purposes of triggering notifications. Label keys + * and corresponding values can be used in notifications generated by this + * condition. + * Please see [the documentation on logs-based metric + * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) + * for syntax and examples. + * + * Generated from protobuf field map label_extractors = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabelExtractors() + { + return $this->label_extractors; + } + + /** + * Optional. A map from a label key to an extractor expression, which is + * used to extract the value for this label key. Each entry in this map is + * a specification for how data should be extracted from log entries that + * match `filter`. Each combination of extracted values is treated as a + * separate rule for the purposes of triggering notifications. Label keys + * and corresponding values can be used in notifications generated by this + * condition. + * Please see [the documentation on logs-based metric + * `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) + * for syntax and examples. + * + * Generated from protobuf field map label_extractors = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabelExtractors($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->label_extractors = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LogMatch::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_LogMatch::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php new file mode 100644 index 00000000000..8c6bdbe75da --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php @@ -0,0 +1,300 @@ +google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + */ +class MetricAbsence extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 5; + */ + private $aggregations; + /** + * The amount of time that a time series must fail to report new + * data to be considered failing. The minimum value of this field + * is 120 seconds. Larger values that are a multiple of a + * minute--for example, 240 or 300 seconds--are supported. + * If an invalid value is given, an + * error will be returned. The `Duration.nanos` field is + * ignored. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + */ + protected $duration = null; + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + protected $trigger = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * @type \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $aggregations + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * @type \Google\Protobuf\Duration $duration + * The amount of time that a time series must fail to report new + * data to be considered failing. The minimum value of this field + * is 120 seconds. Larger values that are a multiple of a + * minute--for example, 240 or 300 seconds--are supported. + * If an invalid value is given, an + * error will be returned. The `Duration.nanos` field is + * ignored. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $trigger + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAggregations() + { + return $this->aggregations; + } + + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 5; + * @param \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAggregations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Aggregation::class); + $this->aggregations = $arr; + + return $this; + } + + /** + * The amount of time that a time series must fail to report new + * data to be considered failing. The minimum value of this field + * is 120 seconds. Larger values that are a multiple of a + * minute--for example, 240 or 300 seconds--are supported. + * If an invalid value is given, an + * error will be returned. The `Duration.nanos` field is + * ignored. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * The amount of time that a time series must fail to report new + * data to be considered failing. The minimum value of this field + * is 120 seconds. Larger values that are a multiple of a + * minute--for example, 240 or 300 seconds--are supported. + * If an invalid value is given, an + * error will be returned. The `Duration.nanos` field is + * ignored. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger|null + */ + public function getTrigger() + { + return $this->trigger; + } + + public function hasTrigger() + { + return isset($this->trigger); + } + + public function clearTrigger() + { + unset($this->trigger); + } + + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $var + * @return $this + */ + public function setTrigger($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger::class); + $this->trigger = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MetricAbsence::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricAbsence::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php new file mode 100644 index 00000000000..17b7e07997e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php @@ -0,0 +1,529 @@ +google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + */ +class MetricThreshold extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 8; + */ + private $aggregations; + /** + * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies a time series that should be used as the denominator of a + * ratio that will be compared with the threshold. If a + * `denominator_filter` is specified, the time series specified by the + * `filter` field will be used as the numerator. + * The filter must specify the metric type and optionally may contain + * restrictions on resource type, resource labels, and metric labels. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string denominator_filter = 9; + */ + protected $denominator_filter = ''; + /** + * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + */ + private $denominator_aggregations; + /** + * The comparison to apply between the time series (indicated by `filter` + * and `aggregation`) and the threshold (indicated by `threshold_value`). + * The comparison is applied on each time series, with the time series + * on the left-hand side and the threshold on the right-hand side. + * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. + * + * Generated from protobuf field .google.monitoring.v3.ComparisonType comparison = 4; + */ + protected $comparison = 0; + /** + * A value against which to compare the time series. + * + * Generated from protobuf field double threshold_value = 5; + */ + protected $threshold_value = 0.0; + /** + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * + * Generated from protobuf field .google.protobuf.Duration duration = 6; + */ + protected $duration = null; + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + */ + protected $trigger = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * @type \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $aggregations + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * @type string $denominator_filter + * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies a time series that should be used as the denominator of a + * ratio that will be compared with the threshold. If a + * `denominator_filter` is specified, the time series specified by the + * `filter` field will be used as the numerator. + * The filter must specify the metric type and optionally may contain + * restrictions on resource type, resource labels, and metric labels. + * This field may not exceed 2048 Unicode characters in length. + * @type \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $denominator_aggregations + * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + * @type int $comparison + * The comparison to apply between the time series (indicated by `filter` + * and `aggregation`) and the threshold (indicated by `threshold_value`). + * The comparison is applied on each time series, with the time series + * on the left-hand side and the threshold on the right-hand side. + * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. + * @type float $threshold_value + * A value against which to compare the time series. + * @type \Google\Protobuf\Duration $duration + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $trigger + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies which time series should be compared with the threshold. + * The filter is similar to the one that is specified in the + * [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) + * (that call is useful to verify the time series that will be retrieved / + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAggregations() + { + return $this->aggregations; + } + + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). Multiple aggregations + * are applied in the order specified. + * This field is similar to the one in the [`ListTimeSeries` + * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * It is advisable to use the `ListTimeSeries` method when debugging this + * field. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 8; + * @param \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAggregations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Aggregation::class); + $this->aggregations = $arr; + + return $this; + } + + /** + * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies a time series that should be used as the denominator of a + * ratio that will be compared with the threshold. If a + * `denominator_filter` is specified, the time series specified by the + * `filter` field will be used as the numerator. + * The filter must specify the metric type and optionally may contain + * restrictions on resource type, resource labels, and metric labels. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string denominator_filter = 9; + * @return string + */ + public function getDenominatorFilter() + { + return $this->denominator_filter; + } + + /** + * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * identifies a time series that should be used as the denominator of a + * ratio that will be compared with the threshold. If a + * `denominator_filter` is specified, the time series specified by the + * `filter` field will be used as the numerator. + * The filter must specify the metric type and optionally may contain + * restrictions on resource type, resource labels, and metric labels. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string denominator_filter = 9; + * @param string $var + * @return $this + */ + public function setDenominatorFilter($var) + { + GPBUtil::checkString($var, True); + $this->denominator_filter = $var; + + return $this; + } + + /** + * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDenominatorAggregations() + { + return $this->denominator_aggregations; + } + + /** + * Specifies the alignment of data points in individual time series + * selected by `denominatorFilter` as + * well as how to combine the retrieved time series together (such as + * when aggregating multiple streams on each resource to a single + * stream for each resource or when aggregating streams across all + * members of a group of resources). + * When computing ratios, the `aggregations` and + * `denominator_aggregations` fields must use the same alignment period + * and produce time series that have the same periodicity and labels. + * + * Generated from protobuf field repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; + * @param \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDenominatorAggregations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Aggregation::class); + $this->denominator_aggregations = $arr; + + return $this; + } + + /** + * The comparison to apply between the time series (indicated by `filter` + * and `aggregation`) and the threshold (indicated by `threshold_value`). + * The comparison is applied on each time series, with the time series + * on the left-hand side and the threshold on the right-hand side. + * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. + * + * Generated from protobuf field .google.monitoring.v3.ComparisonType comparison = 4; + * @return int + */ + public function getComparison() + { + return $this->comparison; + } + + /** + * The comparison to apply between the time series (indicated by `filter` + * and `aggregation`) and the threshold (indicated by `threshold_value`). + * The comparison is applied on each time series, with the time series + * on the left-hand side and the threshold on the right-hand side. + * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. + * + * Generated from protobuf field .google.monitoring.v3.ComparisonType comparison = 4; + * @param int $var + * @return $this + */ + public function setComparison($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ComparisonType::class); + $this->comparison = $var; + + return $this; + } + + /** + * A value against which to compare the time series. + * + * Generated from protobuf field double threshold_value = 5; + * @return float + */ + public function getThresholdValue() + { + return $this->threshold_value; + } + + /** + * A value against which to compare the time series. + * + * Generated from protobuf field double threshold_value = 5; + * @param float $var + * @return $this + */ + public function setThresholdValue($var) + { + GPBUtil::checkDouble($var); + $this->threshold_value = $var; + + return $this; + } + + /** + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * + * Generated from protobuf field .google.protobuf.Duration duration = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * + * Generated from protobuf field .google.protobuf.Duration duration = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger|null + */ + public function getTrigger() + { + return $this->trigger; + } + + public function hasTrigger() + { + return isset($this->trigger); + } + + public function clearTrigger() + { + unset($this->trigger); + } + + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $var + * @return $this + */ + public function setTrigger($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger::class); + $this->trigger = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MetricThreshold::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php new file mode 100644 index 00000000000..90d7dce23eb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php @@ -0,0 +1,219 @@ +google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition + */ +class MonitoringQueryLanguageCondition extends \Google\Protobuf\Internal\Message +{ + /** + * [Monitoring Query Language](https://cloud.google.com/monitoring/mql) + * query that outputs a boolean stream. + * + * Generated from protobuf field string query = 1; + */ + protected $query = ''; + /** + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + */ + protected $duration = null; + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + */ + protected $trigger = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * [Monitoring Query Language](https://cloud.google.com/monitoring/mql) + * query that outputs a boolean stream. + * @type \Google\Protobuf\Duration $duration + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $trigger + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * [Monitoring Query Language](https://cloud.google.com/monitoring/mql) + * query that outputs a boolean stream. + * + * Generated from protobuf field string query = 1; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * [Monitoring Query Language](https://cloud.google.com/monitoring/mql) + * query that outputs a boolean stream. + * + * Generated from protobuf field string query = 1; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * The amount of time that a time series must violate the + * threshold to be considered failing. Currently, only values + * that are a multiple of a minute--e.g., 0, 60, 120, or 300 + * seconds--are supported. If an invalid value is given, an + * error will be returned. When choosing a duration, it is useful to + * keep in mind the frequency of the underlying time series data + * (which may also be affected by any alignments specified in the + * `aggregations` field); a good duration is long enough so that a single + * outlier does not generate spurious alerts, but short enough that + * unhealthy states are detected and alerted on quickly. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger|null + */ + public function getTrigger() + { + return $this->trigger; + } + + public function hasTrigger() + { + return isset($this->trigger); + } + + public function clearTrigger() + { + unset($this->trigger); + } + + /** + * The number/percent of time series for which the comparison must hold + * in order for the condition to trigger. If unspecified, then the + * condition will trigger if the comparison is true for any of the + * time series that have been identified by `filter` and `aggregations`, + * or by the ratio, if `denominator_filter` and `denominator_aggregations` + * are specified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $var + * @return $this + */ + public function setTrigger($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger::class); + $this->trigger = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MonitoringQueryLanguageCondition::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MonitoringQueryLanguageCondition::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php new file mode 100644 index 00000000000..8daaca29380 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php @@ -0,0 +1,118 @@ +google.monitoring.v3.AlertPolicy.Condition.Trigger + */ +class Trigger extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $count + * The absolute number of time series that must fail + * the predicate for the condition to be triggered. + * @type float $percent + * The percentage of time series that must fail the + * predicate for the condition to be triggered. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * The absolute number of time series that must fail + * the predicate for the condition to be triggered. + * + * Generated from protobuf field int32 count = 1; + * @return int + */ + public function getCount() + { + return $this->readOneof(1); + } + + public function hasCount() + { + return $this->hasOneof(1); + } + + /** + * The absolute number of time series that must fail + * the predicate for the condition to be triggered. + * + * Generated from protobuf field int32 count = 1; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The percentage of time series that must fail the + * predicate for the condition to be triggered. + * + * Generated from protobuf field double percent = 2; + * @return float + */ + public function getPercent() + { + return $this->readOneof(2); + } + + public function hasPercent() + { + return $this->hasOneof(2); + } + + /** + * The percentage of time series that must fail the + * predicate for the condition to be triggered. + * + * Generated from protobuf field double percent = 2; + * @param float $var + * @return $this + */ + public function setPercent($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Trigger::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_Trigger::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php new file mode 100644 index 00000000000..e5ef69156da --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php @@ -0,0 +1,77 @@ +google.monitoring.v3.AlertPolicy.ConditionCombinerType + */ +class ConditionCombinerType +{ + /** + * An unspecified combiner. + * + * Generated from protobuf enum COMBINE_UNSPECIFIED = 0; + */ + const COMBINE_UNSPECIFIED = 0; + /** + * Combine conditions using the logical `AND` operator. An + * incident is created only if all the conditions are met + * simultaneously. This combiner is satisfied if all conditions are + * met, even if they are met on completely different resources. + * + * Generated from protobuf enum AND = 1; + */ + const PBAND = 1; + /** + * Combine conditions using the logical `OR` operator. An incident + * is created if any of the listed conditions is met. + * + * Generated from protobuf enum OR = 2; + */ + const PBOR = 2; + /** + * Combine conditions using logical `AND` operator, but unlike the regular + * `AND` option, an incident is created only if all conditions are met + * simultaneously on at least one resource. + * + * Generated from protobuf enum AND_WITH_MATCHING_RESOURCE = 3; + */ + const AND_WITH_MATCHING_RESOURCE = 3; + + private static $valueToName = [ + self::COMBINE_UNSPECIFIED => 'COMBINE_UNSPECIFIED', + self::PBAND => 'PBAND', + self::PBOR => 'PBOR', + self::AND_WITH_MATCHING_RESOURCE => 'AND_WITH_MATCHING_RESOURCE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConditionCombinerType::class, \Google\Cloud\Monitoring\V3\AlertPolicy_ConditionCombinerType::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php new file mode 100644 index 00000000000..318234b3eeb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php @@ -0,0 +1,125 @@ +google.monitoring.v3.AlertPolicy.Documentation + */ +class Documentation extends \Google\Protobuf\Internal\Message +{ + /** + * The text of the documentation, interpreted according to `mime_type`. + * The content may not exceed 8,192 Unicode characters and may not exceed + * more than 10,240 bytes when encoded in UTF-8 format, whichever is + * smaller. + * + * Generated from protobuf field string content = 1; + */ + protected $content = ''; + /** + * The format of the `content` field. Presently, only the value + * `"text/markdown"` is supported. See + * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. + * + * Generated from protobuf field string mime_type = 2; + */ + protected $mime_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * The text of the documentation, interpreted according to `mime_type`. + * The content may not exceed 8,192 Unicode characters and may not exceed + * more than 10,240 bytes when encoded in UTF-8 format, whichever is + * smaller. + * @type string $mime_type + * The format of the `content` field. Presently, only the value + * `"text/markdown"` is supported. See + * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * The text of the documentation, interpreted according to `mime_type`. + * The content may not exceed 8,192 Unicode characters and may not exceed + * more than 10,240 bytes when encoded in UTF-8 format, whichever is + * smaller. + * + * Generated from protobuf field string content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * The text of the documentation, interpreted according to `mime_type`. + * The content may not exceed 8,192 Unicode characters and may not exceed + * more than 10,240 bytes when encoded in UTF-8 format, whichever is + * smaller. + * + * Generated from protobuf field string content = 1; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * The format of the `content` field. Presently, only the value + * `"text/markdown"` is supported. See + * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. + * + * Generated from protobuf field string mime_type = 2; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * The format of the `content` field. Presently, only the value + * `"text/markdown"` is supported. See + * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. + * + * Generated from protobuf field string mime_type = 2; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Documentation::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Documentation::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicyServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicyServiceGrpcClient.php new file mode 100644 index 00000000000..d6f646e9452 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicyServiceGrpcClient.php @@ -0,0 +1,121 @@ +_simpleRequest('/google.monitoring.v3.AlertPolicyService/ListAlertPolicies', + $argument, + ['\Google\Cloud\Monitoring\V3\ListAlertPoliciesResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a single alerting policy. + * @param \Google\Cloud\Monitoring\V3\GetAlertPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetAlertPolicy(\Google\Cloud\Monitoring\V3\GetAlertPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/GetAlertPolicy', + $argument, + ['\Google\Cloud\Monitoring\V3\AlertPolicy', 'decode'], + $metadata, $options); + } + + /** + * Creates a new alerting policy. + * @param \Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateAlertPolicy(\Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy', + $argument, + ['\Google\Cloud\Monitoring\V3\AlertPolicy', 'decode'], + $metadata, $options); + } + + /** + * Deletes an alerting policy. + * @param \Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteAlertPolicy(\Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Updates an alerting policy. You can either replace the entire policy with + * a new one or replace only certain fields in the current alerting policy by + * specifying the fields to be updated via `updateMask`. Returns the + * updated alerting policy. + * @param \Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateAlertPolicy(\Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy', + $argument, + ['\Google\Cloud\Monitoring\V3\AlertPolicy', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy.php new file mode 100644 index 00000000000..91a1654533a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy.php @@ -0,0 +1,16 @@ +google.monitoring.v3.BasicSli + */ +class BasicSli extends \Google\Protobuf\Internal\Message +{ + /** + * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + * other methods will not be used to calculate performance for this SLI. If + * omitted, this SLI applies to all the Service's methods. For service types + * that don't support breaking down by method, setting this field will result + * in an error. + * + * Generated from protobuf field repeated string method = 7; + */ + private $method; + /** + * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + * from other locations will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all locations in which the Service has + * activity. For service types that don't support breaking down by location, + * setting this field will result in an error. + * + * Generated from protobuf field repeated string location = 8; + */ + private $location; + /** + * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + * from other API versions will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all API versions. For service types + * that don't support breaking down by version, setting this field will result + * in an error. + * + * Generated from protobuf field repeated string version = 9; + */ + private $version; + protected $sli_criteria; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[]|\Google\Protobuf\Internal\RepeatedField $method + * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + * other methods will not be used to calculate performance for this SLI. If + * omitted, this SLI applies to all the Service's methods. For service types + * that don't support breaking down by method, setting this field will result + * in an error. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $location + * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + * from other locations will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all locations in which the Service has + * activity. For service types that don't support breaking down by location, + * setting this field will result in an error. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $version + * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + * from other API versions will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all API versions. For service types + * that don't support breaking down by version, setting this field will result + * in an error. + * @type \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria $availability + * Good service is defined to be the count of requests made to this service + * that return successfully. + * @type \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria $latency + * Good service is defined to be the count of requests made to this service + * that are fast enough with respect to `latency.threshold`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + * other methods will not be used to calculate performance for this SLI. If + * omitted, this SLI applies to all the Service's methods. For service types + * that don't support breaking down by method, setting this field will result + * in an error. + * + * Generated from protobuf field repeated string method = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethod() + { + return $this->method; + } + + /** + * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from + * other methods will not be used to calculate performance for this SLI. If + * omitted, this SLI applies to all the Service's methods. For service types + * that don't support breaking down by method, setting this field will result + * in an error. + * + * Generated from protobuf field repeated string method = 7; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethod($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->method = $arr; + + return $this; + } + + /** + * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + * from other locations will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all locations in which the Service has + * activity. For service types that don't support breaking down by location, + * setting this field will result in an error. + * + * Generated from protobuf field repeated string location = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocation() + { + return $this->location; + } + + /** + * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry + * from other locations will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all locations in which the Service has + * activity. For service types that don't support breaking down by location, + * setting this field will result in an error. + * + * Generated from protobuf field repeated string location = 8; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->location = $arr; + + return $this; + } + + /** + * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + * from other API versions will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all API versions. For service types + * that don't support breaking down by version, setting this field will result + * in an error. + * + * Generated from protobuf field repeated string version = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVersion() + { + return $this->version; + } + + /** + * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry + * from other API versions will not be used to calculate performance for this + * SLI. If omitted, this SLI applies to all API versions. For service types + * that don't support breaking down by version, setting this field will result + * in an error. + * + * Generated from protobuf field repeated string version = 9; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVersion($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->version = $arr; + + return $this; + } + + /** + * Good service is defined to be the count of requests made to this service + * that return successfully. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + * @return \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria|null + */ + public function getAvailability() + { + return $this->readOneof(2); + } + + public function hasAvailability() + { + return $this->hasOneof(2); + } + + /** + * Good service is defined to be the count of requests made to this service + * that return successfully. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; + * @param \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria $var + * @return $this + */ + public function setAvailability($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Good service is defined to be the count of requests made to this service + * that are fast enough with respect to `latency.threshold`. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + * @return \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria|null + */ + public function getLatency() + { + return $this->readOneof(3); + } + + public function hasLatency() + { + return $this->hasOneof(3); + } + + /** + * Good service is defined to be the count of requests made to this service + * that are fast enough with respect to `latency.threshold`. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; + * @param \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria $var + * @return $this + */ + public function setLatency($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSliCriteria() + { + return $this->whichOneof("sli_criteria"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php new file mode 100644 index 00000000000..39790b19ee0 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php @@ -0,0 +1,36 @@ +google.monitoring.v3.BasicSli.AvailabilityCriteria + */ +class AvailabilityCriteria extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AvailabilityCriteria::class, \Google\Cloud\Monitoring\V3\BasicSli_AvailabilityCriteria::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php new file mode 100644 index 00000000000..331b6b6e46f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php @@ -0,0 +1,84 @@ +google.monitoring.v3.BasicSli.LatencyCriteria + */ +class LatencyCriteria extends \Google\Protobuf\Internal\Message +{ + /** + * Good service is defined to be the count of requests made to this service + * that return in no more than `threshold`. + * + * Generated from protobuf field .google.protobuf.Duration threshold = 3; + */ + protected $threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $threshold + * Good service is defined to be the count of requests made to this service + * that return in no more than `threshold`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * Good service is defined to be the count of requests made to this service + * that return in no more than `threshold`. + * + * Generated from protobuf field .google.protobuf.Duration threshold = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getThreshold() + { + return $this->threshold; + } + + public function hasThreshold() + { + return isset($this->threshold); + } + + public function clearThreshold() + { + unset($this->threshold); + } + + /** + * Good service is defined to be the count of requests made to this service + * that return in no more than `threshold`. + * + * Generated from protobuf field .google.protobuf.Duration threshold = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->threshold = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LatencyCriteria::class, \Google\Cloud\Monitoring\V3\BasicSli_LatencyCriteria::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli_AvailabilityCriteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli_AvailabilityCriteria.php new file mode 100644 index 00000000000..c03c272583e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli_AvailabilityCriteria.php @@ -0,0 +1,16 @@ +google.monitoring.v3.ComparisonType + */ +class ComparisonType +{ + /** + * No ordering relationship is specified. + * + * Generated from protobuf enum COMPARISON_UNSPECIFIED = 0; + */ + const COMPARISON_UNSPECIFIED = 0; + /** + * True if the left argument is greater than the right argument. + * + * Generated from protobuf enum COMPARISON_GT = 1; + */ + const COMPARISON_GT = 1; + /** + * True if the left argument is greater than or equal to the right argument. + * + * Generated from protobuf enum COMPARISON_GE = 2; + */ + const COMPARISON_GE = 2; + /** + * True if the left argument is less than the right argument. + * + * Generated from protobuf enum COMPARISON_LT = 3; + */ + const COMPARISON_LT = 3; + /** + * True if the left argument is less than or equal to the right argument. + * + * Generated from protobuf enum COMPARISON_LE = 4; + */ + const COMPARISON_LE = 4; + /** + * True if the left argument is equal to the right argument. + * + * Generated from protobuf enum COMPARISON_EQ = 5; + */ + const COMPARISON_EQ = 5; + /** + * True if the left argument is not equal to the right argument. + * + * Generated from protobuf enum COMPARISON_NE = 6; + */ + const COMPARISON_NE = 6; + + private static $valueToName = [ + self::COMPARISON_UNSPECIFIED => 'COMPARISON_UNSPECIFIED', + self::COMPARISON_GT => 'COMPARISON_GT', + self::COMPARISON_GE => 'COMPARISON_GE', + self::COMPARISON_LT => 'COMPARISON_LT', + self::COMPARISON_LE => 'COMPARISON_LE', + self::COMPARISON_EQ => 'COMPARISON_EQ', + self::COMPARISON_NE => 'COMPARISON_NE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php new file mode 100644 index 00000000000..c0095e61d9a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php @@ -0,0 +1,155 @@ +google.monitoring.v3.CreateAlertPolicyRequest + */ +class CreateAlertPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the alerting policy. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The requested alerting policy. You should omit the `name` field in this + * policy. The name will be returned in the new policy, including + * a new `[ALERT_POLICY_ID]` value. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $alert_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the alerting policy. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy $alert_policy + * Required. The requested alerting policy. You should omit the `name` field in this + * policy. The name will be returned in the new policy, including + * a new `[ALERT_POLICY_ID]` value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the alerting policy. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the alerting policy. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The requested alerting policy. You should omit the `name` field in this + * policy. The name will be returned in the new policy, including + * a new `[ALERT_POLICY_ID]` value. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy|null + */ + public function getAlertPolicy() + { + return $this->alert_policy; + } + + public function hasAlertPolicy() + { + return isset($this->alert_policy); + } + + public function clearAlertPolicy() + { + unset($this->alert_policy); + } + + /** + * Required. The requested alerting policy. You should omit the `name` field in this + * policy. The name will be returned in the new policy, including + * a new `[ALERT_POLICY_ID]` value. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy $var + * @return $this + */ + public function setAlertPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy::class); + $this->alert_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php new file mode 100644 index 00000000000..5cfb0a4a94c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php @@ -0,0 +1,157 @@ +google.monitoring.v3.CreateGroupRequest + */ +class CreateGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the group. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. A group definition. It is an error to define the `name` field because + * the system assigns the name. + * + * Generated from protobuf field .google.monitoring.v3.Group group = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $group = null; + /** + * If true, validate this request but do not create the group. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the group. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type \Google\Cloud\Monitoring\V3\Group $group + * Required. A group definition. It is an error to define the `name` field because + * the system assigns the name. + * @type bool $validate_only + * If true, validate this request but do not create the group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the group. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the group. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. A group definition. It is an error to define the `name` field because + * the system assigns the name. + * + * Generated from protobuf field .google.monitoring.v3.Group group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Group|null + */ + public function getGroup() + { + return $this->group; + } + + public function hasGroup() + { + return isset($this->group); + } + + public function clearGroup() + { + unset($this->group); + } + + /** + * Required. A group definition. It is an error to define the `name` field because + * the system assigns the name. + * + * Generated from protobuf field .google.monitoring.v3.Group group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Group $var + * @return $this + */ + public function setGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Group::class); + $this->group = $var; + + return $this; + } + + /** + * If true, validate this request but do not create the group. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * If true, validate this request but do not create the group. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php new file mode 100644 index 00000000000..7ebf8e384c8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php @@ -0,0 +1,127 @@ +google.monitoring.v3.CreateMetricDescriptorRequest + */ +class CreateMetricDescriptorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * 4 + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) + * descriptor. + * + * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $metric_descriptor = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * 4 + * projects/[PROJECT_ID_OR_NUMBER] + * @type \Google\Api\MetricDescriptor $metric_descriptor + * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) + * descriptor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * 4 + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * 4 + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) + * descriptor. + * + * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Api\MetricDescriptor|null + */ + public function getMetricDescriptor() + { + return $this->metric_descriptor; + } + + public function hasMetricDescriptor() + { + return isset($this->metric_descriptor); + } + + public function clearMetricDescriptor() + { + unset($this->metric_descriptor); + } + + /** + * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) + * descriptor. + * + * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Api\MetricDescriptor $var + * @return $this + */ + public function setMetricDescriptor($var) + { + GPBUtil::checkMessage($var, \Google\Api\MetricDescriptor::class); + $this->metric_descriptor = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php new file mode 100644 index 00000000000..6410588460c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php @@ -0,0 +1,135 @@ +google.monitoring.v3.CreateNotificationChannelRequest + */ +class CreateNotificationChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container into which the channel will be + * written, this does not name the newly created channel. The resulting + * channel's name will have a normalized version of this field as a prefix, + * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The definition of the `NotificationChannel` to create. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel notification_channel = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notification_channel = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container into which the channel will be + * written, this does not name the newly created channel. The resulting + * channel's name will have a normalized version of this field as a prefix, + * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. + * @type \Google\Cloud\Monitoring\V3\NotificationChannel $notification_channel + * Required. The definition of the `NotificationChannel` to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container into which the channel will be + * written, this does not name the newly created channel. The resulting + * channel's name will have a normalized version of this field as a prefix, + * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container into which the channel will be + * written, this does not name the newly created channel. The resulting + * channel's name will have a normalized version of this field as a prefix, + * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The definition of the `NotificationChannel` to create. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel notification_channel = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\NotificationChannel|null + */ + public function getNotificationChannel() + { + return $this->notification_channel; + } + + public function hasNotificationChannel() + { + return isset($this->notification_channel); + } + + public function clearNotificationChannel() + { + unset($this->notification_channel); + } + + /** + * Required. The definition of the `NotificationChannel` to create. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel notification_channel = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\NotificationChannel $var + * @return $this + */ + public function setNotificationChannel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\NotificationChannel::class); + $this->notification_channel = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php new file mode 100644 index 00000000000..8d3f20ef662 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php @@ -0,0 +1,165 @@ +google.monitoring.v3.CreateServiceLevelObjectiveRequest + */ +class CreateServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern `[a-z0-9\-]+` + * + * Generated from protobuf field string service_level_objective_id = 3; + */ + protected $service_level_objective_id = ''; + /** + * Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_level_objective = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @type string $service_level_objective_id + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern `[a-z0-9\-]+` + * @type \Google\Cloud\Monitoring\V3\ServiceLevelObjective $service_level_objective + * Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the parent `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern `[a-z0-9\-]+` + * + * Generated from protobuf field string service_level_objective_id = 3; + * @return string + */ + public function getServiceLevelObjectiveId() + { + return $this->service_level_objective_id; + } + + /** + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern `[a-z0-9\-]+` + * + * Generated from protobuf field string service_level_objective_id = 3; + * @param string $var + * @return $this + */ + public function setServiceLevelObjectiveId($var) + { + GPBUtil::checkString($var, True); + $this->service_level_objective_id = $var; + + return $this; + } + + /** + * Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective|null + */ + public function getServiceLevelObjective() + { + return $this->service_level_objective; + } + + public function hasServiceLevelObjective() + { + return isset($this->service_level_objective); + } + + public function clearServiceLevelObjective() + { + unset($this->service_level_objective); + } + + /** + * Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $var + * @return $this + */ + public function setServiceLevelObjective($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective::class); + $this->service_level_objective = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php new file mode 100644 index 00000000000..ceefd3576a8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php @@ -0,0 +1,157 @@ +google.monitoring.v3.CreateServiceRequest + */ +class CreateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern `[a-z0-9\-]+` + * + * Generated from protobuf field string service_id = 3; + */ + protected $service_id = ''; + /** + * Required. The `Service` to create. + * + * Generated from protobuf field .google.monitoring.v3.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type string $service_id + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern `[a-z0-9\-]+` + * @type \Google\Cloud\Monitoring\V3\Service $service + * Required. The `Service` to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern `[a-z0-9\-]+` + * + * Generated from protobuf field string service_id = 3; + * @return string + */ + public function getServiceId() + { + return $this->service_id; + } + + /** + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern `[a-z0-9\-]+` + * + * Generated from protobuf field string service_id = 3; + * @param string $var + * @return $this + */ + public function setServiceId($var) + { + GPBUtil::checkString($var, True); + $this->service_id = $var; + + return $this; + } + + /** + * Required. The `Service` to create. + * + * Generated from protobuf field .google.monitoring.v3.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The `Service` to create. + * + * Generated from protobuf field .google.monitoring.v3.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service::class); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php new file mode 100644 index 00000000000..556d57d6608 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php @@ -0,0 +1,135 @@ +google.monitoring.v3.CreateTimeSeriesError + */ +class CreateTimeSeriesError extends \Google\Protobuf\Internal\Message +{ + /** + * DEPRECATED. Time series ID that resulted in the `status` error. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; + * @deprecated + */ + protected $time_series = null; + /** + * DEPRECATED. The status of the requested write operation for `time_series`. + * + * Generated from protobuf field .google.rpc.Status status = 2 [deprecated = true]; + * @deprecated + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\TimeSeries $time_series + * DEPRECATED. Time series ID that resulted in the `status` error. + * @type \Google\Rpc\Status $status + * DEPRECATED. The status of the requested write operation for `time_series`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * DEPRECATED. Time series ID that resulted in the `status` error. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; + * @return \Google\Cloud\Monitoring\V3\TimeSeries|null + * @deprecated + */ + public function getTimeSeries() + { + @trigger_error('time_series is deprecated.', E_USER_DEPRECATED); + return $this->time_series; + } + + public function hasTimeSeries() + { + @trigger_error('time_series is deprecated.', E_USER_DEPRECATED); + return isset($this->time_series); + } + + public function clearTimeSeries() + { + @trigger_error('time_series is deprecated.', E_USER_DEPRECATED); + unset($this->time_series); + } + + /** + * DEPRECATED. Time series ID that resulted in the `status` error. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeries time_series = 1 [deprecated = true]; + * @param \Google\Cloud\Monitoring\V3\TimeSeries $var + * @return $this + * @deprecated + */ + public function setTimeSeries($var) + { + @trigger_error('time_series is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeSeries::class); + $this->time_series = $var; + + return $this; + } + + /** + * DEPRECATED. The status of the requested write operation for `time_series`. + * + * Generated from protobuf field .google.rpc.Status status = 2 [deprecated = true]; + * @return \Google\Rpc\Status|null + * @deprecated + */ + public function getStatus() + { + @trigger_error('status is deprecated.', E_USER_DEPRECATED); + return $this->status; + } + + public function hasStatus() + { + @trigger_error('status is deprecated.', E_USER_DEPRECATED); + return isset($this->status); + } + + public function clearStatus() + { + @trigger_error('status is deprecated.', E_USER_DEPRECATED); + unset($this->status); + } + + /** + * DEPRECATED. The status of the requested write operation for `time_series`. + * + * Generated from protobuf field .google.rpc.Status status = 2 [deprecated = true]; + * @param \Google\Rpc\Status $var + * @return $this + * @deprecated + */ + public function setStatus($var) + { + @trigger_error('status is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php new file mode 100644 index 00000000000..f1432656f71 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php @@ -0,0 +1,129 @@ +google.monitoring.v3.CreateTimeSeriesRequest + */ +class CreateTimeSeriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The new data to be added to a list of time series. + * Adds at most one data point to each of several time series. The new data + * point must be more recent than any other point in its time series. Each + * `TimeSeries` value must fully specify a unique time series by supplying + * all label values for the metric and the monitored resource. + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $time_series; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $time_series + * Required. The new data to be added to a list of time series. + * Adds at most one data point to each of several time series. The new data + * point must be more recent than any other point in its time series. Each + * `TimeSeries` value must fully specify a unique time series by supplying + * all label values for the metric and the monitored resource. + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The new data to be added to a list of time series. + * Adds at most one data point to each of several time series. The new data + * point must be more recent than any other point in its time series. Each + * `TimeSeries` value must fully specify a unique time series by supplying + * all label values for the metric and the monitored resource. + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimeSeries() + { + return $this->time_series; + } + + /** + * Required. The new data to be added to a list of time series. + * Adds at most one data point to each of several time series. The new data + * point must be more recent than any other point in its time series. Each + * `TimeSeries` value must fully specify a unique time series by supplying + * all label values for the metric and the monitored resource. + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimeSeries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeries::class); + $this->time_series = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php new file mode 100644 index 00000000000..6f92829d5d5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php @@ -0,0 +1,135 @@ +google.monitoring.v3.CreateTimeSeriesSummary + */ +class CreateTimeSeriesSummary extends \Google\Protobuf\Internal\Message +{ + /** + * The number of points in the request. + * + * Generated from protobuf field int32 total_point_count = 1; + */ + protected $total_point_count = 0; + /** + * The number of points that were successfully written. + * + * Generated from protobuf field int32 success_point_count = 2; + */ + protected $success_point_count = 0; + /** + * The number of points that failed to be written. Order is not guaranteed. + * + * Generated from protobuf field repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + */ + private $errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $total_point_count + * The number of points in the request. + * @type int $success_point_count + * The number of points that were successfully written. + * @type \Google\Cloud\Monitoring\V3\CreateTimeSeriesSummary\Error[]|\Google\Protobuf\Internal\RepeatedField $errors + * The number of points that failed to be written. Order is not guaranteed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * The number of points in the request. + * + * Generated from protobuf field int32 total_point_count = 1; + * @return int + */ + public function getTotalPointCount() + { + return $this->total_point_count; + } + + /** + * The number of points in the request. + * + * Generated from protobuf field int32 total_point_count = 1; + * @param int $var + * @return $this + */ + public function setTotalPointCount($var) + { + GPBUtil::checkInt32($var); + $this->total_point_count = $var; + + return $this; + } + + /** + * The number of points that were successfully written. + * + * Generated from protobuf field int32 success_point_count = 2; + * @return int + */ + public function getSuccessPointCount() + { + return $this->success_point_count; + } + + /** + * The number of points that were successfully written. + * + * Generated from protobuf field int32 success_point_count = 2; + * @param int $var + * @return $this + */ + public function setSuccessPointCount($var) + { + GPBUtil::checkInt32($var); + $this->success_point_count = $var; + + return $this; + } + + /** + * The number of points that failed to be written. Order is not guaranteed. + * + * Generated from protobuf field repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * The number of points that failed to be written. Order is not guaranteed. + * + * Generated from protobuf field repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; + * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesSummary\Error[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\CreateTimeSeriesSummary\Error::class); + $this->errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php new file mode 100644 index 00000000000..5bd917825b9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php @@ -0,0 +1,114 @@ +google.monitoring.v3.CreateTimeSeriesSummary.Error + */ +class Error extends \Google\Protobuf\Internal\Message +{ + /** + * The status of the requested write operation. + * + * Generated from protobuf field .google.rpc.Status status = 1; + */ + protected $status = null; + /** + * The number of points that couldn't be written because of `status`. + * + * Generated from protobuf field int32 point_count = 2; + */ + protected $point_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $status + * The status of the requested write operation. + * @type int $point_count + * The number of points that couldn't be written because of `status`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * The status of the requested write operation. + * + * Generated from protobuf field .google.rpc.Status status = 1; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of the requested write operation. + * + * Generated from protobuf field .google.rpc.Status status = 1; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + + /** + * The number of points that couldn't be written because of `status`. + * + * Generated from protobuf field int32 point_count = 2; + * @return int + */ + public function getPointCount() + { + return $this->point_count; + } + + /** + * The number of points that couldn't be written because of `status`. + * + * Generated from protobuf field int32 point_count = 2; + * @param int $var + * @return $this + */ + public function setPointCount($var) + { + GPBUtil::checkInt32($var); + $this->point_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Error::class, \Google\Cloud\Monitoring\V3\CreateTimeSeriesSummary_Error::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary_Error.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary_Error.php new file mode 100644 index 00000000000..c67ed832082 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary_Error.php @@ -0,0 +1,16 @@ +google.monitoring.v3.CreateUptimeCheckConfigRequest + */ +class CreateUptimeCheckConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the Uptime check. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The new Uptime check configuration. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uptime_check_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the Uptime check. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptime_check_config + * Required. The new Uptime check configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the Uptime check. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the Uptime check. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The new Uptime check configuration. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig|null + */ + public function getUptimeCheckConfig() + { + return $this->uptime_check_config; + } + + public function hasUptimeCheckConfig() + { + return isset($this->uptime_check_config); + } + + public function clearUptimeCheckConfig() + { + unset($this->uptime_check_config); + } + + /** + * Required. The new Uptime check configuration. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig $var + * @return $this + */ + public function setUptimeCheckConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig::class); + $this->uptime_check_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php new file mode 100644 index 00000000000..cd0c679c15c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php @@ -0,0 +1,75 @@ +google.monitoring.v3.DeleteAlertPolicyRequest + */ +class DeleteAlertPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The alerting policy to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The alerting policy to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The alerting policy to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The alerting policy to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php new file mode 100644 index 00000000000..abdd5172be3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php @@ -0,0 +1,114 @@ +google.monitoring.v3.DeleteGroupRequest + */ +class DeleteGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The group to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If this field is true, then the request means to delete a group with all + * its descendants. Otherwise, the request means to delete a group only when + * it has no descendants. The default value is false. + * + * Generated from protobuf field bool recursive = 4; + */ + protected $recursive = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The group to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @type bool $recursive + * If this field is true, then the request means to delete a group with all + * its descendants. Otherwise, the request means to delete a group only when + * it has no descendants. The default value is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The group to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The group to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If this field is true, then the request means to delete a group with all + * its descendants. Otherwise, the request means to delete a group only when + * it has no descendants. The default value is false. + * + * Generated from protobuf field bool recursive = 4; + * @return bool + */ + public function getRecursive() + { + return $this->recursive; + } + + /** + * If this field is true, then the request means to delete a group with all + * its descendants. Otherwise, the request means to delete a group only when + * it has no descendants. The default value is false. + * + * Generated from protobuf field bool recursive = 4; + * @param bool $var + * @return $this + */ + public function setRecursive($var) + { + GPBUtil::checkBool($var); + $this->recursive = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php new file mode 100644 index 00000000000..a324673311b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php @@ -0,0 +1,79 @@ +google.monitoring.v3.DeleteMetricDescriptorRequest + */ +class DeleteMetricDescriptorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example of `[METRIC_ID]` is: + * `"custom.googleapis.com/my_test_metric"`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example of `[METRIC_ID]` is: + * `"custom.googleapis.com/my_test_metric"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example of `[METRIC_ID]` is: + * `"custom.googleapis.com/my_test_metric"`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example of `[METRIC_ID]` is: + * `"custom.googleapis.com/my_test_metric"`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php new file mode 100644 index 00000000000..4e669ca146c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php @@ -0,0 +1,117 @@ +google.monitoring.v3.DeleteNotificationChannelRequest + */ +class DeleteNotificationChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If true, the notification channel will be deleted regardless of its + * use in alert policies (the policies will be updated to remove the + * channel). If false, channels that are still referenced by an existing + * alerting policy will fail to be deleted in a delete operation. + * + * Generated from protobuf field bool force = 5; + */ + protected $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @type bool $force + * If true, the notification channel will be deleted regardless of its + * use in alert policies (the policies will be updated to remove the + * channel). If false, channels that are still referenced by an existing + * alerting policy will fail to be deleted in a delete operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If true, the notification channel will be deleted regardless of its + * use in alert policies (the policies will be updated to remove the + * channel). If false, channels that are still referenced by an existing + * alerting policy will fail to be deleted in a delete operation. + * + * Generated from protobuf field bool force = 5; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * If true, the notification channel will be deleted regardless of its + * use in alert policies (the policies will be updated to remove the + * channel). If false, channels that are still referenced by an existing + * alerting policy will fail to be deleted in a delete operation. + * + * Generated from protobuf field bool force = 5; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php new file mode 100644 index 00000000000..5ded10c0c5e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.DeleteServiceLevelObjectiveRequest + */ +class DeleteServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php new file mode 100644 index 00000000000..6d45727d887 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.DeleteServiceRequest + */ +class DeleteServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the `Service` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the `Service` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the `Service` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the `Service` to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php new file mode 100644 index 00000000000..4b4db12f615 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.DeleteUptimeCheckConfigRequest + */ +class DeleteUptimeCheckConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Uptime check configuration to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Uptime check configuration to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Uptime check configuration to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Uptime check configuration to delete. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php new file mode 100644 index 00000000000..cffd93e1651 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php @@ -0,0 +1,127 @@ +google.monitoring.v3.DistributionCut + */ +class DistributionCut extends \Google\Protobuf\Internal\Message +{ + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` aggregating values. Must have `ValueType = + * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string distribution_filter = 4; + */ + protected $distribution_filter = ''; + /** + * Range of values considered "good." For a one-sided range, set one bound to + * an infinite value. + * + * Generated from protobuf field .google.monitoring.v3.Range range = 5; + */ + protected $range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $distribution_filter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` aggregating values. Must have `ValueType = + * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * @type \Google\Cloud\Monitoring\V3\Range $range + * Range of values considered "good." For a one-sided range, set one bound to + * an infinite value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` aggregating values. Must have `ValueType = + * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string distribution_filter = 4; + * @return string + */ + public function getDistributionFilter() + { + return $this->distribution_filter; + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` aggregating values. Must have `ValueType = + * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string distribution_filter = 4; + * @param string $var + * @return $this + */ + public function setDistributionFilter($var) + { + GPBUtil::checkString($var, True); + $this->distribution_filter = $var; + + return $this; + } + + /** + * Range of values considered "good." For a one-sided range, set one bound to + * an infinite value. + * + * Generated from protobuf field .google.monitoring.v3.Range range = 5; + * @return \Google\Cloud\Monitoring\V3\Range|null + */ + public function getRange() + { + return $this->range; + } + + public function hasRange() + { + return isset($this->range); + } + + public function clearRange() + { + unset($this->range); + } + + /** + * Range of values considered "good." For a one-sided range, set one bound to + * an infinite value. + * + * Generated from protobuf field .google.monitoring.v3.Range range = 5; + * @param \Google\Cloud\Monitoring\V3\Range $var + * @return $this + */ + public function setRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Range::class); + $this->range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php new file mode 100644 index 00000000000..4fb73d3bdd7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php @@ -0,0 +1,80 @@ +google.monitoring.v3.DroppedLabels + */ +class DroppedLabels extends \Google\Protobuf\Internal\Message +{ + /** + * Map from label to its value, for all labels dropped in any aggregation. + * + * Generated from protobuf field map label = 1; + */ + private $label; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $label + * Map from label to its value, for all labels dropped in any aggregation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\DroppedLabels::initOnce(); + parent::__construct($data); + } + + /** + * Map from label to its value, for all labels dropped in any aggregation. + * + * Generated from protobuf field map label = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabel() + { + return $this->label; + } + + /** + * Map from label to its value, for all labels dropped in any aggregation. + * + * Generated from protobuf field map label = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabel($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->label = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php new file mode 100644 index 00000000000..9d787e9c0f1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.GetAlertPolicyRequest + */ +class GetAlertPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The alerting policy to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The alerting policy to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The alerting policy to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The alerting policy to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php new file mode 100644 index 00000000000..cb684cb0df7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.GetGroupRequest + */ +class GetGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The group to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The group to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The group to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The group to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php new file mode 100644 index 00000000000..484810b3d65 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php @@ -0,0 +1,79 @@ +google.monitoring.v3.GetMetricDescriptorRequest + */ +class GetMetricDescriptorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example value of `[METRIC_ID]` is + * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example value of `[METRIC_ID]` is + * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example value of `[METRIC_ID]` is + * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The metric descriptor on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * An example value of `[METRIC_ID]` is + * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php new file mode 100644 index 00000000000..b670eae6406 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php @@ -0,0 +1,79 @@ +google.monitoring.v3.GetMonitoredResourceDescriptorRequest + */ +class GetMonitoredResourceDescriptorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The monitored resource descriptor to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * The `[RESOURCE_TYPE]` is a predefined type, such as + * `cloudsql_database`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The monitored resource descriptor to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * The `[RESOURCE_TYPE]` is a predefined type, such as + * `cloudsql_database`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The monitored resource descriptor to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * The `[RESOURCE_TYPE]` is a predefined type, such as + * `cloudsql_database`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The monitored resource descriptor to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * The `[RESOURCE_TYPE]` is a predefined type, such as + * `cloudsql_database`. + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php new file mode 100644 index 00000000000..8127d3ecfc6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.GetNotificationChannelDescriptorRequest + */ +class GetNotificationChannelDescriptorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The channel type for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The channel type for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The channel type for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The channel type for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php new file mode 100644 index 00000000000..6fa708d810d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.GetNotificationChannelRequest + */ +class GetNotificationChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The channel for which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php new file mode 100644 index 00000000000..7bedf1e9a03 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php @@ -0,0 +1,151 @@ +google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + */ +class GetNotificationChannelVerificationCodeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if + * the specified channel is not verified, the request will fail. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be + * valid for at least as long as the requested time (the API puts an upper + * bound on the amount of time for which a code may be valid). If omitted, + * a default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2; + */ + protected $expire_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if + * the specified channel is not verified, the request will fail. + * @type \Google\Protobuf\Timestamp $expire_time + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be + * valid for at least as long as the requested time (the API puts an upper + * bound on the amount of time for which a code may be valid). If omitted, + * a default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if + * the specified channel is not verified, the request will fail. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if + * the specified channel is not verified, the request will fail. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be + * valid for at least as long as the requested time (the API puts an upper + * bound on the amount of time for which a code may be valid). If omitted, + * a default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be + * valid for at least as long as the requested time (the API puts an upper + * bound on the amount of time for which a code may be valid). If omitted, + * a default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php new file mode 100644 index 00000000000..b62d064177a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php @@ -0,0 +1,131 @@ +google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + */ +class GetNotificationChannelVerificationCodeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The verification code, which may be used to verify other channels + * that have an equivalent identity (i.e. other channels of the same + * type with the same fingerprint such as other email channels with + * the same email address or other sms channels with the same number). + * + * Generated from protobuf field string code = 1; + */ + protected $code = ''; + /** + * The expiration time associated with the code that was returned. If + * an expiration was provided in the request, this is the minimum of the + * requested expiration in the request and the max permitted expiration. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2; + */ + protected $expire_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * The verification code, which may be used to verify other channels + * that have an equivalent identity (i.e. other channels of the same + * type with the same fingerprint such as other email channels with + * the same email address or other sms channels with the same number). + * @type \Google\Protobuf\Timestamp $expire_time + * The expiration time associated with the code that was returned. If + * an expiration was provided in the request, this is the minimum of the + * requested expiration in the request and the max permitted expiration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * The verification code, which may be used to verify other channels + * that have an equivalent identity (i.e. other channels of the same + * type with the same fingerprint such as other email channels with + * the same email address or other sms channels with the same number). + * + * Generated from protobuf field string code = 1; + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * The verification code, which may be used to verify other channels + * that have an equivalent identity (i.e. other channels of the same + * type with the same fingerprint such as other email channels with + * the same email address or other sms channels with the same number). + * + * Generated from protobuf field string code = 1; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * The expiration time associated with the code that was returned. If + * an expiration was provided in the request, this is the minimum of the + * requested expiration in the request and the max permitted expiration. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * The expiration time associated with the code that was returned. If + * an expiration was provided in the request, this is the minimum of the + * requested expiration in the request and the max permitted expiration. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php new file mode 100644 index 00000000000..89df3ff5ac8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php @@ -0,0 +1,117 @@ +google.monitoring.v3.GetServiceLevelObjectiveRequest + */ +class GetServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 2; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * @type int $view + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 2; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 2; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php new file mode 100644 index 00000000000..6b40bdd8706 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.GetServiceRequest + */ +class GetServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the `Service`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php new file mode 100644 index 00000000000..8b0e2c94fa7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php @@ -0,0 +1,71 @@ +google.monitoring.v3.GetUptimeCheckConfigRequest + */ +class GetUptimeCheckConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Uptime check configuration to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Uptime check configuration to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Uptime check configuration to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Uptime check configuration to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php new file mode 100644 index 00000000000..4a768d02d74 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php @@ -0,0 +1,257 @@ +google.monitoring.v3.Group + */ +class Group extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of this group. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * When creating a group, this field is ignored and a new name is created + * consisting of the project specified in the call to `CreateGroup` + * and a unique `[GROUP_ID]` that is generated automatically. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * A user-assigned name for this group, used only for display purposes. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * The name of the group's parent, if it has one. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * For groups with no parent, `parent_name` is the empty string, `""`. + * + * Generated from protobuf field string parent_name = 3; + */ + protected $parent_name = ''; + /** + * The filter used to determine which monitored resources belong to this + * group. + * + * Generated from protobuf field string filter = 5; + */ + protected $filter = ''; + /** + * If true, the members of this group are considered to be a cluster. + * The system can perform additional analysis on groups that are clusters. + * + * Generated from protobuf field bool is_cluster = 6; + */ + protected $is_cluster = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The name of this group. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * When creating a group, this field is ignored and a new name is created + * consisting of the project specified in the call to `CreateGroup` + * and a unique `[GROUP_ID]` that is generated automatically. + * @type string $display_name + * A user-assigned name for this group, used only for display purposes. + * @type string $parent_name + * The name of the group's parent, if it has one. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * For groups with no parent, `parent_name` is the empty string, `""`. + * @type string $filter + * The filter used to determine which monitored resources belong to this + * group. + * @type bool $is_cluster + * If true, the members of this group are considered to be a cluster. + * The system can perform additional analysis on groups that are clusters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Group::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of this group. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * When creating a group, this field is ignored and a new name is created + * consisting of the project specified in the call to `CreateGroup` + * and a unique `[GROUP_ID]` that is generated automatically. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The name of this group. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * When creating a group, this field is ignored and a new name is created + * consisting of the project specified in the call to `CreateGroup` + * and a unique `[GROUP_ID]` that is generated automatically. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A user-assigned name for this group, used only for display purposes. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A user-assigned name for this group, used only for display purposes. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The name of the group's parent, if it has one. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * For groups with no parent, `parent_name` is the empty string, `""`. + * + * Generated from protobuf field string parent_name = 3; + * @return string + */ + public function getParentName() + { + return $this->parent_name; + } + + /** + * The name of the group's parent, if it has one. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * For groups with no parent, `parent_name` is the empty string, `""`. + * + * Generated from protobuf field string parent_name = 3; + * @param string $var + * @return $this + */ + public function setParentName($var) + { + GPBUtil::checkString($var, True); + $this->parent_name = $var; + + return $this; + } + + /** + * The filter used to determine which monitored resources belong to this + * group. + * + * Generated from protobuf field string filter = 5; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter used to determine which monitored resources belong to this + * group. + * + * Generated from protobuf field string filter = 5; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * If true, the members of this group are considered to be a cluster. + * The system can perform additional analysis on groups that are clusters. + * + * Generated from protobuf field bool is_cluster = 6; + * @return bool + */ + public function getIsCluster() + { + return $this->is_cluster; + } + + /** + * If true, the members of this group are considered to be a cluster. + * The system can perform additional analysis on groups that are clusters. + * + * Generated from protobuf field bool is_cluster = 6; + * @param bool $var + * @return $this + */ + public function setIsCluster($var) + { + GPBUtil::checkBool($var); + $this->is_cluster = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php new file mode 100644 index 00000000000..ddf9d0eee1a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php @@ -0,0 +1,66 @@ +google.monitoring.v3.GroupResourceType + */ +class GroupResourceType +{ + /** + * Default value (not valid). + * + * Generated from protobuf enum RESOURCE_TYPE_UNSPECIFIED = 0; + */ + const RESOURCE_TYPE_UNSPECIFIED = 0; + /** + * A group of instances from Google Cloud Platform (GCP) or + * Amazon Web Services (AWS). + * + * Generated from protobuf enum INSTANCE = 1; + */ + const INSTANCE = 1; + /** + * A group of Amazon ELB load balancers. + * + * Generated from protobuf enum AWS_ELB_LOAD_BALANCER = 2; + */ + const AWS_ELB_LOAD_BALANCER = 2; + + private static $valueToName = [ + self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED', + self::INSTANCE => 'INSTANCE', + self::AWS_ELB_LOAD_BALANCER => 'AWS_ELB_LOAD_BALANCER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupServiceGrpcClient.php new file mode 100644 index 00000000000..cc6e9b51953 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupServiceGrpcClient.php @@ -0,0 +1,137 @@ +_simpleRequest('/google.monitoring.v3.GroupService/ListGroups', + $argument, + ['\Google\Cloud\Monitoring\V3\ListGroupsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a single group. + * @param \Google\Cloud\Monitoring\V3\GetGroupRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetGroup(\Google\Cloud\Monitoring\V3\GetGroupRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.GroupService/GetGroup', + $argument, + ['\Google\Cloud\Monitoring\V3\Group', 'decode'], + $metadata, $options); + } + + /** + * Creates a new group. + * @param \Google\Cloud\Monitoring\V3\CreateGroupRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateGroup(\Google\Cloud\Monitoring\V3\CreateGroupRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.GroupService/CreateGroup', + $argument, + ['\Google\Cloud\Monitoring\V3\Group', 'decode'], + $metadata, $options); + } + + /** + * Updates an existing group. + * You can change any group attributes except `name`. + * @param \Google\Cloud\Monitoring\V3\UpdateGroupRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateGroup(\Google\Cloud\Monitoring\V3\UpdateGroupRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.GroupService/UpdateGroup', + $argument, + ['\Google\Cloud\Monitoring\V3\Group', 'decode'], + $metadata, $options); + } + + /** + * Deletes an existing group. + * @param \Google\Cloud\Monitoring\V3\DeleteGroupRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteGroup(\Google\Cloud\Monitoring\V3\DeleteGroupRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.GroupService/DeleteGroup', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Lists the monitored resources that are members of a group. + * @param \Google\Cloud\Monitoring\V3\ListGroupMembersRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListGroupMembers(\Google\Cloud\Monitoring\V3\ListGroupMembersRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.GroupService/ListGroupMembers', + $argument, + ['\Google\Cloud\Monitoring\V3\ListGroupMembersResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php new file mode 100644 index 00000000000..32a4914d1b2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php @@ -0,0 +1,270 @@ +google.monitoring.v3.InternalChecker + */ +class InternalChecker extends \Google\Protobuf\Internal\Message +{ + /** + * A unique resource name for this InternalChecker. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Stackdriver Workspace project for the + * Uptime check config associated with the internal checker. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The checker's human-readable name. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the + * internal resource lives (ex: "default"). + * + * Generated from protobuf field string network = 3; + */ + protected $network = ''; + /** + * The GCP zone the Uptime check should egress from. Only respected for + * internal Uptime checks, where internal_network is specified. + * + * Generated from protobuf field string gcp_zone = 4; + */ + protected $gcp_zone = ''; + /** + * The GCP project ID where the internal checker lives. Not necessary + * the same as the Workspace project. + * + * Generated from protobuf field string peer_project_id = 6; + */ + protected $peer_project_id = ''; + /** + * The current operational state of the internal checker. + * + * Generated from protobuf field .google.monitoring.v3.InternalChecker.State state = 7; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * A unique resource name for this InternalChecker. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Stackdriver Workspace project for the + * Uptime check config associated with the internal checker. + * @type string $display_name + * The checker's human-readable name. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. + * @type string $network + * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the + * internal resource lives (ex: "default"). + * @type string $gcp_zone + * The GCP zone the Uptime check should egress from. Only respected for + * internal Uptime checks, where internal_network is specified. + * @type string $peer_project_id + * The GCP project ID where the internal checker lives. Not necessary + * the same as the Workspace project. + * @type int $state + * The current operational state of the internal checker. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * A unique resource name for this InternalChecker. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Stackdriver Workspace project for the + * Uptime check config associated with the internal checker. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * A unique resource name for this InternalChecker. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Stackdriver Workspace project for the + * Uptime check config associated with the internal checker. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The checker's human-readable name. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The checker's human-readable name. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the + * internal resource lives (ex: "default"). + * + * Generated from protobuf field string network = 3; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the + * internal resource lives (ex: "default"). + * + * Generated from protobuf field string network = 3; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The GCP zone the Uptime check should egress from. Only respected for + * internal Uptime checks, where internal_network is specified. + * + * Generated from protobuf field string gcp_zone = 4; + * @return string + */ + public function getGcpZone() + { + return $this->gcp_zone; + } + + /** + * The GCP zone the Uptime check should egress from. Only respected for + * internal Uptime checks, where internal_network is specified. + * + * Generated from protobuf field string gcp_zone = 4; + * @param string $var + * @return $this + */ + public function setGcpZone($var) + { + GPBUtil::checkString($var, True); + $this->gcp_zone = $var; + + return $this; + } + + /** + * The GCP project ID where the internal checker lives. Not necessary + * the same as the Workspace project. + * + * Generated from protobuf field string peer_project_id = 6; + * @return string + */ + public function getPeerProjectId() + { + return $this->peer_project_id; + } + + /** + * The GCP project ID where the internal checker lives. Not necessary + * the same as the Workspace project. + * + * Generated from protobuf field string peer_project_id = 6; + * @param string $var + * @return $this + */ + public function setPeerProjectId($var) + { + GPBUtil::checkString($var, True); + $this->peer_project_id = $var; + + return $this; + } + + /** + * The current operational state of the internal checker. + * + * Generated from protobuf field .google.monitoring.v3.InternalChecker.State state = 7; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The current operational state of the internal checker. + * + * Generated from protobuf field .google.monitoring.v3.InternalChecker.State state = 7; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\InternalChecker\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php new file mode 100644 index 00000000000..d006a60c773 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php @@ -0,0 +1,74 @@ +google.monitoring.v3.InternalChecker.State + */ +class State +{ + /** + * An internal checker should never be in the unspecified state. + * + * Generated from protobuf enum UNSPECIFIED = 0; + */ + const UNSPECIFIED = 0; + /** + * The checker is being created, provisioned, and configured. A checker in + * this state can be returned by `ListInternalCheckers` or + * `GetInternalChecker`, as well as by examining the [long running + * Operation](https://cloud.google.com/apis/design/design_patterns#long_running_operations) + * that created it. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The checker is running and available for use. A checker in this state + * can be returned by `ListInternalCheckers` or `GetInternalChecker` as + * well as by examining the [long running + * Operation](https://cloud.google.com/apis/design/design_patterns#long_running_operations) + * that created it. + * If a checker is being torn down, it is neither visible nor usable, so + * there is no "deleting" or "down" state. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + + private static $valueToName = [ + self::UNSPECIFIED => 'UNSPECIFIED', + self::CREATING => 'CREATING', + self::RUNNING => 'RUNNING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Monitoring\V3\InternalChecker_State::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker_State.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker_State.php new file mode 100644 index 00000000000..a698aa7f4bb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker_State.php @@ -0,0 +1,16 @@ +google.monitoring.v3.LabelValue + */ +class LabelValue extends \Google\Protobuf\Internal\Message +{ + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $bool_value + * A bool label value. + * @type int|string $int64_value + * An int64 label value. + * @type string $string_value + * A string label value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * A bool label value. + * + * Generated from protobuf field bool bool_value = 1; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(1); + } + + public function hasBoolValue() + { + return $this->hasOneof(1); + } + + /** + * A bool label value. + * + * Generated from protobuf field bool bool_value = 1; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An int64 label value. + * + * Generated from protobuf field int64 int64_value = 2; + * @return int|string + */ + public function getInt64Value() + { + return $this->readOneof(2); + } + + public function hasInt64Value() + { + return $this->hasOneof(2); + } + + /** + * An int64 label value. + * + * Generated from protobuf field int64 int64_value = 2; + * @param int|string $var + * @return $this + */ + public function setInt64Value($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A string label value. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + public function hasStringValue() + { + return $this->hasOneof(3); + } + + /** + * A string label value. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php new file mode 100644 index 00000000000..4e4bd653462 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php @@ -0,0 +1,267 @@ +google.monitoring.v3.ListAlertPoliciesRequest + */ +class ListAlertPoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose alert policies are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5; + */ + protected $filter = ''; + /** + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6; + */ + protected $order_by = ''; + /** + * The maximum number of results to return in a single response. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose alert policies are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * @type string $filter + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type string $order_by + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type int $page_size + * The maximum number of results to return in a single response. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose alert policies are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose alert policies are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string filter = 5; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 6; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php new file mode 100644 index 00000000000..1a4af7005a9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php @@ -0,0 +1,147 @@ +google.monitoring.v3.ListAlertPoliciesResponse + */ +class ListAlertPoliciesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The returned alert policies. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy alert_policies = 3; + */ + private $alert_policies; + /** + * If there might be more results than were returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of alert policies in all pages. This number is only an + * estimate, and may change in subsequent pages. https://aip.dev/158 + * + * Generated from protobuf field int32 total_size = 4; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\AlertPolicy[]|\Google\Protobuf\Internal\RepeatedField $alert_policies + * The returned alert policies. + * @type string $next_page_token + * If there might be more results than were returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * @type int $total_size + * The total number of alert policies in all pages. This number is only an + * estimate, and may change in subsequent pages. https://aip.dev/158 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); + parent::__construct($data); + } + + /** + * The returned alert policies. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy alert_policies = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAlertPolicies() + { + return $this->alert_policies; + } + + /** + * The returned alert policies. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy alert_policies = 3; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAlertPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy::class); + $this->alert_policies = $arr; + + return $this; + } + + /** + * If there might be more results than were returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there might be more results than were returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * The total number of alert policies in all pages. This number is only an + * estimate, and may change in subsequent pages. https://aip.dev/158 + * + * Generated from protobuf field int32 total_size = 4; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of alert policies in all pages. This number is only an + * estimate, and may change in subsequent pages. https://aip.dev/158 + * + * Generated from protobuf field int32 total_size = 4; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php new file mode 100644 index 00000000000..b799f825a6f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php @@ -0,0 +1,261 @@ +google.monitoring.v3.ListGroupMembersRequest + */ +class ListGroupMembersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The group whose members are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + /** + * An optional [list + * filter](https://cloud.google.com/monitoring/api/learn_more#filtering) + * describing the members to be returned. The filter may reference the type, + * labels, and metadata of monitored resources that comprise the group. For + * example, to return only resources representing Compute Engine VM instances, + * use this filter: + * `resource.type = "gce_instance"` + * + * Generated from protobuf field string filter = 5; + */ + protected $filter = ''; + /** + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 6; + */ + protected $interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The group whose members are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @type int $page_size + * A positive number that is the maximum number of results to return. + * @type string $page_token + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @type string $filter + * An optional [list + * filter](https://cloud.google.com/monitoring/api/learn_more#filtering) + * describing the members to be returned. The filter may reference the type, + * labels, and metadata of monitored resources that comprise the group. For + * example, to return only resources representing Compute Engine VM instances, + * use this filter: + * `resource.type = "gce_instance"` + * @type \Google\Cloud\Monitoring\V3\TimeInterval $interval + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The group whose members are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The group whose members are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * An optional [list + * filter](https://cloud.google.com/monitoring/api/learn_more#filtering) + * describing the members to be returned. The filter may reference the type, + * labels, and metadata of monitored resources that comprise the group. For + * example, to return only resources representing Compute Engine VM instances, + * use this filter: + * `resource.type = "gce_instance"` + * + * Generated from protobuf field string filter = 5; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * An optional [list + * filter](https://cloud.google.com/monitoring/api/learn_more#filtering) + * describing the members to be returned. The filter may reference the type, + * labels, and metadata of monitored resources that comprise the group. For + * example, to return only resources representing Compute Engine VM instances, + * use this filter: + * `resource.type = "gce_instance"` + * + * Generated from protobuf field string filter = 5; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 6; + * @return \Google\Cloud\Monitoring\V3\TimeInterval|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 6; + * @param \Google\Cloud\Monitoring\V3\TimeInterval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeInterval::class); + $this->interval = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php new file mode 100644 index 00000000000..1653ed4a466 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php @@ -0,0 +1,143 @@ +google.monitoring.v3.ListGroupMembersResponse + */ +class ListGroupMembersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A set of monitored resources in the group. + * + * Generated from protobuf field repeated .google.api.MonitoredResource members = 1; + */ + private $members; + /** + * If there are more results than have been returned, then this field is + * set to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of elements matching this request. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\MonitoredResource[]|\Google\Protobuf\Internal\RepeatedField $members + * A set of monitored resources in the group. + * @type string $next_page_token + * If there are more results than have been returned, then this field is + * set to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * @type int $total_size + * The total number of elements matching this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * A set of monitored resources in the group. + * + * Generated from protobuf field repeated .google.api.MonitoredResource members = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMembers() + { + return $this->members; + } + + /** + * A set of monitored resources in the group. + * + * Generated from protobuf field repeated .google.api.MonitoredResource members = 1; + * @param \Google\Api\MonitoredResource[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMembers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResource::class); + $this->members = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is + * set to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is + * set to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * The total number of elements matching this request. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of elements matching this request. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php new file mode 100644 index 00000000000..6fde7d488d4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php @@ -0,0 +1,295 @@ +google.monitoring.v3.ListGroupsRequest + */ +class ListGroupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose groups are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 5; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + protected $filter; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose groups are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type string $children_of_group + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns groups whose `parent_name` field contains the group + * name. If no groups have this parent, the results are empty. + * @type string $ancestors_of_group + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns groups that are ancestors of the specified group. + * The groups are returned in order, starting with the immediate parent and + * ending with the most distant ancestor. If the specified group has no + * immediate parent, the results are empty. + * @type string $descendants_of_group + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns the descendants of the specified group. This is a superset of + * the results returned by the `children_of_group` filter, and includes + * children-of-children, and so forth. + * @type int $page_size + * A positive number that is the maximum number of results to return. + * @type string $page_token + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose groups are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose groups are to be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns groups whose `parent_name` field contains the group + * name. If no groups have this parent, the results are empty. + * + * Generated from protobuf field string children_of_group = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getChildrenOfGroup() + { + return $this->readOneof(2); + } + + public function hasChildrenOfGroup() + { + return $this->hasOneof(2); + } + + /** + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns groups whose `parent_name` field contains the group + * name. If no groups have this parent, the results are empty. + * + * Generated from protobuf field string children_of_group = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setChildrenOfGroup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns groups that are ancestors of the specified group. + * The groups are returned in order, starting with the immediate parent and + * ending with the most distant ancestor. If the specified group has no + * immediate parent, the results are empty. + * + * Generated from protobuf field string ancestors_of_group = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getAncestorsOfGroup() + { + return $this->readOneof(3); + } + + public function hasAncestorsOfGroup() + { + return $this->hasOneof(3); + } + + /** + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns groups that are ancestors of the specified group. + * The groups are returned in order, starting with the immediate parent and + * ending with the most distant ancestor. If the specified group has no + * immediate parent, the results are empty. + * + * Generated from protobuf field string ancestors_of_group = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAncestorsOfGroup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns the descendants of the specified group. This is a superset of + * the results returned by the `children_of_group` filter, and includes + * children-of-children, and so forth. + * + * Generated from protobuf field string descendants_of_group = 4 [(.google.api.resource_reference) = { + * @return string + */ + public function getDescendantsOfGroup() + { + return $this->readOneof(4); + } + + public function hasDescendantsOfGroup() + { + return $this->hasOneof(4); + } + + /** + * A group name. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Returns the descendants of the specified group. This is a superset of + * the results returned by the `children_of_group` filter, and includes + * children-of-children, and so forth. + * + * Generated from protobuf field string descendants_of_group = 4 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDescendantsOfGroup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 5; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 5; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `next_page_token` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 6; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * @return string + */ + public function getFilter() + { + return $this->whichOneof("filter"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php new file mode 100644 index 00000000000..d59de2292c7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php @@ -0,0 +1,109 @@ +google.monitoring.v3.ListGroupsResponse + */ +class ListGroupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The groups that match the specified filters. + * + * Generated from protobuf field repeated .google.monitoring.v3.Group group = 1; + */ + private $group; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\Group[]|\Google\Protobuf\Internal\RepeatedField $group + * The groups that match the specified filters. + * @type string $next_page_token + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * The groups that match the specified filters. + * + * Generated from protobuf field repeated .google.monitoring.v3.Group group = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGroup() + { + return $this->group; + } + + /** + * The groups that match the specified filters. + * + * Generated from protobuf field repeated .google.monitoring.v3.Group group = 1; + * @param \Google\Cloud\Monitoring\V3\Group[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGroup($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Group::class); + $this->group = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php new file mode 100644 index 00000000000..141c7cb152c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php @@ -0,0 +1,209 @@ +google.monitoring.v3.ListMetricDescriptorsRequest + */ +class ListMetricDescriptorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * metric.type = starts_with("custom.googleapis.com/") + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type string $filter + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * metric.type = starts_with("custom.googleapis.com/") + * @type int $page_size + * A positive number that is the maximum number of results to return. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * metric.type = starts_with("custom.googleapis.com/") + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * metric.type = starts_with("custom.googleapis.com/") + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php new file mode 100644 index 00000000000..34955debbf7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php @@ -0,0 +1,113 @@ +google.monitoring.v3.ListMetricDescriptorsResponse + */ +class ListMetricDescriptorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The metric descriptors that are available to the project + * and that match the value of `filter`, if present. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor metric_descriptors = 1; + */ + private $metric_descriptors; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\MetricDescriptor[]|\Google\Protobuf\Internal\RepeatedField $metric_descriptors + * The metric descriptors that are available to the project + * and that match the value of `filter`, if present. + * @type string $next_page_token + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * The metric descriptors that are available to the project + * and that match the value of `filter`, if present. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor metric_descriptors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetricDescriptors() + { + return $this->metric_descriptors; + } + + /** + * The metric descriptors that are available to the project + * and that match the value of `filter`, if present. + * + * Generated from protobuf field repeated .google.api.MetricDescriptor metric_descriptors = 1; + * @param \Google\Api\MetricDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetricDescriptors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MetricDescriptor::class); + $this->metric_descriptors = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php new file mode 100644 index 00000000000..a205b0daf20 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php @@ -0,0 +1,201 @@ +google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + */ +class ListMonitoredResourceDescriptorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) + * describing the descriptors to be returned. The filter can reference the + * descriptor's type and labels. For example, the following filter returns + * only Google Compute Engine descriptors that have an `id` label: + * resource.type = starts_with("gce_") AND resource.label:id + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type string $filter + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) + * describing the descriptors to be returned. The filter can reference the + * descriptor's type and labels. For example, the following filter returns + * only Google Compute Engine descriptors that have an `id` label: + * resource.type = starts_with("gce_") AND resource.label:id + * @type int $page_size + * A positive number that is the maximum number of results to return. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) + * describing the descriptors to be returned. The filter can reference the + * descriptor's type and labels. For example, the following filter returns + * only Google Compute Engine descriptors that have an `id` label: + * resource.type = starts_with("gce_") AND resource.label:id + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) + * describing the descriptors to be returned. The filter can reference the + * descriptor's type and labels. For example, the following filter returns + * only Google Compute Engine descriptors that have an `id` label: + * resource.type = starts_with("gce_") AND resource.label:id + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A positive number that is the maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php new file mode 100644 index 00000000000..9a3bf63be47 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php @@ -0,0 +1,113 @@ +google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + */ +class ListMonitoredResourceDescriptorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The monitored resource descriptors that are available to this project + * and that match `filter`, if present. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + private $resource_descriptors; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\MonitoredResourceDescriptor[]|\Google\Protobuf\Internal\RepeatedField $resource_descriptors + * The monitored resource descriptors that are available to this project + * and that match `filter`, if present. + * @type string $next_page_token + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * The monitored resource descriptors that are available to this project + * and that match `filter`, if present. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourceDescriptors() + { + return $this->resource_descriptors; + } + + /** + * The monitored resource descriptors that are available to this project + * and that match `filter`, if present. + * + * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + * @param \Google\Api\MonitoredResourceDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourceDescriptors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResourceDescriptor::class); + $this->resource_descriptors = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php new file mode 100644 index 00000000000..7f5d3764bcf --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php @@ -0,0 +1,183 @@ +google.monitoring.v3.ListNotificationChannelDescriptorsRequest + */ +class ListNotificationChannelDescriptorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this + * [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent + * container in which to look for the descriptors; to retrieve a single + * descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this + * [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent + * container in which to look for the descriptors; to retrieve a single + * descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * @type int $page_size + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * @type string $page_token + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this + * [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent + * container in which to look for the descriptors; to retrieve a single + * descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: + * projects/[PROJECT_ID_OR_NUMBER] + * Note that this + * [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent + * container in which to look for the descriptors; to retrieve a single + * descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * + * Generated from protobuf field string name = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php new file mode 100644 index 00000000000..d4aaf9aaece --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php @@ -0,0 +1,117 @@ +google.monitoring.v3.ListNotificationChannelDescriptorsResponse + */ +class ListNotificationChannelDescriptorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The monitored resource descriptors supported for the specified + * project, optionally filtered. + * + * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannelDescriptor channel_descriptors = 1; + */ + private $channel_descriptors; + /** + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $channel_descriptors + * The monitored resource descriptors supported for the specified + * project, optionally filtered. + * @type string $next_page_token + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * The monitored resource descriptors supported for the specified + * project, optionally filtered. + * + * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannelDescriptor channel_descriptors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChannelDescriptors() + { + return $this->channel_descriptors; + } + + /** + * The monitored resource descriptors supported for the specified + * project, optionally filtered. + * + * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannelDescriptor channel_descriptors = 1; + * @param \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChannelDescriptors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor::class); + $this->channel_descriptors = $arr; + + return $this; + } + + /** + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php new file mode 100644 index 00000000000..722e286a209 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php @@ -0,0 +1,279 @@ +google.monitoring.v3.ListNotificationChannelsRequest + */ +class ListNotificationChannelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string filter = 6; + */ + protected $filter = ''; + /** + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 7; + */ + protected $order_by = ''; + /** + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * @type string $filter + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type string $order_by + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type int $page_size + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * @type string $page_token + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * This names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * + * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string filter = 6; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string filter = 6; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 7; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * + * Generated from protobuf field string order_by = 7; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php new file mode 100644 index 00000000000..b56750a1f2b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php @@ -0,0 +1,151 @@ +google.monitoring.v3.ListNotificationChannelsResponse + */ +class ListNotificationChannelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The notification channels defined for the specified project. + * + * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannel notification_channels = 3; + */ + private $notification_channels; + /** + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of notification channels in all pages. This number is only + * an estimate, and may change in subsequent pages. https://aip.dev/158 + * + * Generated from protobuf field int32 total_size = 4; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\NotificationChannel[]|\Google\Protobuf\Internal\RepeatedField $notification_channels + * The notification channels defined for the specified project. + * @type string $next_page_token + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * @type int $total_size + * The total number of notification channels in all pages. This number is only + * an estimate, and may change in subsequent pages. https://aip.dev/158 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * The notification channels defined for the specified project. + * + * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannel notification_channels = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationChannels() + { + return $this->notification_channels; + } + + /** + * The notification channels defined for the specified project. + * + * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannel notification_channels = 3; + * @param \Google\Cloud\Monitoring\V3\NotificationChannel[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationChannels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\NotificationChannel::class); + $this->notification_channels = $arr; + + return $this; + } + + /** + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If not empty, indicates that there may be more results that match + * the request. Use the value in the `page_token` field in a + * subsequent request to fetch the next set of results. If empty, + * all results have been returned. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * The total number of notification channels in all pages. This number is only + * an estimate, and may change in subsequent pages. https://aip.dev/158 + * + * Generated from protobuf field int32 total_size = 4; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of notification channels in all pages. This number is only + * an estimate, and may change in subsequent pages. https://aip.dev/158 + * + * Generated from protobuf field int32 total_size = 4; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php new file mode 100644 index 00000000000..cfe49f0b1c5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php @@ -0,0 +1,239 @@ +google.monitoring.v3.ListServiceLevelObjectivesRequest + */ +class ListServiceLevelObjectivesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * A filter specifying what `ServiceLevelObjective`s to return. + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + /** + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 5; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * @type string $filter + * A filter specifying what `ServiceLevelObjective`s to return. + * @type int $page_size + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @type int $view + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A filter specifying what `ServiceLevelObjective`s to return. + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filter specifying what `ServiceLevelObjective`s to return. + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 5; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 5; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php new file mode 100644 index 00000000000..5b896f02405 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php @@ -0,0 +1,109 @@ +google.monitoring.v3.ListServiceLevelObjectivesResponse + */ +class ListServiceLevelObjectivesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `ServiceLevelObjective`s matching the specified filter. + * + * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + */ + private $service_level_objectives; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\ServiceLevelObjective[]|\Google\Protobuf\Internal\RepeatedField $service_level_objectives + * The `ServiceLevelObjective`s matching the specified filter. + * @type string $next_page_token + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * The `ServiceLevelObjective`s matching the specified filter. + * + * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceLevelObjectives() + { + return $this->service_level_objectives; + } + + /** + * The `ServiceLevelObjective`s matching the specified filter. + * + * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; + * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceLevelObjectives($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\ServiceLevelObjective::class); + $this->service_level_objectives = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php new file mode 100644 index 00000000000..5fcb43d6fa8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php @@ -0,0 +1,261 @@ +google.monitoring.v3.ListServicesRequest + */ +class ListServicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent containing the listed services, either a + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent containing the listed services, either a + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * @type string $filter + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). + * @type int $page_size + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent containing the listed services, either a + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the parent containing the listed services, either a + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php new file mode 100644 index 00000000000..fd89f9ada87 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php @@ -0,0 +1,109 @@ +google.monitoring.v3.ListServicesResponse + */ +class ListServicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Service`s matching the specified filter. + * + * Generated from protobuf field repeated .google.monitoring.v3.Service services = 1; + */ + private $services; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\Service[]|\Google\Protobuf\Internal\RepeatedField $services + * The `Service`s matching the specified filter. + * @type string $next_page_token + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * The `Service`s matching the specified filter. + * + * Generated from protobuf field repeated .google.monitoring.v3.Service services = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServices() + { + return $this->services; + } + + /** + * The `Service`s matching the specified filter. + * + * Generated from protobuf field repeated .google.monitoring.v3.Service services = 1; + * @param \Google\Cloud\Monitoring\V3\Service[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Service::class); + $this->services = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php new file mode 100644 index 00000000000..e934a796289 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php @@ -0,0 +1,457 @@ +google.monitoring.v3.ListTimeSeriesRequest + */ +class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * organization or folder on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * organizations/[ORGANIZATION_ID] + * folders/[FOLDER_ID] + * + * Generated from protobuf field string name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * that specifies which time series should be returned. The filter must + * specify a single metric type, and can additionally specify metric labels + * and other information. For example: + * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Required. The time interval for which results should be returned. Only time series + * that contain data points in the specified interval are included + * in the response. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interval = null; + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series across specified labels. + * By default (if no `aggregation` is explicitly specified), the raw time + * series data is returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation aggregation = 5; + */ + protected $aggregation = null; + /** + * Apply a second aggregation after `aggregation` is applied. May only be + * specified if `aggregation` is specified. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation secondary_aggregation = 11; + */ + protected $secondary_aggregation = null; + /** + * Unsupported: must be left blank. The points in each time series are + * currently returned in reverse time order (most recent to oldest). + * + * Generated from protobuf field string order_by = 6; + */ + protected $order_by = ''; + /** + * Required. Specifies which information is returned about the time series. + * + * Generated from protobuf field .google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView view = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $view = 0; + /** + * A positive number that is the maximum number of results to return. If + * `page_size` is empty or more than 100,000 results, the effective + * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the + * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is + * the maximum number of `TimeSeries` returned. + * + * Generated from protobuf field int32 page_size = 8; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 9; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * organization or folder on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * organizations/[ORGANIZATION_ID] + * folders/[FOLDER_ID] + * @type string $filter + * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * that specifies which time series should be returned. The filter must + * specify a single metric type, and can additionally specify metric labels + * and other information. For example: + * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * @type \Google\Cloud\Monitoring\V3\TimeInterval $interval + * Required. The time interval for which results should be returned. Only time series + * that contain data points in the specified interval are included + * in the response. + * @type \Google\Cloud\Monitoring\V3\Aggregation $aggregation + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series across specified labels. + * By default (if no `aggregation` is explicitly specified), the raw time + * series data is returned. + * @type \Google\Cloud\Monitoring\V3\Aggregation $secondary_aggregation + * Apply a second aggregation after `aggregation` is applied. May only be + * specified if `aggregation` is specified. + * @type string $order_by + * Unsupported: must be left blank. The points in each time series are + * currently returned in reverse time order (most recent to oldest). + * @type int $view + * Required. Specifies which information is returned about the time series. + * @type int $page_size + * A positive number that is the maximum number of results to return. If + * `page_size` is empty or more than 100,000 results, the effective + * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the + * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is + * the maximum number of `TimeSeries` returned. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * organization or folder on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * organizations/[ORGANIZATION_ID] + * folders/[FOLDER_ID] + * + * Generated from protobuf field string name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * organization or folder on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * organizations/[ORGANIZATION_ID] + * folders/[FOLDER_ID] + * + * Generated from protobuf field string name = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * that specifies which time series should be returned. The filter must + * specify a single metric type, and can additionally specify metric labels + * and other information. For example: + * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * that specifies which time series should be returned. The filter must + * specify a single metric type, and can additionally specify metric labels + * and other information. For example: + * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Required. The time interval for which results should be returned. Only time series + * that contain data points in the specified interval are included + * in the response. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\TimeInterval|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * Required. The time interval for which results should be returned. Only time series + * that contain data points in the specified interval are included + * in the response. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\TimeInterval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeInterval::class); + $this->interval = $var; + + return $this; + } + + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series across specified labels. + * By default (if no `aggregation` is explicitly specified), the raw time + * series data is returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation aggregation = 5; + * @return \Google\Cloud\Monitoring\V3\Aggregation|null + */ + public function getAggregation() + { + return $this->aggregation; + } + + public function hasAggregation() + { + return isset($this->aggregation); + } + + public function clearAggregation() + { + unset($this->aggregation); + } + + /** + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series across specified labels. + * By default (if no `aggregation` is explicitly specified), the raw time + * series data is returned. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation aggregation = 5; + * @param \Google\Cloud\Monitoring\V3\Aggregation $var + * @return $this + */ + public function setAggregation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Aggregation::class); + $this->aggregation = $var; + + return $this; + } + + /** + * Apply a second aggregation after `aggregation` is applied. May only be + * specified if `aggregation` is specified. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * @return \Google\Cloud\Monitoring\V3\Aggregation|null + */ + public function getSecondaryAggregation() + { + return $this->secondary_aggregation; + } + + public function hasSecondaryAggregation() + { + return isset($this->secondary_aggregation); + } + + public function clearSecondaryAggregation() + { + unset($this->secondary_aggregation); + } + + /** + * Apply a second aggregation after `aggregation` is applied. May only be + * specified if `aggregation` is specified. + * + * Generated from protobuf field .google.monitoring.v3.Aggregation secondary_aggregation = 11; + * @param \Google\Cloud\Monitoring\V3\Aggregation $var + * @return $this + */ + public function setSecondaryAggregation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Aggregation::class); + $this->secondary_aggregation = $var; + + return $this; + } + + /** + * Unsupported: must be left blank. The points in each time series are + * currently returned in reverse time order (most recent to oldest). + * + * Generated from protobuf field string order_by = 6; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Unsupported: must be left blank. The points in each time series are + * currently returned in reverse time order (most recent to oldest). + * + * Generated from protobuf field string order_by = 6; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Required. Specifies which information is returned about the time series. + * + * Generated from protobuf field .google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView view = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Required. Specifies which information is returned about the time series. + * + * Generated from protobuf field .google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView view = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest\TimeSeriesView::class); + $this->view = $var; + + return $this; + } + + /** + * A positive number that is the maximum number of results to return. If + * `page_size` is empty or more than 100,000 results, the effective + * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the + * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is + * the maximum number of `TimeSeries` returned. + * + * Generated from protobuf field int32 page_size = 8; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A positive number that is the maximum number of results to return. If + * `page_size` is empty or more than 100,000 results, the effective + * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the + * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is + * the maximum number of `TimeSeries` returned. + * + * Generated from protobuf field int32 page_size = 8; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 9; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 9; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php new file mode 100644 index 00000000000..4055777eb6d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php @@ -0,0 +1,59 @@ +google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView + */ +class TimeSeriesView +{ + /** + * Returns the identity of the metric(s), the time series, + * and the time series data. + * + * Generated from protobuf enum FULL = 0; + */ + const FULL = 0; + /** + * Returns the identity of the metric and the time series resource, + * but not the time series data. + * + * Generated from protobuf enum HEADERS = 1; + */ + const HEADERS = 1; + + private static $valueToName = [ + self::FULL => 'FULL', + self::HEADERS => 'HEADERS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TimeSeriesView::class, \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest_TimeSeriesView::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest_TimeSeriesView.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest_TimeSeriesView.php new file mode 100644 index 00000000000..19e5f3ac9a7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest_TimeSeriesView.php @@ -0,0 +1,16 @@ +google.monitoring.v3.ListTimeSeriesResponse + */ +class ListTimeSeriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * One or more time series that match the filter included in the request. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 1; + */ + private $time_series; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Query execution errors that may have caused the time series data returned + * to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status execution_errors = 3; + */ + private $execution_errors; + /** + * The unit in which all `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * If different `time_series` have different units (for example, because they + * come from different metric types, or a unit is absent), then `unit` will be + * "{not_a_unit}". + * + * Generated from protobuf field string unit = 5; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $time_series + * One or more time series that match the filter included in the request. + * @type string $next_page_token + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * @type \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $execution_errors + * Query execution errors that may have caused the time series data returned + * to be incomplete. + * @type string $unit + * The unit in which all `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * If different `time_series` have different units (for example, because they + * come from different metric types, or a unit is absent), then `unit` will be + * "{not_a_unit}". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * One or more time series that match the filter included in the request. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimeSeries() + { + return $this->time_series; + } + + /** + * One or more time series that match the filter included in the request. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 1; + * @param \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimeSeries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeries::class); + $this->time_series = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, + * use that value as `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Query execution errors that may have caused the time series data returned + * to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status execution_errors = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExecutionErrors() + { + return $this->execution_errors; + } + + /** + * Query execution errors that may have caused the time series data returned + * to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status execution_errors = 3; + * @param \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExecutionErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->execution_errors = $arr; + + return $this; + } + + /** + * The unit in which all `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * If different `time_series` have different units (for example, because they + * come from different metric types, or a unit is absent), then `unit` will be + * "{not_a_unit}". + * + * Generated from protobuf field string unit = 5; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The unit in which all `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * If different `time_series` have different units (for example, because they + * come from different metric types, or a unit is absent), then `unit` will be + * "{not_a_unit}". + * + * Generated from protobuf field string unit = 5; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php new file mode 100644 index 00000000000..b706607acdb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php @@ -0,0 +1,163 @@ +google.monitoring.v3.ListUptimeCheckConfigsRequest + */ +class ListUptimeCheckConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose Uptime check configurations are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose Uptime check configurations are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type int $page_size + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose Uptime check configurations are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose Uptime check configurations are listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php new file mode 100644 index 00000000000..19b7a113300 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php @@ -0,0 +1,155 @@ +google.monitoring.v3.ListUptimeCheckConfigsResponse + */ +class ListUptimeCheckConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The returned Uptime check configurations. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig uptime_check_configs = 1; + */ + private $uptime_check_configs; + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * The total number of Uptime check configurations for the project, + * irrespective of any pagination. + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig[]|\Google\Protobuf\Internal\RepeatedField $uptime_check_configs + * The returned Uptime check configurations. + * @type string $next_page_token + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * @type int $total_size + * The total number of Uptime check configurations for the project, + * irrespective of any pagination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * The returned Uptime check configurations. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig uptime_check_configs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUptimeCheckConfigs() + { + return $this->uptime_check_configs; + } + + /** + * The returned Uptime check configurations. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig uptime_check_configs = 1; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUptimeCheckConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig::class); + $this->uptime_check_configs = $arr; + + return $this; + } + + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * The total number of Uptime check configurations for the project, + * irrespective of any pagination. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * The total number of Uptime check configurations for the project, + * irrespective of any pagination. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php new file mode 100644 index 00000000000..f2d106e8898 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php @@ -0,0 +1,129 @@ +google.monitoring.v3.ListUptimeCheckIpsRequest + */ +class ListUptimeCheckIpsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * NOTE: this field is not yet implemented + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * NOTE: this field is not yet implemented + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * NOTE: this field is not yet implemented + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * NOTE: this field is not yet implemented + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * NOTE: this field is not yet implemented + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * NOTE: this field is not yet implemented + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * NOTE: this field is not yet implemented + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * NOTE: this field is not yet implemented + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php new file mode 100644 index 00000000000..ad89ed7327a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php @@ -0,0 +1,125 @@ +google.monitoring.v3.ListUptimeCheckIpsResponse + */ +class ListUptimeCheckIpsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The returned list of IP addresses (including region and location) that the + * checkers run from. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckIp uptime_check_ips = 1; + */ + private $uptime_check_ips; + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * NOTE: this field is not yet implemented + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\UptimeCheckIp[]|\Google\Protobuf\Internal\RepeatedField $uptime_check_ips + * The returned list of IP addresses (including region and location) that the + * checkers run from. + * @type string $next_page_token + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * NOTE: this field is not yet implemented + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * The returned list of IP addresses (including region and location) that the + * checkers run from. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckIp uptime_check_ips = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUptimeCheckIps() + { + return $this->uptime_check_ips; + } + + /** + * The returned list of IP addresses (including region and location) that the + * checkers run from. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckIp uptime_check_ips = 1; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckIp[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUptimeCheckIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckIp::class); + $this->uptime_check_ips = $arr; + + return $this; + } + + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * NOTE: this field is not yet implemented + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + * NOTE: this field is not yet implemented + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MetricServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MetricServiceGrpcClient.php new file mode 100644 index 00000000000..1b000965874 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MetricServiceGrpcClient.php @@ -0,0 +1,188 @@ +_simpleRequest('/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors', + $argument, + ['\Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a single monitored resource descriptor. This method does not require a Workspace. + * @param \Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetMonitoredResourceDescriptor(\Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor', + $argument, + ['\Google\Api\MonitoredResourceDescriptor', 'decode'], + $metadata, $options); + } + + /** + * Lists metric descriptors that match a filter. This method does not require a Workspace. + * @param \Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListMetricDescriptors(\Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/ListMetricDescriptors', + $argument, + ['\Google\Cloud\Monitoring\V3\ListMetricDescriptorsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a single metric descriptor. This method does not require a Workspace. + * @param \Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetMetricDescriptor(\Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/GetMetricDescriptor', + $argument, + ['\Google\Api\MetricDescriptor', 'decode'], + $metadata, $options); + } + + /** + * Creates a new metric descriptor. + * The creation is executed asynchronously and callers may check the returned + * operation to track its progress. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * @param \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateMetricDescriptor(\Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/CreateMetricDescriptor', + $argument, + ['\Google\Api\MetricDescriptor', 'decode'], + $metadata, $options); + } + + /** + * Deletes a metric descriptor. Only user-created + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + * deleted. + * @param \Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteMetricDescriptor(\Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/DeleteMetricDescriptor', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Lists time series that match a filter. This method does not require a Workspace. + * @param \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTimeSeries(\Google\Cloud\Monitoring\V3\ListTimeSeriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/ListTimeSeries', + $argument, + ['\Google\Cloud\Monitoring\V3\ListTimeSeriesResponse', 'decode'], + $metadata, $options); + } + + /** + * Creates or adds data to one or more time series. + * The response is empty if all time series in the request were written. + * If any time series could not be written, a corresponding failure message is + * included in the error response. + * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTimeSeries(\Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/CreateTimeSeries', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Creates or adds data to one or more service time series. A service time + * series is a time series for a metric from a Google Cloud service. The + * response is empty if all time series in the request were written. If any + * time series could not be written, a corresponding failure message is + * included in the error response. This endpoint rejects writes to + * user-defined metrics. + * This method is only for use by Google Cloud services. Use + * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + * instead. + * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateServiceTimeSeries(\Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/CreateServiceTimeSeries', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php new file mode 100644 index 00000000000..73a1f82bce8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php @@ -0,0 +1,111 @@ +google.monitoring.v3.MutationRecord + */ +class MutationRecord extends \Google\Protobuf\Internal\Message +{ + /** + * When the change occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp mutate_time = 1; + */ + protected $mutate_time = null; + /** + * The email address of the user making the change. + * + * Generated from protobuf field string mutated_by = 2; + */ + protected $mutated_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $mutate_time + * When the change occurred. + * @type string $mutated_by + * The email address of the user making the change. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MutationRecord::initOnce(); + parent::__construct($data); + } + + /** + * When the change occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp mutate_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getMutateTime() + { + return $this->mutate_time; + } + + public function hasMutateTime() + { + return isset($this->mutate_time); + } + + public function clearMutateTime() + { + unset($this->mutate_time); + } + + /** + * When the change occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp mutate_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setMutateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->mutate_time = $var; + + return $this; + } + + /** + * The email address of the user making the change. + * + * Generated from protobuf field string mutated_by = 2; + * @return string + */ + public function getMutatedBy() + { + return $this->mutated_by; + } + + /** + * The email address of the user making the change. + * + * Generated from protobuf field string mutated_by = 2; + * @param string $var + * @return $this + */ + public function setMutatedBy($var) + { + GPBUtil::checkString($var, True); + $this->mutated_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php new file mode 100644 index 00000000000..264f081e4f5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php @@ -0,0 +1,586 @@ +google.monitoring.v3.NotificationChannel + */ +class NotificationChannel extends \Google\Protobuf\Internal\Message +{ + /** + * The type of the notification channel. This field matches the + * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * The full REST resource name for this channel. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * The `[CHANNEL_ID]` is automatically assigned by the server on creation. + * + * Generated from protobuf field string name = 6; + */ + protected $name = ''; + /** + * An optional human-readable name for this notification channel. It is + * recommended that you specify a non-empty and unique name in order to + * make it easier to identify the channels in your project, though this is + * not enforced. The display name is limited to 512 Unicode characters. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + /** + * An optional human-readable description of this notification channel. This + * description may provide additional details, beyond the display + * name, for the channel. This may not exceed 1024 Unicode characters. + * + * Generated from protobuf field string description = 4; + */ + protected $description = ''; + /** + * Configuration fields that define the channel and its behavior. The + * permissible and required labels are specified in the + * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the + * `NotificationChannelDescriptor` corresponding to the `type` field. + * + * Generated from protobuf field map labels = 5; + */ + private $labels; + /** + * User-supplied key/value data that does not need to conform to + * the corresponding `NotificationChannelDescriptor`'s schema, unlike + * the `labels` field. This field is intended to be used for organizing + * and identifying the `NotificationChannel` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * + * Generated from protobuf field map user_labels = 8; + */ + private $user_labels; + /** + * Indicates whether this channel has been verified or not. On a + * [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * or + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation, this field is expected to be populated. + * If the value is `UNVERIFIED`, then it indicates that the channel is + * non-functioning (it both requires verification and lacks verification); + * otherwise, it is assumed that the channel works. + * If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that + * the channel is of a type that does not require verification or that + * this specific channel has been exempted from verification because it was + * created prior to verification being required for channels of this type. + * This field cannot be modified using a standard + * [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] + * operation. To change the value of this field, you must call + * [`VerifyNotificationChannel`][google.monitoring.v3.NotificationChannelService.VerifyNotificationChannel]. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel.VerificationStatus verification_status = 9; + */ + protected $verification_status = 0; + /** + * Whether notifications are forwarded to the described channel. This makes + * it possible to disable delivery of notifications to a particular channel + * without removing the channel from all alerting policies that reference + * the channel. This is a more convenient approach when the change is + * temporary and you want to receive notifications from the same set + * of alerting policies on the channel at some point in the future. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; + */ + protected $enabled = null; + /** + * Record of the creation of this channel. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; + */ + protected $creation_record = null; + /** + * Records of the modification of this channel. + * + * Generated from protobuf field repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + */ + private $mutation_records; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The type of the notification channel. This field matches the + * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field. + * @type string $name + * The full REST resource name for this channel. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * The `[CHANNEL_ID]` is automatically assigned by the server on creation. + * @type string $display_name + * An optional human-readable name for this notification channel. It is + * recommended that you specify a non-empty and unique name in order to + * make it easier to identify the channels in your project, though this is + * not enforced. The display name is limited to 512 Unicode characters. + * @type string $description + * An optional human-readable description of this notification channel. This + * description may provide additional details, beyond the display + * name, for the channel. This may not exceed 1024 Unicode characters. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Configuration fields that define the channel and its behavior. The + * permissible and required labels are specified in the + * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the + * `NotificationChannelDescriptor` corresponding to the `type` field. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * User-supplied key/value data that does not need to conform to + * the corresponding `NotificationChannelDescriptor`'s schema, unlike + * the `labels` field. This field is intended to be used for organizing + * and identifying the `NotificationChannel` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * @type int $verification_status + * Indicates whether this channel has been verified or not. On a + * [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * or + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation, this field is expected to be populated. + * If the value is `UNVERIFIED`, then it indicates that the channel is + * non-functioning (it both requires verification and lacks verification); + * otherwise, it is assumed that the channel works. + * If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that + * the channel is of a type that does not require verification or that + * this specific channel has been exempted from verification because it was + * created prior to verification being required for channels of this type. + * This field cannot be modified using a standard + * [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] + * operation. To change the value of this field, you must call + * [`VerifyNotificationChannel`][google.monitoring.v3.NotificationChannelService.VerifyNotificationChannel]. + * @type \Google\Protobuf\BoolValue $enabled + * Whether notifications are forwarded to the described channel. This makes + * it possible to disable delivery of notifications to a particular channel + * without removing the channel from all alerting policies that reference + * the channel. This is a more convenient approach when the change is + * temporary and you want to receive notifications from the same set + * of alerting policies on the channel at some point in the future. + * @type \Google\Cloud\Monitoring\V3\MutationRecord $creation_record + * Record of the creation of this channel. + * @type \Google\Cloud\Monitoring\V3\MutationRecord[]|\Google\Protobuf\Internal\RepeatedField $mutation_records + * Records of the modification of this channel. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Notification::initOnce(); + parent::__construct($data); + } + + /** + * The type of the notification channel. This field matches the + * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the notification channel. This field matches the + * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The full REST resource name for this channel. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * The `[CHANNEL_ID]` is automatically assigned by the server on creation. + * + * Generated from protobuf field string name = 6; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The full REST resource name for this channel. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * The `[CHANNEL_ID]` is automatically assigned by the server on creation. + * + * Generated from protobuf field string name = 6; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An optional human-readable name for this notification channel. It is + * recommended that you specify a non-empty and unique name in order to + * make it easier to identify the channels in your project, though this is + * not enforced. The display name is limited to 512 Unicode characters. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * An optional human-readable name for this notification channel. It is + * recommended that you specify a non-empty and unique name in order to + * make it easier to identify the channels in your project, though this is + * not enforced. The display name is limited to 512 Unicode characters. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * An optional human-readable description of this notification channel. This + * description may provide additional details, beyond the display + * name, for the channel. This may not exceed 1024 Unicode characters. + * + * Generated from protobuf field string description = 4; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * An optional human-readable description of this notification channel. This + * description may provide additional details, beyond the display + * name, for the channel. This may not exceed 1024 Unicode characters. + * + * Generated from protobuf field string description = 4; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Configuration fields that define the channel and its behavior. The + * permissible and required labels are specified in the + * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the + * `NotificationChannelDescriptor` corresponding to the `type` field. + * + * Generated from protobuf field map labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Configuration fields that define the channel and its behavior. The + * permissible and required labels are specified in the + * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the + * `NotificationChannelDescriptor` corresponding to the `type` field. + * + * Generated from protobuf field map labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * User-supplied key/value data that does not need to conform to + * the corresponding `NotificationChannelDescriptor`'s schema, unlike + * the `labels` field. This field is intended to be used for organizing + * and identifying the `NotificationChannel` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * + * Generated from protobuf field map user_labels = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * User-supplied key/value data that does not need to conform to + * the corresponding `NotificationChannelDescriptor`'s schema, unlike + * the `labels` field. This field is intended to be used for organizing + * and identifying the `NotificationChannel` objects. + * The field can contain up to 64 entries. Each key and value is limited to + * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and + * values can contain only lowercase letters, numerals, underscores, and + * dashes. Keys must begin with a letter. + * + * Generated from protobuf field map user_labels = 8; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + + /** + * Indicates whether this channel has been verified or not. On a + * [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * or + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation, this field is expected to be populated. + * If the value is `UNVERIFIED`, then it indicates that the channel is + * non-functioning (it both requires verification and lacks verification); + * otherwise, it is assumed that the channel works. + * If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that + * the channel is of a type that does not require verification or that + * this specific channel has been exempted from verification because it was + * created prior to verification being required for channels of this type. + * This field cannot be modified using a standard + * [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] + * operation. To change the value of this field, you must call + * [`VerifyNotificationChannel`][google.monitoring.v3.NotificationChannelService.VerifyNotificationChannel]. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel.VerificationStatus verification_status = 9; + * @return int + */ + public function getVerificationStatus() + { + return $this->verification_status; + } + + /** + * Indicates whether this channel has been verified or not. On a + * [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] + * or + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation, this field is expected to be populated. + * If the value is `UNVERIFIED`, then it indicates that the channel is + * non-functioning (it both requires verification and lacks verification); + * otherwise, it is assumed that the channel works. + * If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that + * the channel is of a type that does not require verification or that + * this specific channel has been exempted from verification because it was + * created prior to verification being required for channels of this type. + * This field cannot be modified using a standard + * [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] + * operation. To change the value of this field, you must call + * [`VerifyNotificationChannel`][google.monitoring.v3.NotificationChannelService.VerifyNotificationChannel]. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel.VerificationStatus verification_status = 9; + * @param int $var + * @return $this + */ + public function setVerificationStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\NotificationChannel\VerificationStatus::class); + $this->verification_status = $var; + + return $this; + } + + /** + * Whether notifications are forwarded to the described channel. This makes + * it possible to disable delivery of notifications to a particular channel + * without removing the channel from all alerting policies that reference + * the channel. This is a more convenient approach when the change is + * temporary and you want to receive notifications from the same set + * of alerting policies on the channel at some point in the future. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; + * @return \Google\Protobuf\BoolValue|null + */ + public function getEnabled() + { + return $this->enabled; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Returns the unboxed value from getEnabled() + + * Whether notifications are forwarded to the described channel. This makes + * it possible to disable delivery of notifications to a particular channel + * without removing the channel from all alerting policies that reference + * the channel. This is a more convenient approach when the change is + * temporary and you want to receive notifications from the same set + * of alerting policies on the channel at some point in the future. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; + * @return bool|null + */ + public function getEnabledUnwrapped() + { + return $this->readWrapperValue("enabled"); + } + + /** + * Whether notifications are forwarded to the described channel. This makes + * it possible to disable delivery of notifications to a particular channel + * without removing the channel from all alerting policies that reference + * the channel. This is a more convenient approach when the change is + * temporary and you want to receive notifications from the same set + * of alerting policies on the channel at some point in the future. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; + * @param \Google\Protobuf\BoolValue $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); + $this->enabled = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. + + * Whether notifications are forwarded to the described channel. This makes + * it possible to disable delivery of notifications to a particular channel + * without removing the channel from all alerting policies that reference + * the channel. This is a more convenient approach when the change is + * temporary and you want to receive notifications from the same set + * of alerting policies on the channel at some point in the future. + * + * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; + * @param bool|null $var + * @return $this + */ + public function setEnabledUnwrapped($var) + { + $this->writeWrapperValue("enabled", $var); + return $this;} + + /** + * Record of the creation of this channel. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; + * @return \Google\Cloud\Monitoring\V3\MutationRecord|null + */ + public function getCreationRecord() + { + return $this->creation_record; + } + + public function hasCreationRecord() + { + return isset($this->creation_record); + } + + public function clearCreationRecord() + { + unset($this->creation_record); + } + + /** + * Record of the creation of this channel. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; + * @param \Google\Cloud\Monitoring\V3\MutationRecord $var + * @return $this + */ + public function setCreationRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\MutationRecord::class); + $this->creation_record = $var; + + return $this; + } + + /** + * Records of the modification of this channel. + * + * Generated from protobuf field repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMutationRecords() + { + return $this->mutation_records; + } + + /** + * Records of the modification of this channel. + * + * Generated from protobuf field repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + * @param \Google\Cloud\Monitoring\V3\MutationRecord[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMutationRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\MutationRecord::class); + $this->mutation_records = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php new file mode 100644 index 00000000000..2b70fa84287 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php @@ -0,0 +1,76 @@ +google.monitoring.v3.NotificationChannel.VerificationStatus + */ +class VerificationStatus +{ + /** + * Sentinel value used to indicate that the state is unknown, omitted, or + * is not applicable (as in the case of channels that neither support + * nor require verification in order to function). + * + * Generated from protobuf enum VERIFICATION_STATUS_UNSPECIFIED = 0; + */ + const VERIFICATION_STATUS_UNSPECIFIED = 0; + /** + * The channel has yet to be verified and requires verification to function. + * Note that this state also applies to the case where the verification + * process has been initiated by sending a verification code but where + * the verification code has not been submitted to complete the process. + * + * Generated from protobuf enum UNVERIFIED = 1; + */ + const UNVERIFIED = 1; + /** + * It has been proven that notifications can be received on this + * notification channel and that someone on the project has access + * to messages that are delivered to that channel. + * + * Generated from protobuf enum VERIFIED = 2; + */ + const VERIFIED = 2; + + private static $valueToName = [ + self::VERIFICATION_STATUS_UNSPECIFIED => 'VERIFICATION_STATUS_UNSPECIFIED', + self::UNVERIFIED => 'UNVERIFIED', + self::VERIFIED => 'VERIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VerificationStatus::class, \Google\Cloud\Monitoring\V3\NotificationChannel_VerificationStatus::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php new file mode 100644 index 00000000000..d7bee5fa72b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php @@ -0,0 +1,326 @@ +google.monitoring.v3.NotificationChannelDescriptor + */ +class NotificationChannelDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * The full REST resource name for this descriptor. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] + * In the above, `[TYPE]` is the value of the `type` field. + * + * Generated from protobuf field string name = 6; + */ + protected $name = ''; + /** + * The type of notification channel, such as "email" and "sms". To view the + * full list of channels, see + * [Channel + * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). + * Notification channel types are globally unique. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * A human-readable name for the notification channel type. This + * form of the name is suitable for a user interface. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * A human-readable description of the notification channel + * type. The description may include a description of the properties + * of the channel and pointers to external documentation. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * The set of labels that must be defined to identify a particular + * channel of the corresponding type. Each label includes a + * description for how that field should be populated. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; + */ + private $labels; + /** + * The tiers that support this notification channel; the project service tier + * must be one of the supported_tiers. + * + * Generated from protobuf field repeated .google.monitoring.v3.ServiceTier supported_tiers = 5 [deprecated = true]; + * @deprecated + */ + private $supported_tiers; + /** + * The product launch stage for channels of this type. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; + */ + protected $launch_stage = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The full REST resource name for this descriptor. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] + * In the above, `[TYPE]` is the value of the `type` field. + * @type string $type + * The type of notification channel, such as "email" and "sms". To view the + * full list of channels, see + * [Channel + * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). + * Notification channel types are globally unique. + * @type string $display_name + * A human-readable name for the notification channel type. This + * form of the name is suitable for a user interface. + * @type string $description + * A human-readable description of the notification channel + * type. The description may include a description of the properties + * of the channel and pointers to external documentation. + * @type \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $labels + * The set of labels that must be defined to identify a particular + * channel of the corresponding type. Each label includes a + * description for how that field should be populated. + * @type int[]|\Google\Protobuf\Internal\RepeatedField $supported_tiers + * The tiers that support this notification channel; the project service tier + * must be one of the supported_tiers. + * @type int $launch_stage + * The product launch stage for channels of this type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Notification::initOnce(); + parent::__construct($data); + } + + /** + * The full REST resource name for this descriptor. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] + * In the above, `[TYPE]` is the value of the `type` field. + * + * Generated from protobuf field string name = 6; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The full REST resource name for this descriptor. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] + * In the above, `[TYPE]` is the value of the `type` field. + * + * Generated from protobuf field string name = 6; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The type of notification channel, such as "email" and "sms". To view the + * full list of channels, see + * [Channel + * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). + * Notification channel types are globally unique. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of notification channel, such as "email" and "sms". To view the + * full list of channels, see + * [Channel + * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). + * Notification channel types are globally unique. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * A human-readable name for the notification channel type. This + * form of the name is suitable for a user interface. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A human-readable name for the notification channel type. This + * form of the name is suitable for a user interface. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * A human-readable description of the notification channel + * type. The description may include a description of the properties + * of the channel and pointers to external documentation. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * A human-readable description of the notification channel + * type. The description may include a description of the properties + * of the channel and pointers to external documentation. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The set of labels that must be defined to identify a particular + * channel of the corresponding type. Each label includes a + * description for how that field should be populated. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of labels that must be defined to identify a particular + * channel of the corresponding type. Each label includes a + * description for how that field should be populated. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; + * @param \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class); + $this->labels = $arr; + + return $this; + } + + /** + * The tiers that support this notification channel; the project service tier + * must be one of the supported_tiers. + * + * Generated from protobuf field repeated .google.monitoring.v3.ServiceTier supported_tiers = 5 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getSupportedTiers() + { + @trigger_error('supported_tiers is deprecated.', E_USER_DEPRECATED); + return $this->supported_tiers; + } + + /** + * The tiers that support this notification channel; the project service tier + * must be one of the supported_tiers. + * + * Generated from protobuf field repeated .google.monitoring.v3.ServiceTier supported_tiers = 5 [deprecated = true]; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setSupportedTiers($var) + { + @trigger_error('supported_tiers is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Monitoring\V3\ServiceTier::class); + $this->supported_tiers = $arr; + + return $this; + } + + /** + * The product launch stage for channels of this type. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * The product launch stage for channels of this type. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelServiceGrpcClient.php new file mode 100644 index 00000000000..9625fbee53c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelServiceGrpcClient.php @@ -0,0 +1,217 @@ +_simpleRequest('/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors', + $argument, + ['\Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a single channel descriptor. The descriptor indicates which fields + * are expected / permitted for a notification channel of the given type. + * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetNotificationChannelDescriptor(\Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor', + $argument, + ['\Google\Cloud\Monitoring\V3\NotificationChannelDescriptor', 'decode'], + $metadata, $options); + } + + /** + * Lists the notification channels that have been created for the project. + * @param \Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListNotificationChannels(\Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/ListNotificationChannels', + $argument, + ['\Google\Cloud\Monitoring\V3\ListNotificationChannelsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a single notification channel. The channel includes the relevant + * configuration details with which the channel was created. However, the + * response may truncate or omit passwords, API keys, or other private key + * matter and thus the response may not be 100% identical to the information + * that was supplied in the call to the create method. + * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetNotificationChannel(\Google\Cloud\Monitoring\V3\GetNotificationChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/GetNotificationChannel', + $argument, + ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], + $metadata, $options); + } + + /** + * Creates a new notification channel, representing a single notification + * endpoint such as an email address, SMS number, or PagerDuty service. + * @param \Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateNotificationChannel(\Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel', + $argument, + ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], + $metadata, $options); + } + + /** + * Updates a notification channel. Fields not specified in the field mask + * remain unchanged. + * @param \Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateNotificationChannel(\Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel', + $argument, + ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], + $metadata, $options); + } + + /** + * Deletes a notification channel. + * @param \Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteNotificationChannel(\Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Causes a verification code to be delivered to the channel. The code + * can then be supplied in `VerifyNotificationChannel` to verify the channel. + * @param \Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SendNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Requests a verification code for an already verified channel that can then + * be used in a call to VerifyNotificationChannel() on a different channel + * with an equivalent identity in the same or in a different project. This + * makes it possible to copy a channel between projects without requiring + * manual reverification of the channel. If the channel is not in the + * verified state, this method will fail (in other words, this may only be + * used if the SendNotificationChannelVerificationCode and + * VerifyNotificationChannel paths have already been used to put the given + * channel into the verified state). + * + * There is no guarantee that the verification codes returned by this method + * will be of a similar structure or form as the ones that are delivered + * to the channel via SendNotificationChannelVerificationCode; while + * VerifyNotificationChannel() will recognize both the codes delivered via + * SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that + * the verification codes delivered via + * SendNotificationChannelVerificationCode() will be shorter and also + * have a shorter expiration (e.g. codes such as "G-123456") whereas + * GetVerificationCode() will typically return a much longer, websafe base + * 64 encoded string that has a longer expiration time. + * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode', + $argument, + ['\Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse', 'decode'], + $metadata, $options); + } + + /** + * Verifies a `NotificationChannel` by proving receipt of the code + * delivered to the channel as a result of calling + * `SendNotificationChannelVerificationCode`. + * @param \Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function VerifyNotificationChannel(\Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel', + $argument, + ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel_VerificationStatus.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel_VerificationStatus.php new file mode 100644 index 00000000000..86f961f17d0 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel_VerificationStatus.php @@ -0,0 +1,16 @@ +google.monitoring.v3.Point + */ +class Point extends \Google\Protobuf\Internal\Message +{ + /** + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time is optional, but if it is supplied, it must equal the + * end time. For `DELTA` metrics, the start + * and end time should specify a non-zero interval, with subsequent points + * specifying contiguous and non-overlapping intervals. For `CUMULATIVE` + * metrics, the start and end time should specify a non-zero interval, with + * subsequent points specifying the same start time and increasing end times, + * until an event resets the cumulative value to zero and sets a new start + * time for the following points. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 1; + */ + protected $interval = null; + /** + * The value of the data point. + * + * Generated from protobuf field .google.monitoring.v3.TypedValue value = 2; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\TimeInterval $interval + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time is optional, but if it is supplied, it must equal the + * end time. For `DELTA` metrics, the start + * and end time should specify a non-zero interval, with subsequent points + * specifying contiguous and non-overlapping intervals. For `CUMULATIVE` + * metrics, the start and end time should specify a non-zero interval, with + * subsequent points specifying the same start time and increasing end times, + * until an event resets the cumulative value to zero and sets a new start + * time for the following points. + * @type \Google\Cloud\Monitoring\V3\TypedValue $value + * The value of the data point. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time is optional, but if it is supplied, it must equal the + * end time. For `DELTA` metrics, the start + * and end time should specify a non-zero interval, with subsequent points + * specifying contiguous and non-overlapping intervals. For `CUMULATIVE` + * metrics, the start and end time should specify a non-zero interval, with + * subsequent points specifying the same start time and increasing end times, + * until an event resets the cumulative value to zero and sets a new start + * time for the following points. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 1; + * @return \Google\Cloud\Monitoring\V3\TimeInterval|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * The time interval to which the data point applies. For `GAUGE` metrics, + * the start time is optional, but if it is supplied, it must equal the + * end time. For `DELTA` metrics, the start + * and end time should specify a non-zero interval, with subsequent points + * specifying contiguous and non-overlapping intervals. For `CUMULATIVE` + * metrics, the start and end time should specify a non-zero interval, with + * subsequent points specifying the same start time and increasing end times, + * until an event resets the cumulative value to zero and sets a new start + * time for the following points. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 1; + * @param \Google\Cloud\Monitoring\V3\TimeInterval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeInterval::class); + $this->interval = $var; + + return $this; + } + + /** + * The value of the data point. + * + * Generated from protobuf field .google.monitoring.v3.TypedValue value = 2; + * @return \Google\Cloud\Monitoring\V3\TypedValue|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value of the data point. + * + * Generated from protobuf field .google.monitoring.v3.TypedValue value = 2; + * @param \Google\Cloud\Monitoring\V3\TypedValue $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TypedValue::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php new file mode 100644 index 00000000000..8ff8ad79a2a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php @@ -0,0 +1,115 @@ +google.monitoring.v3.QueryError + */ +class QueryError extends \Google\Protobuf\Internal\Message +{ + /** + * The location of the time series query language text that this error applies + * to. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator locator = 1; + */ + protected $locator = null; + /** + * The error message. + * + * Generated from protobuf field string message = 2; + */ + protected $message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\TextLocator $locator + * The location of the time series query language text that this error applies + * to. + * @type string $message + * The error message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The location of the time series query language text that this error applies + * to. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator locator = 1; + * @return \Google\Cloud\Monitoring\V3\TextLocator|null + */ + public function getLocator() + { + return $this->locator; + } + + public function hasLocator() + { + return isset($this->locator); + } + + public function clearLocator() + { + unset($this->locator); + } + + /** + * The location of the time series query language text that this error applies + * to. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator locator = 1; + * @param \Google\Cloud\Monitoring\V3\TextLocator $var + * @return $this + */ + public function setLocator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator::class); + $this->locator = $var; + + return $this; + } + + /** + * The error message. + * + * Generated from protobuf field string message = 2; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * The error message. + * + * Generated from protobuf field string message = 2; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php new file mode 100644 index 00000000000..7737c20a353 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php @@ -0,0 +1,105 @@ +google.monitoring.v3.QueryErrorList + */ +class QueryErrorList extends \Google\Protobuf\Internal\Message +{ + /** + * Errors in parsing the time series query language text. The number of errors + * in the response may be limited. + * + * Generated from protobuf field repeated .google.monitoring.v3.QueryError errors = 1; + */ + private $errors; + /** + * A summary of all the errors. + * + * Generated from protobuf field string error_summary = 2; + */ + protected $error_summary = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\QueryError[]|\Google\Protobuf\Internal\RepeatedField $errors + * Errors in parsing the time series query language text. The number of errors + * in the response may be limited. + * @type string $error_summary + * A summary of all the errors. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Errors in parsing the time series query language text. The number of errors + * in the response may be limited. + * + * Generated from protobuf field repeated .google.monitoring.v3.QueryError errors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Errors in parsing the time series query language text. The number of errors + * in the response may be limited. + * + * Generated from protobuf field repeated .google.monitoring.v3.QueryError errors = 1; + * @param \Google\Cloud\Monitoring\V3\QueryError[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\QueryError::class); + $this->errors = $arr; + + return $this; + } + + /** + * A summary of all the errors. + * + * Generated from protobuf field string error_summary = 2; + * @return string + */ + public function getErrorSummary() + { + return $this->error_summary; + } + + /** + * A summary of all the errors. + * + * Generated from protobuf field string error_summary = 2; + * @param string $var + * @return $this + */ + public function setErrorSummary($var) + { + GPBUtil::checkString($var, True); + $this->error_summary = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryServiceGrpcClient.php new file mode 100644 index 00000000000..0485d6f9c14 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryServiceGrpcClient.php @@ -0,0 +1,52 @@ +_simpleRequest('/google.monitoring.v3.QueryService/QueryTimeSeries', + $argument, + ['\Google\Cloud\Monitoring\V3\QueryTimeSeriesResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php new file mode 100644 index 00000000000..aa0c8a189c1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php @@ -0,0 +1,193 @@ +google.monitoring.v3.QueryTimeSeriesRequest + */ +class QueryTimeSeriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The query in the [Monitoring Query + * Language](https://cloud.google.com/monitoring/mql/reference) format. + * The default time zone is in UTC. + * + * Generated from protobuf field string query = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * A positive number that is the maximum number of time_series_data to return. + * + * Generated from protobuf field int32 page_size = 9; + */ + protected $page_size = 0; + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 10; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type string $query + * Required. The query in the [Monitoring Query + * Language](https://cloud.google.com/monitoring/mql/reference) format. + * The default time zone is in UTC. + * @type int $page_size + * A positive number that is the maximum number of time_series_data to return. + * @type string $page_token + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The query in the [Monitoring Query + * Language](https://cloud.google.com/monitoring/mql/reference) format. + * The default time zone is in UTC. + * + * Generated from protobuf field string query = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The query in the [Monitoring Query + * Language](https://cloud.google.com/monitoring/mql/reference) format. + * The default time zone is in UTC. + * + * Generated from protobuf field string query = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * A positive number that is the maximum number of time_series_data to return. + * + * Generated from protobuf field int32 page_size = 9; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * A positive number that is the maximum number of time_series_data to return. + * + * Generated from protobuf field int32 page_size = 9; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 10; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * + * Generated from protobuf field string page_token = 10; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php new file mode 100644 index 00000000000..03893547442 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php @@ -0,0 +1,195 @@ +google.monitoring.v3.QueryTimeSeriesResponse + */ +class QueryTimeSeriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The descriptor for the time series data. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeriesDescriptor time_series_descriptor = 8; + */ + protected $time_series_descriptor = null; + /** + * The time series data. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData time_series_data = 9; + */ + private $time_series_data; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 10; + */ + protected $next_page_token = ''; + /** + * Query execution errors that may have caused the time series data returned + * to be incomplete. The available data will be available in the + * response. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 11; + */ + private $partial_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor $time_series_descriptor + * The descriptor for the time series data. + * @type \Google\Cloud\Monitoring\V3\TimeSeriesData[]|\Google\Protobuf\Internal\RepeatedField $time_series_data + * The time series data. + * @type string $next_page_token + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * @type \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $partial_errors + * Query execution errors that may have caused the time series data returned + * to be incomplete. The available data will be available in the + * response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); + parent::__construct($data); + } + + /** + * The descriptor for the time series data. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeriesDescriptor time_series_descriptor = 8; + * @return \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor|null + */ + public function getTimeSeriesDescriptor() + { + return $this->time_series_descriptor; + } + + public function hasTimeSeriesDescriptor() + { + return isset($this->time_series_descriptor); + } + + public function clearTimeSeriesDescriptor() + { + unset($this->time_series_descriptor); + } + + /** + * The descriptor for the time series data. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeriesDescriptor time_series_descriptor = 8; + * @param \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor $var + * @return $this + */ + public function setTimeSeriesDescriptor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor::class); + $this->time_series_descriptor = $var; + + return $this; + } + + /** + * The time series data. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData time_series_data = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimeSeriesData() + { + return $this->time_series_data; + } + + /** + * The time series data. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData time_series_data = 9; + * @param \Google\Cloud\Monitoring\V3\TimeSeriesData[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimeSeriesData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeriesData::class); + $this->time_series_data = $arr; + + return $this; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 10; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * `page_token` in the next call to this method. + * + * Generated from protobuf field string next_page_token = 10; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Query execution errors that may have caused the time series data returned + * to be incomplete. The available data will be available in the + * response. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartialErrors() + { + return $this->partial_errors; + } + + /** + * Query execution errors that may have caused the time series data returned + * to be incomplete. The available data will be available in the + * response. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 11; + * @param \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartialErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php new file mode 100644 index 00000000000..3dd0db9c39f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php @@ -0,0 +1,101 @@ +google.monitoring.v3.Range + */ +class Range extends \Google\Protobuf\Internal\Message +{ + /** + * Range minimum. + * + * Generated from protobuf field double min = 1; + */ + protected $min = 0.0; + /** + * Range maximum. + * + * Generated from protobuf field double max = 2; + */ + protected $max = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $min + * Range minimum. + * @type float $max + * Range maximum. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * Range minimum. + * + * Generated from protobuf field double min = 1; + * @return float + */ + public function getMin() + { + return $this->min; + } + + /** + * Range minimum. + * + * Generated from protobuf field double min = 1; + * @param float $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkDouble($var); + $this->min = $var; + + return $this; + } + + /** + * Range maximum. + * + * Generated from protobuf field double max = 2; + * @return float + */ + public function getMax() + { + return $this->max; + } + + /** + * Range maximum. + * + * Generated from protobuf field double max = 2; + * @param float $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkDouble($var); + $this->max = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php new file mode 100644 index 00000000000..e4820f273c2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php @@ -0,0 +1,121 @@ +google.monitoring.v3.RequestBasedSli + */ +class RequestBasedSli extends \Google\Protobuf\Internal\Message +{ + protected $method; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\TimeSeriesRatio $good_total_ratio + * `good_total_ratio` is used when the ratio of `good_service` to + * `total_service` is computed from two `TimeSeries`. + * @type \Google\Cloud\Monitoring\V3\DistributionCut $distribution_cut + * `distribution_cut` is used when `good_service` is a count of values + * aggregated in a `Distribution` that fall into a good range. The + * `total_service` is the total count of all values aggregated in the + * `Distribution`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * `good_total_ratio` is used when the ratio of `good_service` to + * `total_service` is computed from two `TimeSeries`. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + * @return \Google\Cloud\Monitoring\V3\TimeSeriesRatio|null + */ + public function getGoodTotalRatio() + { + return $this->readOneof(1); + } + + public function hasGoodTotalRatio() + { + return $this->hasOneof(1); + } + + /** + * `good_total_ratio` is used when the ratio of `good_service` to + * `total_service` is computed from two `TimeSeries`. + * + * Generated from protobuf field .google.monitoring.v3.TimeSeriesRatio good_total_ratio = 1; + * @param \Google\Cloud\Monitoring\V3\TimeSeriesRatio $var + * @return $this + */ + public function setGoodTotalRatio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeSeriesRatio::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * `distribution_cut` is used when `good_service` is a count of values + * aggregated in a `Distribution` that fall into a good range. The + * `total_service` is the total count of all values aggregated in the + * `Distribution`. + * + * Generated from protobuf field .google.monitoring.v3.DistributionCut distribution_cut = 3; + * @return \Google\Cloud\Monitoring\V3\DistributionCut|null + */ + public function getDistributionCut() + { + return $this->readOneof(3); + } + + public function hasDistributionCut() + { + return $this->hasOneof(3); + } + + /** + * `distribution_cut` is used when `good_service` is a count of values + * aggregated in a `Distribution` that fall into a good range. The + * `total_service` is the total count of all values aggregated in the + * `Distribution`. + * + * Generated from protobuf field .google.monitoring.v3.DistributionCut distribution_cut = 3; + * @param \Google\Cloud\Monitoring\V3\DistributionCut $var + * @return $this + */ + public function setDistributionCut($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\DistributionCut::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getMethod() + { + return $this->whichOneof("method"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php new file mode 100644 index 00000000000..97fba93c165 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php @@ -0,0 +1,67 @@ +google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + */ +class SendNotificationChannelVerificationCodeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The notification channel to which to send a verification code. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The notification channel to which to send a verification code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The notification channel to which to send a verification code. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The notification channel to which to send a verification code. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php new file mode 100644 index 00000000000..a07a1f621e8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php @@ -0,0 +1,420 @@ +google.monitoring.v3.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for this Service. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Name used for UI elements listing this Service. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Configuration for how to query telemetry on a Service. + * + * Generated from protobuf field .google.monitoring.v3.Service.Telemetry telemetry = 13; + */ + protected $telemetry = null; + /** + * Labels which have been used to annotate the service. Label keys must start + * with a letter. Label keys and values may contain lowercase letters, + * numbers, underscores, and dashes. Label keys and values have a maximum + * length of 63 characters, and must be less than 128 bytes in size. Up to 64 + * label entries may be stored. For labels which do not have a semantic value, + * the empty string may be supplied for the label value. + * + * Generated from protobuf field map user_labels = 14; + */ + private $user_labels; + protected $identifier; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name for this Service. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @type string $display_name + * Name used for UI elements listing this Service. + * @type \Google\Cloud\Monitoring\V3\Service\Custom $custom + * Custom service type. + * @type \Google\Cloud\Monitoring\V3\Service\AppEngine $app_engine + * Type used for App Engine services. + * @type \Google\Cloud\Monitoring\V3\Service\CloudEndpoints $cloud_endpoints + * Type used for Cloud Endpoints services. + * @type \Google\Cloud\Monitoring\V3\Service\ClusterIstio $cluster_istio + * Type used for Istio services that live in a Kubernetes cluster. + * @type \Google\Cloud\Monitoring\V3\Service\MeshIstio $mesh_istio + * Type used for Istio services scoped to an Istio mesh. + * @type \Google\Cloud\Monitoring\V3\Service\IstioCanonicalService $istio_canonical_service + * Type used for canonical services scoped to an Istio mesh. + * Metrics for Istio are + * [documented here](https://istio.io/latest/docs/reference/config/metrics/) + * @type \Google\Cloud\Monitoring\V3\Service\Telemetry $telemetry + * Configuration for how to query telemetry on a Service. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * Labels which have been used to annotate the service. Label keys must start + * with a letter. Label keys and values may contain lowercase letters, + * numbers, underscores, and dashes. Label keys and values have a maximum + * length of 63 characters, and must be less than 128 bytes in size. Up to 64 + * label entries may be stored. For labels which do not have a semantic value, + * the empty string may be supplied for the label value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for this Service. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name for this Service. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Name used for UI elements listing this Service. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Name used for UI elements listing this Service. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Custom service type. + * + * Generated from protobuf field .google.monitoring.v3.Service.Custom custom = 6; + * @return \Google\Cloud\Monitoring\V3\Service\Custom|null + */ + public function getCustom() + { + return $this->readOneof(6); + } + + public function hasCustom() + { + return $this->hasOneof(6); + } + + /** + * Custom service type. + * + * Generated from protobuf field .google.monitoring.v3.Service.Custom custom = 6; + * @param \Google\Cloud\Monitoring\V3\Service\Custom $var + * @return $this + */ + public function setCustom($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\Custom::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Type used for App Engine services. + * + * Generated from protobuf field .google.monitoring.v3.Service.AppEngine app_engine = 7; + * @return \Google\Cloud\Monitoring\V3\Service\AppEngine|null + */ + public function getAppEngine() + { + return $this->readOneof(7); + } + + public function hasAppEngine() + { + return $this->hasOneof(7); + } + + /** + * Type used for App Engine services. + * + * Generated from protobuf field .google.monitoring.v3.Service.AppEngine app_engine = 7; + * @param \Google\Cloud\Monitoring\V3\Service\AppEngine $var + * @return $this + */ + public function setAppEngine($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\AppEngine::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Type used for Cloud Endpoints services. + * + * Generated from protobuf field .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + * @return \Google\Cloud\Monitoring\V3\Service\CloudEndpoints|null + */ + public function getCloudEndpoints() + { + return $this->readOneof(8); + } + + public function hasCloudEndpoints() + { + return $this->hasOneof(8); + } + + /** + * Type used for Cloud Endpoints services. + * + * Generated from protobuf field .google.monitoring.v3.Service.CloudEndpoints cloud_endpoints = 8; + * @param \Google\Cloud\Monitoring\V3\Service\CloudEndpoints $var + * @return $this + */ + public function setCloudEndpoints($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\CloudEndpoints::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Type used for Istio services that live in a Kubernetes cluster. + * + * Generated from protobuf field .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + * @return \Google\Cloud\Monitoring\V3\Service\ClusterIstio|null + */ + public function getClusterIstio() + { + return $this->readOneof(9); + } + + public function hasClusterIstio() + { + return $this->hasOneof(9); + } + + /** + * Type used for Istio services that live in a Kubernetes cluster. + * + * Generated from protobuf field .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9; + * @param \Google\Cloud\Monitoring\V3\Service\ClusterIstio $var + * @return $this + */ + public function setClusterIstio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\ClusterIstio::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Type used for Istio services scoped to an Istio mesh. + * + * Generated from protobuf field .google.monitoring.v3.Service.MeshIstio mesh_istio = 10; + * @return \Google\Cloud\Monitoring\V3\Service\MeshIstio|null + */ + public function getMeshIstio() + { + return $this->readOneof(10); + } + + public function hasMeshIstio() + { + return $this->hasOneof(10); + } + + /** + * Type used for Istio services scoped to an Istio mesh. + * + * Generated from protobuf field .google.monitoring.v3.Service.MeshIstio mesh_istio = 10; + * @param \Google\Cloud\Monitoring\V3\Service\MeshIstio $var + * @return $this + */ + public function setMeshIstio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\MeshIstio::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Type used for canonical services scoped to an Istio mesh. + * Metrics for Istio are + * [documented here](https://istio.io/latest/docs/reference/config/metrics/) + * + * Generated from protobuf field .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * @return \Google\Cloud\Monitoring\V3\Service\IstioCanonicalService|null + */ + public function getIstioCanonicalService() + { + return $this->readOneof(11); + } + + public function hasIstioCanonicalService() + { + return $this->hasOneof(11); + } + + /** + * Type used for canonical services scoped to an Istio mesh. + * Metrics for Istio are + * [documented here](https://istio.io/latest/docs/reference/config/metrics/) + * + * Generated from protobuf field .google.monitoring.v3.Service.IstioCanonicalService istio_canonical_service = 11; + * @param \Google\Cloud\Monitoring\V3\Service\IstioCanonicalService $var + * @return $this + */ + public function setIstioCanonicalService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\IstioCanonicalService::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Configuration for how to query telemetry on a Service. + * + * Generated from protobuf field .google.monitoring.v3.Service.Telemetry telemetry = 13; + * @return \Google\Cloud\Monitoring\V3\Service\Telemetry|null + */ + public function getTelemetry() + { + return $this->telemetry; + } + + public function hasTelemetry() + { + return isset($this->telemetry); + } + + public function clearTelemetry() + { + unset($this->telemetry); + } + + /** + * Configuration for how to query telemetry on a Service. + * + * Generated from protobuf field .google.monitoring.v3.Service.Telemetry telemetry = 13; + * @param \Google\Cloud\Monitoring\V3\Service\Telemetry $var + * @return $this + */ + public function setTelemetry($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\Telemetry::class); + $this->telemetry = $var; + + return $this; + } + + /** + * Labels which have been used to annotate the service. Label keys must start + * with a letter. Label keys and values may contain lowercase letters, + * numbers, underscores, and dashes. Label keys and values have a maximum + * length of 63 characters, and must be less than 128 bytes in size. Up to 64 + * label entries may be stored. For labels which do not have a semantic value, + * the empty string may be supplied for the label value. + * + * Generated from protobuf field map user_labels = 14; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * Labels which have been used to annotate the service. Label keys must start + * with a letter. Label keys and values may contain lowercase letters, + * numbers, underscores, and dashes. Label keys and values have a maximum + * length of 63 characters, and must be less than 128 bytes in size. Up to 64 + * label entries may be stored. For labels which do not have a semantic value, + * the empty string may be supplied for the label value. + * + * Generated from protobuf field map user_labels = 14; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + + /** + * @return string + */ + public function getIdentifier() + { + return $this->whichOneof("identifier"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php new file mode 100644 index 00000000000..8f04ef19e93 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php @@ -0,0 +1,78 @@ +google.monitoring.v3.Service.AppEngine + */ +class AppEngine extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the App Engine module underlying this service. Corresponds to + * the `module_id` resource label in the `gae_app` monitored resource: + * https://cloud.google.com/monitoring/api/resources#tag_gae_app + * + * Generated from protobuf field string module_id = 1; + */ + protected $module_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $module_id + * The ID of the App Engine module underlying this service. Corresponds to + * the `module_id` resource label in the `gae_app` monitored resource: + * https://cloud.google.com/monitoring/api/resources#tag_gae_app + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the App Engine module underlying this service. Corresponds to + * the `module_id` resource label in the `gae_app` monitored resource: + * https://cloud.google.com/monitoring/api/resources#tag_gae_app + * + * Generated from protobuf field string module_id = 1; + * @return string + */ + public function getModuleId() + { + return $this->module_id; + } + + /** + * The ID of the App Engine module underlying this service. Corresponds to + * the `module_id` resource label in the `gae_app` monitored resource: + * https://cloud.google.com/monitoring/api/resources#tag_gae_app + * + * Generated from protobuf field string module_id = 1; + * @param string $var + * @return $this + */ + public function setModuleId($var) + { + GPBUtil::checkString($var, True); + $this->module_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AppEngine::class, \Google\Cloud\Monitoring\V3\Service_AppEngine::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php new file mode 100644 index 00000000000..24cc957f7c8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php @@ -0,0 +1,78 @@ +google.monitoring.v3.Service.CloudEndpoints + */ +class CloudEndpoints extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the Cloud Endpoints service underlying this service. + * Corresponds to the `service` resource label in the `api` monitored + * resource: https://cloud.google.com/monitoring/api/resources#tag_api + * + * Generated from protobuf field string service = 1; + */ + protected $service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * The name of the Cloud Endpoints service underlying this service. + * Corresponds to the `service` resource label in the `api` monitored + * resource: https://cloud.google.com/monitoring/api/resources#tag_api + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * The name of the Cloud Endpoints service underlying this service. + * Corresponds to the `service` resource label in the `api` monitored + * resource: https://cloud.google.com/monitoring/api/resources#tag_api + * + * Generated from protobuf field string service = 1; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * The name of the Cloud Endpoints service underlying this service. + * Corresponds to the `service` resource label in the `api` monitored + * resource: https://cloud.google.com/monitoring/api/resources#tag_api + * + * Generated from protobuf field string service = 1; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudEndpoints::class, \Google\Cloud\Monitoring\V3\Service_CloudEndpoints::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php new file mode 100644 index 00000000000..bcbab5c1818 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php @@ -0,0 +1,198 @@ +google.monitoring.v3.Service.ClusterIstio + */ +class ClusterIstio extends \Google\Protobuf\Internal\Message +{ + /** + * The location of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `location` resource label in `k8s_cluster` + * resources. + * + * Generated from protobuf field string location = 1; + */ + protected $location = ''; + /** + * The name of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `cluster_name` resource label in + * `k8s_cluster` resources. + * + * Generated from protobuf field string cluster_name = 2; + */ + protected $cluster_name = ''; + /** + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * + * Generated from protobuf field string service_namespace = 3; + */ + protected $service_namespace = ''; + /** + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * + * Generated from protobuf field string service_name = 4; + */ + protected $service_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location + * The location of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `location` resource label in `k8s_cluster` + * resources. + * @type string $cluster_name + * The name of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `cluster_name` resource label in + * `k8s_cluster` resources. + * @type string $service_namespace + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * @type string $service_name + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * The location of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `location` resource label in `k8s_cluster` + * resources. + * + * Generated from protobuf field string location = 1; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * The location of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `location` resource label in `k8s_cluster` + * resources. + * + * Generated from protobuf field string location = 1; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * The name of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `cluster_name` resource label in + * `k8s_cluster` resources. + * + * Generated from protobuf field string cluster_name = 2; + * @return string + */ + public function getClusterName() + { + return $this->cluster_name; + } + + /** + * The name of the Kubernetes cluster in which this Istio service is + * defined. Corresponds to the `cluster_name` resource label in + * `k8s_cluster` resources. + * + * Generated from protobuf field string cluster_name = 2; + * @param string $var + * @return $this + */ + public function setClusterName($var) + { + GPBUtil::checkString($var, True); + $this->cluster_name = $var; + + return $this; + } + + /** + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * + * Generated from protobuf field string service_namespace = 3; + * @return string + */ + public function getServiceNamespace() + { + return $this->service_namespace; + } + + /** + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * + * Generated from protobuf field string service_namespace = 3; + * @param string $var + * @return $this + */ + public function setServiceNamespace($var) + { + GPBUtil::checkString($var, True); + $this->service_namespace = $var; + + return $this; + } + + /** + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * + * Generated from protobuf field string service_name = 4; + * @return string + */ + public function getServiceName() + { + return $this->service_name; + } + + /** + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * + * Generated from protobuf field string service_name = 4; + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClusterIstio::class, \Google\Cloud\Monitoring\V3\Service_ClusterIstio::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php new file mode 100644 index 00000000000..08ba22af9c2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php @@ -0,0 +1,37 @@ +google.monitoring.v3.Service.Custom + */ +class Custom extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Custom::class, \Google\Cloud\Monitoring\V3\Service_Custom::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php new file mode 100644 index 00000000000..0feb3f3aaa8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php @@ -0,0 +1,171 @@ += + * 1.6.8 will have their services ingested as this type. + * + * Generated from protobuf message google.monitoring.v3.Service.IstioCanonicalService + */ +class IstioCanonicalService extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier for the Istio mesh in which this canonical service is defined. + * Corresponds to the `mesh_uid` metric label in + * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string mesh_uid = 1; + */ + protected $mesh_uid = ''; + /** + * The namespace of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_namespace` metric + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string canonical_service_namespace = 3; + */ + protected $canonical_service_namespace = ''; + /** + * The name of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_name` metric label in + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string canonical_service = 4; + */ + protected $canonical_service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mesh_uid + * Identifier for the Istio mesh in which this canonical service is defined. + * Corresponds to the `mesh_uid` metric label in + * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * @type string $canonical_service_namespace + * The namespace of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_namespace` metric + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * @type string $canonical_service + * The name of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_name` metric label in + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * Identifier for the Istio mesh in which this canonical service is defined. + * Corresponds to the `mesh_uid` metric label in + * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string mesh_uid = 1; + * @return string + */ + public function getMeshUid() + { + return $this->mesh_uid; + } + + /** + * Identifier for the Istio mesh in which this canonical service is defined. + * Corresponds to the `mesh_uid` metric label in + * [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string mesh_uid = 1; + * @param string $var + * @return $this + */ + public function setMeshUid($var) + { + GPBUtil::checkString($var, True); + $this->mesh_uid = $var; + + return $this; + } + + /** + * The namespace of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_namespace` metric + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string canonical_service_namespace = 3; + * @return string + */ + public function getCanonicalServiceNamespace() + { + return $this->canonical_service_namespace; + } + + /** + * The namespace of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_namespace` metric + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string canonical_service_namespace = 3; + * @param string $var + * @return $this + */ + public function setCanonicalServiceNamespace($var) + { + GPBUtil::checkString($var, True); + $this->canonical_service_namespace = $var; + + return $this; + } + + /** + * The name of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_name` metric label in + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string canonical_service = 4; + * @return string + */ + public function getCanonicalService() + { + return $this->canonical_service; + } + + /** + * The name of the canonical service underlying this service. + * Corresponds to the `destination_canonical_service_name` metric label in + * label in [Istio + * metrics](https://cloud.google.com/monitoring/api/metrics_istio). + * + * Generated from protobuf field string canonical_service = 4; + * @param string $var + * @return $this + */ + public function setCanonicalService($var) + { + GPBUtil::checkString($var, True); + $this->canonical_service = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IstioCanonicalService::class, \Google\Cloud\Monitoring\V3\Service_IstioCanonicalService::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php new file mode 100644 index 00000000000..e90ac6f8b63 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php @@ -0,0 +1,151 @@ +google.monitoring.v3.Service.MeshIstio + */ +class MeshIstio extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier for the mesh in which this Istio service is defined. + * Corresponds to the `mesh_uid` metric label in Istio metrics. + * + * Generated from protobuf field string mesh_uid = 1; + */ + protected $mesh_uid = ''; + /** + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * + * Generated from protobuf field string service_namespace = 3; + */ + protected $service_namespace = ''; + /** + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * + * Generated from protobuf field string service_name = 4; + */ + protected $service_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mesh_uid + * Identifier for the mesh in which this Istio service is defined. + * Corresponds to the `mesh_uid` metric label in Istio metrics. + * @type string $service_namespace + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * @type string $service_name + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * Identifier for the mesh in which this Istio service is defined. + * Corresponds to the `mesh_uid` metric label in Istio metrics. + * + * Generated from protobuf field string mesh_uid = 1; + * @return string + */ + public function getMeshUid() + { + return $this->mesh_uid; + } + + /** + * Identifier for the mesh in which this Istio service is defined. + * Corresponds to the `mesh_uid` metric label in Istio metrics. + * + * Generated from protobuf field string mesh_uid = 1; + * @param string $var + * @return $this + */ + public function setMeshUid($var) + { + GPBUtil::checkString($var, True); + $this->mesh_uid = $var; + + return $this; + } + + /** + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * + * Generated from protobuf field string service_namespace = 3; + * @return string + */ + public function getServiceNamespace() + { + return $this->service_namespace; + } + + /** + * The namespace of the Istio service underlying this service. Corresponds + * to the `destination_service_namespace` metric label in Istio metrics. + * + * Generated from protobuf field string service_namespace = 3; + * @param string $var + * @return $this + */ + public function setServiceNamespace($var) + { + GPBUtil::checkString($var, True); + $this->service_namespace = $var; + + return $this; + } + + /** + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * + * Generated from protobuf field string service_name = 4; + * @return string + */ + public function getServiceName() + { + return $this->service_name; + } + + /** + * The name of the Istio service underlying this service. Corresponds to the + * `destination_service_name` metric label in Istio metrics. + * + * Generated from protobuf field string service_name = 4; + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MeshIstio::class, \Google\Cloud\Monitoring\V3\Service_MeshIstio::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php new file mode 100644 index 00000000000..6bb4bd89086 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php @@ -0,0 +1,74 @@ +google.monitoring.v3.Service.Telemetry + */ +class Telemetry extends \Google\Protobuf\Internal\Message +{ + /** + * The full name of the resource that defines this service. Formatted as + * described in https://cloud.google.com/apis/design/resource_names. + * + * Generated from protobuf field string resource_name = 1; + */ + protected $resource_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource_name + * The full name of the resource that defines this service. Formatted as + * described in https://cloud.google.com/apis/design/resource_names. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * The full name of the resource that defines this service. Formatted as + * described in https://cloud.google.com/apis/design/resource_names. + * + * Generated from protobuf field string resource_name = 1; + * @return string + */ + public function getResourceName() + { + return $this->resource_name; + } + + /** + * The full name of the resource that defines this service. Formatted as + * described in https://cloud.google.com/apis/design/resource_names. + * + * Generated from protobuf field string resource_name = 1; + * @param string $var + * @return $this + */ + public function setResourceName($var) + { + GPBUtil::checkString($var, True); + $this->resource_name = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Telemetry::class, \Google\Cloud\Monitoring\V3\Service_Telemetry::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php new file mode 100644 index 00000000000..a1d08a4e348 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php @@ -0,0 +1,153 @@ +google.monitoring.v3.ServiceLevelIndicator + */ +class ServiceLevelIndicator extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\BasicSli $basic_sli + * Basic SLI on a well-known service type. + * @type \Google\Cloud\Monitoring\V3\RequestBasedSli $request_based + * Request-based SLIs + * @type \Google\Cloud\Monitoring\V3\WindowsBasedSli $windows_based + * Windows-based SLIs + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * Basic SLI on a well-known service type. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli basic_sli = 4; + * @return \Google\Cloud\Monitoring\V3\BasicSli|null + */ + public function getBasicSli() + { + return $this->readOneof(4); + } + + public function hasBasicSli() + { + return $this->hasOneof(4); + } + + /** + * Basic SLI on a well-known service type. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli basic_sli = 4; + * @param \Google\Cloud\Monitoring\V3\BasicSli $var + * @return $this + */ + public function setBasicSli($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Request-based SLIs + * + * Generated from protobuf field .google.monitoring.v3.RequestBasedSli request_based = 1; + * @return \Google\Cloud\Monitoring\V3\RequestBasedSli|null + */ + public function getRequestBased() + { + return $this->readOneof(1); + } + + public function hasRequestBased() + { + return $this->hasOneof(1); + } + + /** + * Request-based SLIs + * + * Generated from protobuf field .google.monitoring.v3.RequestBasedSli request_based = 1; + * @param \Google\Cloud\Monitoring\V3\RequestBasedSli $var + * @return $this + */ + public function setRequestBased($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\RequestBasedSli::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Windows-based SLIs + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli windows_based = 2; + * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli|null + */ + public function getWindowsBased() + { + return $this->readOneof(2); + } + + public function hasWindowsBased() + { + return $this->hasOneof(2); + } + + /** + * Windows-based SLIs + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli windows_based = 2; + * @param \Google\Cloud\Monitoring\V3\WindowsBasedSli $var + * @return $this + */ + public function setWindowsBased($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php new file mode 100644 index 00000000000..82a234459a4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php @@ -0,0 +1,338 @@ +google.monitoring.v3.ServiceLevelObjective + */ +class ServiceLevelObjective extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for this `ServiceLevelObjective`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Name used for UI elements listing this SLO. + * + * Generated from protobuf field string display_name = 11; + */ + protected $display_name = ''; + /** + * The definition of good service, used to measure and calculate the quality + * of the `Service`'s performance with respect to a single aspect of service + * quality. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + */ + protected $service_level_indicator = null; + /** + * The fraction of service that must be good in order for this objective to be + * met. `0 < goal <= 0.999`. + * + * Generated from protobuf field double goal = 4; + */ + protected $goal = 0.0; + /** + * Labels which have been used to annotate the service-level objective. Label + * keys must start with a letter. Label keys and values may contain lowercase + * letters, numbers, underscores, and dashes. Label keys and values have a + * maximum length of 63 characters, and must be less than 128 bytes in size. + * Up to 64 label entries may be stored. For labels which do not have a + * semantic value, the empty string may be supplied for the label value. + * + * Generated from protobuf field map user_labels = 12; + */ + private $user_labels; + protected $period; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name for this `ServiceLevelObjective`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * @type string $display_name + * Name used for UI elements listing this SLO. + * @type \Google\Cloud\Monitoring\V3\ServiceLevelIndicator $service_level_indicator + * The definition of good service, used to measure and calculate the quality + * of the `Service`'s performance with respect to a single aspect of service + * quality. + * @type float $goal + * The fraction of service that must be good in order for this objective to be + * met. `0 < goal <= 0.999`. + * @type \Google\Protobuf\Duration $rolling_period + * A rolling time period, semantically "in the past ``". + * Must be an integer multiple of 1 day no larger than 30 days. + * @type int $calendar_period + * A calendar period, semantically "since the start of the current + * ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and + * `MONTH` are supported. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * Labels which have been used to annotate the service-level objective. Label + * keys must start with a letter. Label keys and values may contain lowercase + * letters, numbers, underscores, and dashes. Label keys and values have a + * maximum length of 63 characters, and must be less than 128 bytes in size. + * Up to 64 label entries may be stored. For labels which do not have a + * semantic value, the empty string may be supplied for the label value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for this `ServiceLevelObjective`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name for this `ServiceLevelObjective`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Name used for UI elements listing this SLO. + * + * Generated from protobuf field string display_name = 11; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Name used for UI elements listing this SLO. + * + * Generated from protobuf field string display_name = 11; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The definition of good service, used to measure and calculate the quality + * of the `Service`'s performance with respect to a single aspect of service + * quality. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + * @return \Google\Cloud\Monitoring\V3\ServiceLevelIndicator|null + */ + public function getServiceLevelIndicator() + { + return $this->service_level_indicator; + } + + public function hasServiceLevelIndicator() + { + return isset($this->service_level_indicator); + } + + public function clearServiceLevelIndicator() + { + unset($this->service_level_indicator); + } + + /** + * The definition of good service, used to measure and calculate the quality + * of the `Service`'s performance with respect to a single aspect of service + * quality. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; + * @param \Google\Cloud\Monitoring\V3\ServiceLevelIndicator $var + * @return $this + */ + public function setServiceLevelIndicator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\ServiceLevelIndicator::class); + $this->service_level_indicator = $var; + + return $this; + } + + /** + * The fraction of service that must be good in order for this objective to be + * met. `0 < goal <= 0.999`. + * + * Generated from protobuf field double goal = 4; + * @return float + */ + public function getGoal() + { + return $this->goal; + } + + /** + * The fraction of service that must be good in order for this objective to be + * met. `0 < goal <= 0.999`. + * + * Generated from protobuf field double goal = 4; + * @param float $var + * @return $this + */ + public function setGoal($var) + { + GPBUtil::checkDouble($var); + $this->goal = $var; + + return $this; + } + + /** + * A rolling time period, semantically "in the past ``". + * Must be an integer multiple of 1 day no larger than 30 days. + * + * Generated from protobuf field .google.protobuf.Duration rolling_period = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getRollingPeriod() + { + return $this->readOneof(5); + } + + public function hasRollingPeriod() + { + return $this->hasOneof(5); + } + + /** + * A rolling time period, semantically "in the past ``". + * Must be an integer multiple of 1 day no larger than 30 days. + * + * Generated from protobuf field .google.protobuf.Duration rolling_period = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRollingPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A calendar period, semantically "since the start of the current + * ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and + * `MONTH` are supported. + * + * Generated from protobuf field .google.type.CalendarPeriod calendar_period = 6; + * @return int + */ + public function getCalendarPeriod() + { + return $this->readOneof(6); + } + + public function hasCalendarPeriod() + { + return $this->hasOneof(6); + } + + /** + * A calendar period, semantically "since the start of the current + * ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and + * `MONTH` are supported. + * + * Generated from protobuf field .google.type.CalendarPeriod calendar_period = 6; + * @param int $var + * @return $this + */ + public function setCalendarPeriod($var) + { + GPBUtil::checkEnum($var, \Google\Type\CalendarPeriod::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Labels which have been used to annotate the service-level objective. Label + * keys must start with a letter. Label keys and values may contain lowercase + * letters, numbers, underscores, and dashes. Label keys and values have a + * maximum length of 63 characters, and must be less than 128 bytes in size. + * Up to 64 label entries may be stored. For labels which do not have a + * semantic value, the empty string may be supplied for the label value. + * + * Generated from protobuf field map user_labels = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * Labels which have been used to annotate the service-level objective. Label + * keys must start with a letter. Label keys and values may contain lowercase + * letters, numbers, underscores, and dashes. Label keys and values have a + * maximum length of 63 characters, and must be less than 128 bytes in size. + * Up to 64 label entries may be stored. For labels which do not have a + * semantic value, the empty string may be supplied for the label value. + * + * Generated from protobuf field map user_labels = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + + /** + * @return string + */ + public function getPeriod() + { + return $this->whichOneof("period"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php new file mode 100644 index 00000000000..a21fbcb2596 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php @@ -0,0 +1,71 @@ +google.monitoring.v3.ServiceLevelObjective.View + */ +class View +{ + /** + * Same as FULL. + * + * Generated from protobuf enum VIEW_UNSPECIFIED = 0; + */ + const VIEW_UNSPECIFIED = 0; + /** + * Return the embedded `ServiceLevelIndicator` in the form in which it was + * defined. If it was defined using a `BasicSli`, return that `BasicSli`. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + /** + * For `ServiceLevelIndicator`s using `BasicSli` articulation, instead + * return the `ServiceLevelIndicator` with its mode of computation fully + * spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using + * `RequestBasedSli` or `WindowsBasedSli`, return the + * `ServiceLevelIndicator` as it was provided. + * + * Generated from protobuf enum EXPLICIT = 1; + */ + const EXPLICIT = 1; + + private static $valueToName = [ + self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED', + self::FULL => 'FULL', + self::EXPLICIT => 'EXPLICIT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(View::class, \Google\Cloud\Monitoring\V3\ServiceLevelObjective_View::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective_View.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective_View.php new file mode 100644 index 00000000000..dd79000ff9e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective_View.php @@ -0,0 +1,16 @@ +_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/CreateService', + $argument, + ['\Google\Cloud\Monitoring\V3\Service', 'decode'], + $metadata, $options); + } + + /** + * Get the named `Service`. + * @param \Google\Cloud\Monitoring\V3\GetServiceRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetService(\Google\Cloud\Monitoring\V3\GetServiceRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/GetService', + $argument, + ['\Google\Cloud\Monitoring\V3\Service', 'decode'], + $metadata, $options); + } + + /** + * List `Service`s for this workspace. + * @param \Google\Cloud\Monitoring\V3\ListServicesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListServices(\Google\Cloud\Monitoring\V3\ListServicesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/ListServices', + $argument, + ['\Google\Cloud\Monitoring\V3\ListServicesResponse', 'decode'], + $metadata, $options); + } + + /** + * Update this `Service`. + * @param \Google\Cloud\Monitoring\V3\UpdateServiceRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateService(\Google\Cloud\Monitoring\V3\UpdateServiceRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/UpdateService', + $argument, + ['\Google\Cloud\Monitoring\V3\Service', 'decode'], + $metadata, $options); + } + + /** + * Soft delete this `Service`. + * @param \Google\Cloud\Monitoring\V3\DeleteServiceRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteService(\Google\Cloud\Monitoring\V3\DeleteServiceRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/DeleteService', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * @param \Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateServiceLevelObjective(\Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective', + $argument, + ['\Google\Cloud\Monitoring\V3\ServiceLevelObjective', 'decode'], + $metadata, $options); + } + + /** + * Get a `ServiceLevelObjective` by name. + * @param \Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetServiceLevelObjective(\Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective', + $argument, + ['\Google\Cloud\Monitoring\V3\ServiceLevelObjective', 'decode'], + $metadata, $options); + } + + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * @param \Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListServiceLevelObjectives(\Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives', + $argument, + ['\Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesResponse', 'decode'], + $metadata, $options); + } + + /** + * Update the given `ServiceLevelObjective`. + * @param \Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateServiceLevelObjective(\Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective', + $argument, + ['\Google\Cloud\Monitoring\V3\ServiceLevelObjective', 'decode'], + $metadata, $options); + } + + /** + * Delete the given `ServiceLevelObjective`. + * @param \Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteServiceLevelObjective(\Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php new file mode 100644 index 00000000000..36bc80c2aed --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php @@ -0,0 +1,73 @@ +google.monitoring.v3.ServiceTier + */ +class ServiceTier +{ + /** + * An invalid sentinel value, used to indicate that a tier has not + * been provided explicitly. + * + * Generated from protobuf enum SERVICE_TIER_UNSPECIFIED = 0; + */ + const SERVICE_TIER_UNSPECIFIED = 0; + /** + * The Stackdriver Basic tier, a free tier of service that provides basic + * features, a moderate allotment of logs, and access to built-in metrics. + * A number of features are not available in this tier. For more details, + * see [the service tiers + * documentation](https://cloud.google.com/monitoring/workspaces/tiers). + * + * Generated from protobuf enum SERVICE_TIER_BASIC = 1; + */ + const SERVICE_TIER_BASIC = 1; + /** + * The Stackdriver Premium tier, a higher, more expensive tier of service + * that provides access to all Stackdriver features, lets you use Stackdriver + * with AWS accounts, and has a larger allotments for logs and metrics. For + * more details, see [the service tiers + * documentation](https://cloud.google.com/monitoring/workspaces/tiers). + * + * Generated from protobuf enum SERVICE_TIER_PREMIUM = 2; + */ + const SERVICE_TIER_PREMIUM = 2; + + private static $valueToName = [ + self::SERVICE_TIER_UNSPECIFIED => 'SERVICE_TIER_UNSPECIFIED', + self::SERVICE_TIER_BASIC => 'SERVICE_TIER_BASIC', + self::SERVICE_TIER_PREMIUM => 'SERVICE_TIER_PREMIUM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_AppEngine.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_AppEngine.php new file mode 100644 index 00000000000..1585ca5cde3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_AppEngine.php @@ -0,0 +1,16 @@ +google.monitoring.v3.SpanContext + */ +class SpanContext extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the span. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] + * `[TRACE_ID]` is a unique identifier for a trace within a project; + * it is a 32-character hexadecimal encoding of a 16-byte array. + * `[SPAN_ID]` is a unique identifier for a span within a trace; it + * is a 16-character hexadecimal encoding of an 8-byte array. + * + * Generated from protobuf field string span_name = 1; + */ + protected $span_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $span_name + * The resource name of the span. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] + * `[TRACE_ID]` is a unique identifier for a trace within a project; + * it is a 32-character hexadecimal encoding of a 16-byte array. + * `[SPAN_ID]` is a unique identifier for a span within a trace; it + * is a 16-character hexadecimal encoding of an 8-byte array. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SpanContext::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the span. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] + * `[TRACE_ID]` is a unique identifier for a trace within a project; + * it is a 32-character hexadecimal encoding of a 16-byte array. + * `[SPAN_ID]` is a unique identifier for a span within a trace; it + * is a 16-character hexadecimal encoding of an 8-byte array. + * + * Generated from protobuf field string span_name = 1; + * @return string + */ + public function getSpanName() + { + return $this->span_name; + } + + /** + * The resource name of the span. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] + * `[TRACE_ID]` is a unique identifier for a trace within a project; + * it is a 32-character hexadecimal encoding of a 16-byte array. + * `[SPAN_ID]` is a unique identifier for a span within a trace; it + * is a 16-character hexadecimal encoding of an 8-byte array. + * + * Generated from protobuf field string span_name = 1; + * @param string $var + * @return $this + */ + public function setSpanName($var) + { + GPBUtil::checkString($var, True); + $this->span_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php new file mode 100644 index 00000000000..6c6c82460c6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php @@ -0,0 +1,303 @@ +google.monitoring.v3.TextLocator + */ +class TextLocator extends \Google\Protobuf\Internal\Message +{ + /** + * The source of the text. The source may be a field in the request, in which + * case its format is the format of the + * google.rpc.BadRequest.FieldViolation.field field in + * https://cloud.google.com/apis/design/errors#error_details. It may also be + * be a source other than the request field (e.g. a macro definition + * referenced in the text of the query), in which case this is the name of + * the source (e.g. the macro name). + * + * Generated from protobuf field string source = 1; + */ + protected $source = ''; + /** + * The position of the first byte within the text. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator.Position start_position = 2; + */ + protected $start_position = null; + /** + * The position of the last byte within the text. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator.Position end_position = 3; + */ + protected $end_position = null; + /** + * If `source`, `start_position`, and `end_position` describe a call on + * some object (e.g. a macro in the time series query language text) and a + * location is to be designated in that object's text, `nested_locator` + * identifies the location within that object. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator nested_locator = 4; + */ + protected $nested_locator = null; + /** + * When `nested_locator` is set, this field gives the reason for the nesting. + * Usually, the reason is a macro invocation. In that case, the macro name + * (including the leading '@') signals the location of the macro call + * in the text and a macro argument name (including the leading '$') signals + * the location of the macro argument inside the macro body that got + * substituted away. + * + * Generated from protobuf field string nesting_reason = 5; + */ + protected $nesting_reason = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source + * The source of the text. The source may be a field in the request, in which + * case its format is the format of the + * google.rpc.BadRequest.FieldViolation.field field in + * https://cloud.google.com/apis/design/errors#error_details. It may also be + * be a source other than the request field (e.g. a macro definition + * referenced in the text of the query), in which case this is the name of + * the source (e.g. the macro name). + * @type \Google\Cloud\Monitoring\V3\TextLocator\Position $start_position + * The position of the first byte within the text. + * @type \Google\Cloud\Monitoring\V3\TextLocator\Position $end_position + * The position of the last byte within the text. + * @type \Google\Cloud\Monitoring\V3\TextLocator $nested_locator + * If `source`, `start_position`, and `end_position` describe a call on + * some object (e.g. a macro in the time series query language text) and a + * location is to be designated in that object's text, `nested_locator` + * identifies the location within that object. + * @type string $nesting_reason + * When `nested_locator` is set, this field gives the reason for the nesting. + * Usually, the reason is a macro invocation. In that case, the macro name + * (including the leading '@') signals the location of the macro call + * in the text and a macro argument name (including the leading '$') signals + * the location of the macro argument inside the macro body that got + * substituted away. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The source of the text. The source may be a field in the request, in which + * case its format is the format of the + * google.rpc.BadRequest.FieldViolation.field field in + * https://cloud.google.com/apis/design/errors#error_details. It may also be + * be a source other than the request field (e.g. a macro definition + * referenced in the text of the query), in which case this is the name of + * the source (e.g. the macro name). + * + * Generated from protobuf field string source = 1; + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * The source of the text. The source may be a field in the request, in which + * case its format is the format of the + * google.rpc.BadRequest.FieldViolation.field field in + * https://cloud.google.com/apis/design/errors#error_details. It may also be + * be a source other than the request field (e.g. a macro definition + * referenced in the text of the query), in which case this is the name of + * the source (e.g. the macro name). + * + * Generated from protobuf field string source = 1; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * The position of the first byte within the text. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator.Position start_position = 2; + * @return \Google\Cloud\Monitoring\V3\TextLocator\Position|null + */ + public function getStartPosition() + { + return $this->start_position; + } + + public function hasStartPosition() + { + return isset($this->start_position); + } + + public function clearStartPosition() + { + unset($this->start_position); + } + + /** + * The position of the first byte within the text. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator.Position start_position = 2; + * @param \Google\Cloud\Monitoring\V3\TextLocator\Position $var + * @return $this + */ + public function setStartPosition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator\Position::class); + $this->start_position = $var; + + return $this; + } + + /** + * The position of the last byte within the text. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator.Position end_position = 3; + * @return \Google\Cloud\Monitoring\V3\TextLocator\Position|null + */ + public function getEndPosition() + { + return $this->end_position; + } + + public function hasEndPosition() + { + return isset($this->end_position); + } + + public function clearEndPosition() + { + unset($this->end_position); + } + + /** + * The position of the last byte within the text. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator.Position end_position = 3; + * @param \Google\Cloud\Monitoring\V3\TextLocator\Position $var + * @return $this + */ + public function setEndPosition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator\Position::class); + $this->end_position = $var; + + return $this; + } + + /** + * If `source`, `start_position`, and `end_position` describe a call on + * some object (e.g. a macro in the time series query language text) and a + * location is to be designated in that object's text, `nested_locator` + * identifies the location within that object. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator nested_locator = 4; + * @return \Google\Cloud\Monitoring\V3\TextLocator|null + */ + public function getNestedLocator() + { + return $this->nested_locator; + } + + public function hasNestedLocator() + { + return isset($this->nested_locator); + } + + public function clearNestedLocator() + { + unset($this->nested_locator); + } + + /** + * If `source`, `start_position`, and `end_position` describe a call on + * some object (e.g. a macro in the time series query language text) and a + * location is to be designated in that object's text, `nested_locator` + * identifies the location within that object. + * + * Generated from protobuf field .google.monitoring.v3.TextLocator nested_locator = 4; + * @param \Google\Cloud\Monitoring\V3\TextLocator $var + * @return $this + */ + public function setNestedLocator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator::class); + $this->nested_locator = $var; + + return $this; + } + + /** + * When `nested_locator` is set, this field gives the reason for the nesting. + * Usually, the reason is a macro invocation. In that case, the macro name + * (including the leading '@') signals the location of the macro call + * in the text and a macro argument name (including the leading '$') signals + * the location of the macro argument inside the macro body that got + * substituted away. + * + * Generated from protobuf field string nesting_reason = 5; + * @return string + */ + public function getNestingReason() + { + return $this->nesting_reason; + } + + /** + * When `nested_locator` is set, this field gives the reason for the nesting. + * Usually, the reason is a macro invocation. In that case, the macro name + * (including the leading '@') signals the location of the macro call + * in the text and a macro argument name (including the leading '$') signals + * the location of the macro argument inside the macro body that got + * substituted away. + * + * Generated from protobuf field string nesting_reason = 5; + * @param string $var + * @return $this + */ + public function setNestingReason($var) + { + GPBUtil::checkString($var, True); + $this->nesting_reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php new file mode 100644 index 00000000000..bd81e7bff71 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php @@ -0,0 +1,108 @@ +google.monitoring.v3.TextLocator.Position + */ +class Position extends \Google\Protobuf\Internal\Message +{ + /** + * The line, starting with 1, where the byte is positioned. + * + * Generated from protobuf field int32 line = 1; + */ + protected $line = 0; + /** + * The column within the line, starting with 1, where the byte is + * positioned. This is a byte index even though the text is UTF-8. + * + * Generated from protobuf field int32 column = 2; + */ + protected $column = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $line + * The line, starting with 1, where the byte is positioned. + * @type int $column + * The column within the line, starting with 1, where the byte is + * positioned. This is a byte index even though the text is UTF-8. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The line, starting with 1, where the byte is positioned. + * + * Generated from protobuf field int32 line = 1; + * @return int + */ + public function getLine() + { + return $this->line; + } + + /** + * The line, starting with 1, where the byte is positioned. + * + * Generated from protobuf field int32 line = 1; + * @param int $var + * @return $this + */ + public function setLine($var) + { + GPBUtil::checkInt32($var); + $this->line = $var; + + return $this; + } + + /** + * The column within the line, starting with 1, where the byte is + * positioned. This is a byte index even though the text is UTF-8. + * + * Generated from protobuf field int32 column = 2; + * @return int + */ + public function getColumn() + { + return $this->column; + } + + /** + * The column within the line, starting with 1, where the byte is + * positioned. This is a byte index even though the text is UTF-8. + * + * Generated from protobuf field int32 column = 2; + * @param int $var + * @return $this + */ + public function setColumn($var) + { + GPBUtil::checkInt32($var); + $this->column = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Position::class, \Google\Cloud\Monitoring\V3\TextLocator_Position::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator_Position.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator_Position.php new file mode 100644 index 00000000000..843dc4d7ecd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator_Position.php @@ -0,0 +1,16 @@ +google.monitoring.v3.TimeInterval + */ +class TimeInterval extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The end of the time interval. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $end_time + * Required. The end of the time interval. + * @type \Google\Protobuf\Timestamp $start_time + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Common::initOnce(); + parent::__construct($data); + } + + /** + * Required. The end of the time interval. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Required. The end of the time interval. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Optional. The beginning of the time interval. The default value + * for the start time is the end time. The start time must not be + * later than the end time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php new file mode 100644 index 00000000000..0c30200025a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php @@ -0,0 +1,404 @@ +google.monitoring.v3.TimeSeries + */ +class TimeSeries extends \Google\Protobuf\Internal\Message +{ + /** + * The associated metric. A fully-specified metric used to identify the time + * series. + * + * Generated from protobuf field .google.api.Metric metric = 1; + */ + protected $metric = null; + /** + * The associated monitored resource. Custom metrics can use only certain + * monitored resource types in their time series data. For more information, + * see [Monitored resources for custom + * metrics](https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). + * + * Generated from protobuf field .google.api.MonitoredResource resource = 2; + */ + protected $resource = null; + /** + * Output only. The associated monitored resource metadata. When reading a + * time series, this field will include metadata labels that are explicitly + * named in the reduction. When creating a time series, this field is ignored. + * + * Generated from protobuf field .google.api.MonitoredResourceMetadata metadata = 7; + */ + protected $metadata = null; + /** + * The metric kind of the time series. When listing time series, this metric + * kind might be different from the metric kind of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the metric kind of the associated metric. If the associated + * metric's descriptor must be auto-created, then this field specifies the + * metric kind of the new descriptor and must be either `GAUGE` (the default) + * or `CUMULATIVE`. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + */ + protected $metric_kind = 0; + /** + * The value type of the time series. When listing time series, this value + * type might be different from the value type of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the type of the data in the `points` field. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; + */ + protected $value_type = 0; + /** + * The data points of this time series. When listing time series, points are + * returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * + * Generated from protobuf field repeated .google.monitoring.v3.Point points = 5; + */ + private $points; + /** + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * + * Generated from protobuf field string unit = 8; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\Metric $metric + * The associated metric. A fully-specified metric used to identify the time + * series. + * @type \Google\Api\MonitoredResource $resource + * The associated monitored resource. Custom metrics can use only certain + * monitored resource types in their time series data. For more information, + * see [Monitored resources for custom + * metrics](https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). + * @type \Google\Api\MonitoredResourceMetadata $metadata + * Output only. The associated monitored resource metadata. When reading a + * time series, this field will include metadata labels that are explicitly + * named in the reduction. When creating a time series, this field is ignored. + * @type int $metric_kind + * The metric kind of the time series. When listing time series, this metric + * kind might be different from the metric kind of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the metric kind of the associated metric. If the associated + * metric's descriptor must be auto-created, then this field specifies the + * metric kind of the new descriptor and must be either `GAUGE` (the default) + * or `CUMULATIVE`. + * @type int $value_type + * The value type of the time series. When listing time series, this value + * type might be different from the value type of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the type of the data in the `points` field. + * @type \Google\Cloud\Monitoring\V3\Point[]|\Google\Protobuf\Internal\RepeatedField $points + * The data points of this time series. When listing time series, points are + * returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * @type string $unit + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The associated metric. A fully-specified metric used to identify the time + * series. + * + * Generated from protobuf field .google.api.Metric metric = 1; + * @return \Google\Api\Metric|null + */ + public function getMetric() + { + return $this->metric; + } + + public function hasMetric() + { + return isset($this->metric); + } + + public function clearMetric() + { + unset($this->metric); + } + + /** + * The associated metric. A fully-specified metric used to identify the time + * series. + * + * Generated from protobuf field .google.api.Metric metric = 1; + * @param \Google\Api\Metric $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkMessage($var, \Google\Api\Metric::class); + $this->metric = $var; + + return $this; + } + + /** + * The associated monitored resource. Custom metrics can use only certain + * monitored resource types in their time series data. For more information, + * see [Monitored resources for custom + * metrics](https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). + * + * Generated from protobuf field .google.api.MonitoredResource resource = 2; + * @return \Google\Api\MonitoredResource|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * The associated monitored resource. Custom metrics can use only certain + * monitored resource types in their time series data. For more information, + * see [Monitored resources for custom + * metrics](https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). + * + * Generated from protobuf field .google.api.MonitoredResource resource = 2; + * @param \Google\Api\MonitoredResource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); + $this->resource = $var; + + return $this; + } + + /** + * Output only. The associated monitored resource metadata. When reading a + * time series, this field will include metadata labels that are explicitly + * named in the reduction. When creating a time series, this field is ignored. + * + * Generated from protobuf field .google.api.MonitoredResourceMetadata metadata = 7; + * @return \Google\Api\MonitoredResourceMetadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Output only. The associated monitored resource metadata. When reading a + * time series, this field will include metadata labels that are explicitly + * named in the reduction. When creating a time series, this field is ignored. + * + * Generated from protobuf field .google.api.MonitoredResourceMetadata metadata = 7; + * @param \Google\Api\MonitoredResourceMetadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Api\MonitoredResourceMetadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * The metric kind of the time series. When listing time series, this metric + * kind might be different from the metric kind of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the metric kind of the associated metric. If the associated + * metric's descriptor must be auto-created, then this field specifies the + * metric kind of the new descriptor and must be either `GAUGE` (the default) + * or `CUMULATIVE`. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + * @return int + */ + public function getMetricKind() + { + return $this->metric_kind; + } + + /** + * The metric kind of the time series. When listing time series, this metric + * kind might be different from the metric kind of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the metric kind of the associated metric. If the associated + * metric's descriptor must be auto-created, then this field specifies the + * metric kind of the new descriptor and must be either `GAUGE` (the default) + * or `CUMULATIVE`. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + * @param int $var + * @return $this + */ + public function setMetricKind($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\MetricKind::class); + $this->metric_kind = $var; + + return $this; + } + + /** + * The value type of the time series. When listing time series, this value + * type might be different from the value type of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the type of the data in the `points` field. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * The value type of the time series. When listing time series, this value + * type might be different from the value type of the associated metric if + * this time series is an alignment or reduction of other time series. + * When creating a time series, this field is optional. If present, it must be + * the same as the type of the data in the `points` field. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * The data points of this time series. When listing time series, points are + * returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * + * Generated from protobuf field repeated .google.monitoring.v3.Point points = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPoints() + { + return $this->points; + } + + /** + * The data points of this time series. When listing time series, points are + * returned in reverse time order. + * When creating a time series, this field must contain exactly one point and + * the point's type must be the same as the value type of the associated + * metric. If the associated metric's descriptor must be auto-created, then + * the value type of the descriptor is determined by the point's type, which + * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. + * + * Generated from protobuf field repeated .google.monitoring.v3.Point points = 5; + * @param \Google\Cloud\Monitoring\V3\Point[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Point::class); + $this->points = $arr; + + return $this; + } + + /** + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * + * Generated from protobuf field string unit = 8; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The units in which the metric value is reported. It is only applicable + * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` + * defines the representation of the stored metric values. + * + * Generated from protobuf field string unit = 8; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php new file mode 100644 index 00000000000..a7c17adaf21 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php @@ -0,0 +1,114 @@ +google.monitoring.v3.TimeSeriesData + */ +class TimeSeriesData extends \Google\Protobuf\Internal\Message +{ + /** + * The values of the labels in the time series identifier, given in the same + * order as the `label_descriptors` field of the TimeSeriesDescriptor + * associated with this object. Each value must have a value of the type + * given in the corresponding entry of `label_descriptors`. + * + * Generated from protobuf field repeated .google.monitoring.v3.LabelValue label_values = 1; + */ + private $label_values; + /** + * The points in the time series. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData.PointData point_data = 2; + */ + private $point_data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\LabelValue[]|\Google\Protobuf\Internal\RepeatedField $label_values + * The values of the labels in the time series identifier, given in the same + * order as the `label_descriptors` field of the TimeSeriesDescriptor + * associated with this object. Each value must have a value of the type + * given in the corresponding entry of `label_descriptors`. + * @type \Google\Cloud\Monitoring\V3\TimeSeriesData\PointData[]|\Google\Protobuf\Internal\RepeatedField $point_data + * The points in the time series. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The values of the labels in the time series identifier, given in the same + * order as the `label_descriptors` field of the TimeSeriesDescriptor + * associated with this object. Each value must have a value of the type + * given in the corresponding entry of `label_descriptors`. + * + * Generated from protobuf field repeated .google.monitoring.v3.LabelValue label_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabelValues() + { + return $this->label_values; + } + + /** + * The values of the labels in the time series identifier, given in the same + * order as the `label_descriptors` field of the TimeSeriesDescriptor + * associated with this object. Each value must have a value of the type + * given in the corresponding entry of `label_descriptors`. + * + * Generated from protobuf field repeated .google.monitoring.v3.LabelValue label_values = 1; + * @param \Google\Cloud\Monitoring\V3\LabelValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabelValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\LabelValue::class); + $this->label_values = $arr; + + return $this; + } + + /** + * The points in the time series. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData.PointData point_data = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPointData() + { + return $this->point_data; + } + + /** + * The points in the time series. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData.PointData point_data = 2; + * @param \Google\Cloud\Monitoring\V3\TimeSeriesData\PointData[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPointData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeriesData\PointData::class); + $this->point_data = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php new file mode 100644 index 00000000000..8556054007e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php @@ -0,0 +1,116 @@ +google.monitoring.v3.TimeSeriesData.PointData + */ +class PointData extends \Google\Protobuf\Internal\Message +{ + /** + * The values that make up the point. + * + * Generated from protobuf field repeated .google.monitoring.v3.TypedValue values = 1; + */ + private $values; + /** + * The time interval associated with the point. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval time_interval = 2; + */ + protected $time_interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\TypedValue[]|\Google\Protobuf\Internal\RepeatedField $values + * The values that make up the point. + * @type \Google\Cloud\Monitoring\V3\TimeInterval $time_interval + * The time interval associated with the point. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The values that make up the point. + * + * Generated from protobuf field repeated .google.monitoring.v3.TypedValue values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The values that make up the point. + * + * Generated from protobuf field repeated .google.monitoring.v3.TypedValue values = 1; + * @param \Google\Cloud\Monitoring\V3\TypedValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TypedValue::class); + $this->values = $arr; + + return $this; + } + + /** + * The time interval associated with the point. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval time_interval = 2; + * @return \Google\Cloud\Monitoring\V3\TimeInterval|null + */ + public function getTimeInterval() + { + return $this->time_interval; + } + + public function hasTimeInterval() + { + return isset($this->time_interval); + } + + public function clearTimeInterval() + { + unset($this->time_interval); + } + + /** + * The time interval associated with the point. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval time_interval = 2; + * @param \Google\Cloud\Monitoring\V3\TimeInterval $var + * @return $this + */ + public function setTimeInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeInterval::class); + $this->time_interval = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PointData::class, \Google\Cloud\Monitoring\V3\TimeSeriesData_PointData::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData_PointData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData_PointData.php new file mode 100644 index 00000000000..99a46d794e2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData_PointData.php @@ -0,0 +1,16 @@ +google.monitoring.v3.TimeSeriesDescriptor + */ +class TimeSeriesDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * Descriptors for the labels. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor label_descriptors = 1; + */ + private $label_descriptors; + /** + * Descriptors for the point data value columns. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptor point_descriptors = 5; + */ + private $point_descriptors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $label_descriptors + * Descriptors for the labels. + * @type \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor\ValueDescriptor[]|\Google\Protobuf\Internal\RepeatedField $point_descriptors + * Descriptors for the point data value columns. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * Descriptors for the labels. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor label_descriptors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabelDescriptors() + { + return $this->label_descriptors; + } + + /** + * Descriptors for the labels. + * + * Generated from protobuf field repeated .google.api.LabelDescriptor label_descriptors = 1; + * @param \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabelDescriptors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class); + $this->label_descriptors = $arr; + + return $this; + } + + /** + * Descriptors for the point data value columns. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptor point_descriptors = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPointDescriptors() + { + return $this->point_descriptors; + } + + /** + * Descriptors for the point data value columns. + * + * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptor point_descriptors = 5; + * @param \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor\ValueDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPointDescriptors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor\ValueDescriptor::class); + $this->point_descriptors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php new file mode 100644 index 00000000000..ac5dbc3a79e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php @@ -0,0 +1,184 @@ +google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptor + */ +class ValueDescriptor extends \Google\Protobuf\Internal\Message +{ + /** + * The value key. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The value type. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 2; + */ + protected $value_type = 0; + /** + * The value stream kind. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + */ + protected $metric_kind = 0; + /** + * The unit in which `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION. + * + * Generated from protobuf field string unit = 4; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The value key. + * @type int $value_type + * The value type. + * @type int $metric_kind + * The value stream kind. + * @type string $unit + * The unit in which `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); + parent::__construct($data); + } + + /** + * The value key. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The value key. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The value type. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 2; + * @return int + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * The value type. + * + * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 2; + * @param int $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\ValueType::class); + $this->value_type = $var; + + return $this; + } + + /** + * The value stream kind. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + * @return int + */ + public function getMetricKind() + { + return $this->metric_kind; + } + + /** + * The value stream kind. + * + * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; + * @param int $var + * @return $this + */ + public function setMetricKind($var) + { + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\MetricKind::class); + $this->metric_kind = $var; + + return $this; + } + + /** + * The unit in which `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION. + * + * Generated from protobuf field string unit = 4; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * The unit in which `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * `unit` is only valid if `value_type` is INTEGER, DOUBLE, DISTRIBUTION. + * + * Generated from protobuf field string unit = 4; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ValueDescriptor::class, \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor_ValueDescriptor::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor_ValueDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor_ValueDescriptor.php new file mode 100644 index 00000000000..7b60dd89f54 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor_ValueDescriptor.php @@ -0,0 +1,16 @@ +google.monitoring.v3.TimeSeriesRatio + */ +class TimeSeriesRatio extends \Google\Protobuf\Internal\Message +{ + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying good service provided. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string good_service_filter = 4; + */ + protected $good_service_filter = ''; + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying bad service, either demanded service + * that was not provided or demanded service that was of inadequate quality. + * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string bad_service_filter = 5; + */ + protected $bad_service_filter = ''; + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying total demanded service. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string total_service_filter = 6; + */ + protected $total_service_filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $good_service_filter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying good service provided. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * @type string $bad_service_filter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying bad service, either demanded service + * that was not provided or demanded service that was of inadequate quality. + * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * @type string $total_service_filter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying total demanded service. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying good service provided. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string good_service_filter = 4; + * @return string + */ + public function getGoodServiceFilter() + { + return $this->good_service_filter; + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying good service provided. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string good_service_filter = 4; + * @param string $var + * @return $this + */ + public function setGoodServiceFilter($var) + { + GPBUtil::checkString($var, True); + $this->good_service_filter = $var; + + return $this; + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying bad service, either demanded service + * that was not provided or demanded service that was of inadequate quality. + * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string bad_service_filter = 5; + * @return string + */ + public function getBadServiceFilter() + { + return $this->bad_service_filter; + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying bad service, either demanded service + * that was not provided or demanded service that was of inadequate quality. + * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have + * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string bad_service_filter = 5; + * @param string $var + * @return $this + */ + public function setBadServiceFilter($var) + { + GPBUtil::checkString($var, True); + $this->bad_service_filter = $var; + + return $this; + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying total demanded service. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string total_service_filter = 6; + * @return string + */ + public function getTotalServiceFilter() + { + return $this->total_service_filter; + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` quantifying total demanded service. Must have + * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = + * DELTA` or `MetricKind = CUMULATIVE`. + * + * Generated from protobuf field string total_service_filter = 6; + * @param string $var + * @return $this + */ + public function setTotalServiceFilter($var) + { + GPBUtil::checkString($var, True); + $this->total_service_filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php new file mode 100644 index 00000000000..866bd8da016 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php @@ -0,0 +1,213 @@ +google.monitoring.v3.TypedValue + */ +class TypedValue extends \Google\Protobuf\Internal\Message +{ + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $bool_value + * A Boolean value: `true` or `false`. + * @type int|string $int64_value + * A 64-bit integer. Its range is approximately ±9.2x1018. + * @type float $double_value + * A 64-bit double-precision floating-point number. Its magnitude + * is approximately ±10±300 and it has 16 + * significant digits of precision. + * @type string $string_value + * A variable-length string value. + * @type \Google\Api\Distribution $distribution_value + * A distribution value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Common::initOnce(); + parent::__construct($data); + } + + /** + * A Boolean value: `true` or `false`. + * + * Generated from protobuf field bool bool_value = 1; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(1); + } + + public function hasBoolValue() + { + return $this->hasOneof(1); + } + + /** + * A Boolean value: `true` or `false`. + * + * Generated from protobuf field bool bool_value = 1; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A 64-bit integer. Its range is approximately ±9.2x1018. + * + * Generated from protobuf field int64 int64_value = 2; + * @return int|string + */ + public function getInt64Value() + { + return $this->readOneof(2); + } + + public function hasInt64Value() + { + return $this->hasOneof(2); + } + + /** + * A 64-bit integer. Its range is approximately ±9.2x1018. + * + * Generated from protobuf field int64 int64_value = 2; + * @param int|string $var + * @return $this + */ + public function setInt64Value($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A 64-bit double-precision floating-point number. Its magnitude + * is approximately ±10±300 and it has 16 + * significant digits of precision. + * + * Generated from protobuf field double double_value = 3; + * @return float + */ + public function getDoubleValue() + { + return $this->readOneof(3); + } + + public function hasDoubleValue() + { + return $this->hasOneof(3); + } + + /** + * A 64-bit double-precision floating-point number. Its magnitude + * is approximately ±10±300 and it has 16 + * significant digits of precision. + * + * Generated from protobuf field double double_value = 3; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A variable-length string value. + * + * Generated from protobuf field string string_value = 4; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(4); + } + + public function hasStringValue() + { + return $this->hasOneof(4); + } + + /** + * A variable-length string value. + * + * Generated from protobuf field string string_value = 4; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A distribution value. + * + * Generated from protobuf field .google.api.Distribution distribution_value = 5; + * @return \Google\Api\Distribution|null + */ + public function getDistributionValue() + { + return $this->readOneof(5); + } + + public function hasDistributionValue() + { + return $this->hasOneof(5); + } + + /** + * A distribution value. + * + * Generated from protobuf field .google.api.Distribution distribution_value = 5; + * @param \Google\Api\Distribution $var + * @return $this + */ + public function setDistributionValue($var) + { + GPBUtil::checkMessage($var, \Google\Api\Distribution::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php new file mode 100644 index 00000000000..397f15c3712 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php @@ -0,0 +1,201 @@ +google.monitoring.v3.UpdateAlertPolicyRequest + */ +class UpdateAlertPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of alerting policy field names. If this field is not + * empty, each listed field in the existing alerting policy is set to the + * value of the corresponding field in the supplied policy (`alert_policy`), + * or to the field's default value if the field is not in the supplied + * alerting policy. Fields not listed retain their previous value. + * Examples of valid field masks include `display_name`, `documentation`, + * `documentation.content`, `documentation.mime_type`, `user_labels`, + * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. + * If this field is empty, then the supplied alerting policy replaces the + * existing policy. It is the same as deleting the existing policy and + * adding the supplied policy, except for the following: + * + The new policy will have the same `[ALERT_POLICY_ID]` as the former + * policy. This gives you continuity with the former policy in your + * notifications and incidents. + * + Conditions in the new policy will keep their former `[CONDITION_ID]` if + * the supplied condition includes the `name` field with that + * `[CONDITION_ID]`. If the supplied condition omits the `name` field, + * then a new `[CONDITION_ID]` is created. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * Required. The updated alerting policy or the updated values for the + * fields listed in `update_mask`. + * If `update_mask` is not empty, any fields in this policy that are + * not in `update_mask` are ignored. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $alert_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. A list of alerting policy field names. If this field is not + * empty, each listed field in the existing alerting policy is set to the + * value of the corresponding field in the supplied policy (`alert_policy`), + * or to the field's default value if the field is not in the supplied + * alerting policy. Fields not listed retain their previous value. + * Examples of valid field masks include `display_name`, `documentation`, + * `documentation.content`, `documentation.mime_type`, `user_labels`, + * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. + * If this field is empty, then the supplied alerting policy replaces the + * existing policy. It is the same as deleting the existing policy and + * adding the supplied policy, except for the following: + * + The new policy will have the same `[ALERT_POLICY_ID]` as the former + * policy. This gives you continuity with the former policy in your + * notifications and incidents. + * + Conditions in the new policy will keep their former `[CONDITION_ID]` if + * the supplied condition includes the `name` field with that + * `[CONDITION_ID]`. If the supplied condition omits the `name` field, + * then a new `[CONDITION_ID]` is created. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy $alert_policy + * Required. The updated alerting policy or the updated values for the + * fields listed in `update_mask`. + * If `update_mask` is not empty, any fields in this policy that are + * not in `update_mask` are ignored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of alerting policy field names. If this field is not + * empty, each listed field in the existing alerting policy is set to the + * value of the corresponding field in the supplied policy (`alert_policy`), + * or to the field's default value if the field is not in the supplied + * alerting policy. Fields not listed retain their previous value. + * Examples of valid field masks include `display_name`, `documentation`, + * `documentation.content`, `documentation.mime_type`, `user_labels`, + * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. + * If this field is empty, then the supplied alerting policy replaces the + * existing policy. It is the same as deleting the existing policy and + * adding the supplied policy, except for the following: + * + The new policy will have the same `[ALERT_POLICY_ID]` as the former + * policy. This gives you continuity with the former policy in your + * notifications and incidents. + * + Conditions in the new policy will keep their former `[CONDITION_ID]` if + * the supplied condition includes the `name` field with that + * `[CONDITION_ID]`. If the supplied condition omits the `name` field, + * then a new `[CONDITION_ID]` is created. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. A list of alerting policy field names. If this field is not + * empty, each listed field in the existing alerting policy is set to the + * value of the corresponding field in the supplied policy (`alert_policy`), + * or to the field's default value if the field is not in the supplied + * alerting policy. Fields not listed retain their previous value. + * Examples of valid field masks include `display_name`, `documentation`, + * `documentation.content`, `documentation.mime_type`, `user_labels`, + * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. + * If this field is empty, then the supplied alerting policy replaces the + * existing policy. It is the same as deleting the existing policy and + * adding the supplied policy, except for the following: + * + The new policy will have the same `[ALERT_POLICY_ID]` as the former + * policy. This gives you continuity with the former policy in your + * notifications and incidents. + * + Conditions in the new policy will keep their former `[CONDITION_ID]` if + * the supplied condition includes the `name` field with that + * `[CONDITION_ID]`. If the supplied condition omits the `name` field, + * then a new `[CONDITION_ID]` is created. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The updated alerting policy or the updated values for the + * fields listed in `update_mask`. + * If `update_mask` is not empty, any fields in this policy that are + * not in `update_mask` are ignored. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy|null + */ + public function getAlertPolicy() + { + return $this->alert_policy; + } + + public function hasAlertPolicy() + { + return isset($this->alert_policy); + } + + public function clearAlertPolicy() + { + unset($this->alert_policy); + } + + /** + * Required. The updated alerting policy or the updated values for the + * fields listed in `update_mask`. + * If `update_mask` is not empty, any fields in this policy that are + * not in `update_mask` are ignored. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy $var + * @return $this + */ + public function setAlertPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy::class); + $this->alert_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php new file mode 100644 index 00000000000..93d63e1a058 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php @@ -0,0 +1,115 @@ +google.monitoring.v3.UpdateGroupRequest + */ +class UpdateGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * + * Generated from protobuf field .google.monitoring.v3.Group group = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $group = null; + /** + * If true, validate this request but do not update the existing group. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\Group $group + * Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * @type bool $validate_only + * If true, validate this request but do not update the existing group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * + * Generated from protobuf field .google.monitoring.v3.Group group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Group|null + */ + public function getGroup() + { + return $this->group; + } + + public function hasGroup() + { + return isset($this->group); + } + + public function clearGroup() + { + unset($this->group); + } + + /** + * Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * + * Generated from protobuf field .google.monitoring.v3.Group group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Group $var + * @return $this + */ + public function setGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Group::class); + $this->group = $var; + + return $this; + } + + /** + * If true, validate this request but do not update the existing group. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * If true, validate this request but do not update the existing group. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php new file mode 100644 index 00000000000..b5f96b344e4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php @@ -0,0 +1,133 @@ +google.monitoring.v3.UpdateNotificationChannelRequest + */ +class UpdateNotificationChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * Required. A description of the changes to be applied to the specified + * notification channel. The description must provide a definition for + * fields to be updated; the names of these fields should also be + * included in the `update_mask`. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel notification_channel = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notification_channel = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * The fields to update. + * @type \Google\Cloud\Monitoring\V3\NotificationChannel $notification_channel + * Required. A description of the changes to be applied to the specified + * notification channel. The description must provide a definition for + * fields to be updated; the names of these fields should also be + * included in the `update_mask`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * The fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. A description of the changes to be applied to the specified + * notification channel. The description must provide a definition for + * fields to be updated; the names of these fields should also be + * included in the `update_mask`. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel notification_channel = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\NotificationChannel|null + */ + public function getNotificationChannel() + { + return $this->notification_channel; + } + + public function hasNotificationChannel() + { + return isset($this->notification_channel); + } + + public function clearNotificationChannel() + { + unset($this->notification_channel); + } + + /** + * Required. A description of the changes to be applied to the specified + * notification channel. The description must provide a definition for + * fields to be updated; the names of these fields should also be + * included in the `update_mask`. + * + * Generated from protobuf field .google.monitoring.v3.NotificationChannel notification_channel = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\NotificationChannel $var + * @return $this + */ + public function setNotificationChannel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\NotificationChannel::class); + $this->notification_channel = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php new file mode 100644 index 00000000000..94cceea14b7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php @@ -0,0 +1,125 @@ +google.monitoring.v3.UpdateServiceLevelObjectiveRequest + */ +class UpdateServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_level_objective = null; + /** + * A set of field paths defining which fields to use for the update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\ServiceLevelObjective $service_level_objective + * Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * @type \Google\Protobuf\FieldMask $update_mask + * A set of field paths defining which fields to use for the update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective|null + */ + public function getServiceLevelObjective() + { + return $this->service_level_objective; + } + + public function hasServiceLevelObjective() + { + return isset($this->service_level_objective); + } + + public function clearServiceLevelObjective() + { + unset($this->service_level_objective); + } + + /** + * Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * + * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $var + * @return $this + */ + public function setServiceLevelObjective($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective::class); + $this->service_level_objective = $var; + + return $this; + } + + /** + * A set of field paths defining which fields to use for the update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * A set of field paths defining which fields to use for the update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php new file mode 100644 index 00000000000..f00dd6e38e1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php @@ -0,0 +1,125 @@ +google.monitoring.v3.UpdateServiceRequest + */ +class UpdateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * + * Generated from protobuf field .google.monitoring.v3.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + /** + * A set of field paths defining which fields to use for the update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\Service $service + * Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * @type \Google\Protobuf\FieldMask $update_mask + * A set of field paths defining which fields to use for the update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * + * Generated from protobuf field .google.monitoring.v3.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * + * Generated from protobuf field .google.monitoring.v3.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service::class); + $this->service = $var; + + return $this; + } + + /** + * A set of field paths defining which fields to use for the update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * A set of field paths defining which fields to use for the update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php new file mode 100644 index 00000000000..7df7c33fa94 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php @@ -0,0 +1,169 @@ +google.monitoring.v3.UpdateUptimeCheckConfigRequest + */ +class UpdateUptimeCheckConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If present, only the listed fields in the current Uptime check + * configuration are updated with values from the new configuration. If this + * field is empty, then the current configuration is completely replaced with + * the new configuration. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * Required. If an `updateMask` has been specified, this field gives + * the values for the set of fields mentioned in the `updateMask`. If an + * `updateMask` has not been given, this Uptime check configuration replaces + * the current configuration. If a field is mentioned in `updateMask` but + * the corresonding field is omitted in this partial Uptime check + * configuration, it has the effect of deleting/clearing the field from the + * configuration on the server. + * The following fields can be updated: `display_name`, + * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and + * `selected_regions`. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uptime_check_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. If present, only the listed fields in the current Uptime check + * configuration are updated with values from the new configuration. If this + * field is empty, then the current configuration is completely replaced with + * the new configuration. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptime_check_config + * Required. If an `updateMask` has been specified, this field gives + * the values for the set of fields mentioned in the `updateMask`. If an + * `updateMask` has not been given, this Uptime check configuration replaces + * the current configuration. If a field is mentioned in `updateMask` but + * the corresonding field is omitted in this partial Uptime check + * configuration, it has the effect of deleting/clearing the field from the + * configuration on the server. + * The following fields can be updated: `display_name`, + * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and + * `selected_regions`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If present, only the listed fields in the current Uptime check + * configuration are updated with values from the new configuration. If this + * field is empty, then the current configuration is completely replaced with + * the new configuration. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. If present, only the listed fields in the current Uptime check + * configuration are updated with values from the new configuration. If this + * field is empty, then the current configuration is completely replaced with + * the new configuration. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. If an `updateMask` has been specified, this field gives + * the values for the set of fields mentioned in the `updateMask`. If an + * `updateMask` has not been given, this Uptime check configuration replaces + * the current configuration. If a field is mentioned in `updateMask` but + * the corresonding field is omitted in this partial Uptime check + * configuration, it has the effect of deleting/clearing the field from the + * configuration on the server. + * The following fields can be updated: `display_name`, + * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and + * `selected_regions`. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig|null + */ + public function getUptimeCheckConfig() + { + return $this->uptime_check_config; + } + + public function hasUptimeCheckConfig() + { + return isset($this->uptime_check_config); + } + + public function clearUptimeCheckConfig() + { + unset($this->uptime_check_config); + } + + /** + * Required. If an `updateMask` has been specified, this field gives + * the values for the set of fields mentioned in the `updateMask`. If an + * `updateMask` has not been given, this Uptime check configuration replaces + * the current configuration. If a field is mentioned in `updateMask` but + * the corresonding field is omitted in this partial Uptime check + * configuration, it has the effect of deleting/clearing the field from the + * configuration on the server. + * The following fields can be updated: `display_name`, + * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and + * `selected_regions`. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig $var + * @return $this + */ + public function setUptimeCheckConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig::class); + $this->uptime_check_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php new file mode 100644 index 00000000000..d38c7fd929e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php @@ -0,0 +1,617 @@ +google.monitoring.v3.UptimeCheckConfig + */ +class UptimeCheckConfig extends \Google\Protobuf\Internal\Message +{ + /** + * A unique resource name for this Uptime check configuration. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the + * Uptime check. + * This field should be omitted when creating the Uptime check configuration; + * on create, the resource name is assigned by the server and included in the + * response. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * A human-friendly name for the Uptime check configuration. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. Required. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * How often, in seconds, the Uptime check is performed. + * Currently, the only supported values are `60s` (1 minute), `300s` + * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, + * defaults to `60s`. + * + * Generated from protobuf field .google.protobuf.Duration period = 7; + */ + protected $period = null; + /** + * The maximum amount of time to wait for the request to complete (must be + * between 1 and 60 seconds). Required. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + */ + protected $timeout = null; + /** + * The content that is expected to appear in the data returned by the target + * server against which the check is run. Currently, only the first entry + * in the `content_matchers` list is supported, and additional entries will + * be ignored. This field is optional and should only be specified if a + * content match is required as part of the/ Uptime check. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.ContentMatcher content_matchers = 9; + */ + private $content_matchers; + /** + * The list of regions from which the check will be run. + * Some regions contain one location, and others contain more than one. + * If this field is specified, enough regions must be provided to include a + * minimum of 3 locations. Not specifying this field will result in Uptime + * checks running from all available regions. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckRegion selected_regions = 10; + */ + private $selected_regions; + /** + * If this is `true`, then checks are made only from the 'internal_checkers'. + * If it is `false`, then checks are made only from the 'selected_regions'. + * It is an error to provide 'selected_regions' when is_internal is `true`, + * or to provide 'internal_checkers' when is_internal is `false`. + * + * Generated from protobuf field bool is_internal = 15 [deprecated = true]; + * @deprecated + */ + protected $is_internal = false; + /** + * The internal checkers that this check will egress from. If `is_internal` is + * `true` and this list is empty, the check will egress from all the + * InternalCheckers configured for the project that owns this + * `UptimeCheckConfig`. + * + * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; + * @deprecated + */ + private $internal_checkers; + protected $resource; + protected $check_request_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * A unique resource name for this Uptime check configuration. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the + * Uptime check. + * This field should be omitted when creating the Uptime check configuration; + * on create, the resource name is assigned by the server and included in the + * response. + * @type string $display_name + * A human-friendly name for the Uptime check configuration. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. Required. + * @type \Google\Api\MonitoredResource $monitored_resource + * The [monitored + * resource](https://cloud.google.com/monitoring/api/resources) associated + * with the configuration. + * The following monitored resource types are valid for this field: + * `uptime_url`, + * `gce_instance`, + * `gae_app`, + * `aws_ec2_instance`, + * `aws_elb_load_balancer` + * `k8s_service` + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup $resource_group + * The group resource associated with the configuration. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck $http_check + * Contains information needed to make an HTTP or HTTPS check. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck $tcp_check + * Contains information needed to make a TCP check. + * @type \Google\Protobuf\Duration $period + * How often, in seconds, the Uptime check is performed. + * Currently, the only supported values are `60s` (1 minute), `300s` + * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, + * defaults to `60s`. + * @type \Google\Protobuf\Duration $timeout + * The maximum amount of time to wait for the request to complete (must be + * between 1 and 60 seconds). Required. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher[]|\Google\Protobuf\Internal\RepeatedField $content_matchers + * The content that is expected to appear in the data returned by the target + * server against which the check is run. Currently, only the first entry + * in the `content_matchers` list is supported, and additional entries will + * be ignored. This field is optional and should only be specified if a + * content match is required as part of the/ Uptime check. + * @type int[]|\Google\Protobuf\Internal\RepeatedField $selected_regions + * The list of regions from which the check will be run. + * Some regions contain one location, and others contain more than one. + * If this field is specified, enough regions must be provided to include a + * minimum of 3 locations. Not specifying this field will result in Uptime + * checks running from all available regions. + * @type bool $is_internal + * If this is `true`, then checks are made only from the 'internal_checkers'. + * If it is `false`, then checks are made only from the 'selected_regions'. + * It is an error to provide 'selected_regions' when is_internal is `true`, + * or to provide 'internal_checkers' when is_internal is `false`. + * @type \Google\Cloud\Monitoring\V3\InternalChecker[]|\Google\Protobuf\Internal\RepeatedField $internal_checkers + * The internal checkers that this check will egress from. If `is_internal` is + * `true` and this list is empty, the check will egress from all the + * InternalCheckers configured for the project that owns this + * `UptimeCheckConfig`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * A unique resource name for this Uptime check configuration. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the + * Uptime check. + * This field should be omitted when creating the Uptime check configuration; + * on create, the resource name is assigned by the server and included in the + * response. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * A unique resource name for this Uptime check configuration. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the + * Uptime check. + * This field should be omitted when creating the Uptime check configuration; + * on create, the resource name is assigned by the server and included in the + * response. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A human-friendly name for the Uptime check configuration. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. Required. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * A human-friendly name for the Uptime check configuration. The display name + * should be unique within a Stackdriver Workspace in order to make it easier + * to identify; however, uniqueness is not enforced. Required. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The [monitored + * resource](https://cloud.google.com/monitoring/api/resources) associated + * with the configuration. + * The following monitored resource types are valid for this field: + * `uptime_url`, + * `gce_instance`, + * `gae_app`, + * `aws_ec2_instance`, + * `aws_elb_load_balancer` + * `k8s_service` + * + * Generated from protobuf field .google.api.MonitoredResource monitored_resource = 3; + * @return \Google\Api\MonitoredResource|null + */ + public function getMonitoredResource() + { + return $this->readOneof(3); + } + + public function hasMonitoredResource() + { + return $this->hasOneof(3); + } + + /** + * The [monitored + * resource](https://cloud.google.com/monitoring/api/resources) associated + * with the configuration. + * The following monitored resource types are valid for this field: + * `uptime_url`, + * `gce_instance`, + * `gae_app`, + * `aws_ec2_instance`, + * `aws_elb_load_balancer` + * `k8s_service` + * + * Generated from protobuf field .google.api.MonitoredResource monitored_resource = 3; + * @param \Google\Api\MonitoredResource $var + * @return $this + */ + public function setMonitoredResource($var) + { + GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The group resource associated with the configuration. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ResourceGroup resource_group = 4; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup|null + */ + public function getResourceGroup() + { + return $this->readOneof(4); + } + + public function hasResourceGroup() + { + return $this->hasOneof(4); + } + + /** + * The group resource associated with the configuration. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ResourceGroup resource_group = 4; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup $var + * @return $this + */ + public function setResourceGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Contains information needed to make an HTTP or HTTPS check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck http_check = 5; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck|null + */ + public function getHttpCheck() + { + return $this->readOneof(5); + } + + public function hasHttpCheck() + { + return $this->hasOneof(5); + } + + /** + * Contains information needed to make an HTTP or HTTPS check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck http_check = 5; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck $var + * @return $this + */ + public function setHttpCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Contains information needed to make a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.TcpCheck tcp_check = 6; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck|null + */ + public function getTcpCheck() + { + return $this->readOneof(6); + } + + public function hasTcpCheck() + { + return $this->hasOneof(6); + } + + /** + * Contains information needed to make a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.TcpCheck tcp_check = 6; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck $var + * @return $this + */ + public function setTcpCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * How often, in seconds, the Uptime check is performed. + * Currently, the only supported values are `60s` (1 minute), `300s` + * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, + * defaults to `60s`. + * + * Generated from protobuf field .google.protobuf.Duration period = 7; + * @return \Google\Protobuf\Duration|null + */ + public function getPeriod() + { + return $this->period; + } + + public function hasPeriod() + { + return isset($this->period); + } + + public function clearPeriod() + { + unset($this->period); + } + + /** + * How often, in seconds, the Uptime check is performed. + * Currently, the only supported values are `60s` (1 minute), `300s` + * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, + * defaults to `60s`. + * + * Generated from protobuf field .google.protobuf.Duration period = 7; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->period = $var; + + return $this; + } + + /** + * The maximum amount of time to wait for the request to complete (must be + * between 1 and 60 seconds). Required. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * The maximum amount of time to wait for the request to complete (must be + * between 1 and 60 seconds). Required. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * The content that is expected to appear in the data returned by the target + * server against which the check is run. Currently, only the first entry + * in the `content_matchers` list is supported, and additional entries will + * be ignored. This field is optional and should only be specified if a + * content match is required as part of the/ Uptime check. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.ContentMatcher content_matchers = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContentMatchers() + { + return $this->content_matchers; + } + + /** + * The content that is expected to appear in the data returned by the target + * server against which the check is run. Currently, only the first entry + * in the `content_matchers` list is supported, and additional entries will + * be ignored. This field is optional and should only be specified if a + * content match is required as part of the/ Uptime check. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.ContentMatcher content_matchers = 9; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContentMatchers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher::class); + $this->content_matchers = $arr; + + return $this; + } + + /** + * The list of regions from which the check will be run. + * Some regions contain one location, and others contain more than one. + * If this field is specified, enough regions must be provided to include a + * minimum of 3 locations. Not specifying this field will result in Uptime + * checks running from all available regions. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckRegion selected_regions = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSelectedRegions() + { + return $this->selected_regions; + } + + /** + * The list of regions from which the check will be run. + * Some regions contain one location, and others contain more than one. + * If this field is specified, enough regions must be provided to include a + * minimum of 3 locations. Not specifying this field will result in Uptime + * checks running from all available regions. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckRegion selected_regions = 10; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSelectedRegions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Monitoring\V3\UptimeCheckRegion::class); + $this->selected_regions = $arr; + + return $this; + } + + /** + * If this is `true`, then checks are made only from the 'internal_checkers'. + * If it is `false`, then checks are made only from the 'selected_regions'. + * It is an error to provide 'selected_regions' when is_internal is `true`, + * or to provide 'internal_checkers' when is_internal is `false`. + * + * Generated from protobuf field bool is_internal = 15 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getIsInternal() + { + @trigger_error('is_internal is deprecated.', E_USER_DEPRECATED); + return $this->is_internal; + } + + /** + * If this is `true`, then checks are made only from the 'internal_checkers'. + * If it is `false`, then checks are made only from the 'selected_regions'. + * It is an error to provide 'selected_regions' when is_internal is `true`, + * or to provide 'internal_checkers' when is_internal is `false`. + * + * Generated from protobuf field bool is_internal = 15 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setIsInternal($var) + { + @trigger_error('is_internal is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->is_internal = $var; + + return $this; + } + + /** + * The internal checkers that this check will egress from. If `is_internal` is + * `true` and this list is empty, the check will egress from all the + * InternalCheckers configured for the project that owns this + * `UptimeCheckConfig`. + * + * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getInternalCheckers() + { + @trigger_error('internal_checkers is deprecated.', E_USER_DEPRECATED); + return $this->internal_checkers; + } + + /** + * The internal checkers that this check will egress from. If `is_internal` is + * `true` and this list is empty, the check will egress from all the + * InternalCheckers configured for the project that owns this + * `UptimeCheckConfig`. + * + * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; + * @param \Google\Cloud\Monitoring\V3\InternalChecker[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setInternalCheckers($var) + { + @trigger_error('internal_checkers is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\InternalChecker::class); + $this->internal_checkers = $arr; + + return $this; + } + + /** + * @return string + */ + public function getResource() + { + return $this->whichOneof("resource"); + } + + /** + * @return string + */ + public function getCheckRequestType() + { + return $this->whichOneof("check_request_type"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php new file mode 100644 index 00000000000..3d662c990c6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php @@ -0,0 +1,116 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher + */ +class ContentMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * String or regex content to match. Maximum 1024 bytes. An empty `content` + * string indicates no content matching is to be performed. + * + * Generated from protobuf field string content = 1; + */ + protected $content = ''; + /** + * The type of content matcher that will be applied to the server output, + * compared to the `content` string when the check is run. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption matcher = 2; + */ + protected $matcher = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * String or regex content to match. Maximum 1024 bytes. An empty `content` + * string indicates no content matching is to be performed. + * @type int $matcher + * The type of content matcher that will be applied to the server output, + * compared to the `content` string when the check is run. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * String or regex content to match. Maximum 1024 bytes. An empty `content` + * string indicates no content matching is to be performed. + * + * Generated from protobuf field string content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * String or regex content to match. Maximum 1024 bytes. An empty `content` + * string indicates no content matching is to be performed. + * + * Generated from protobuf field string content = 1; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * The type of content matcher that will be applied to the server output, + * compared to the `content` string when the check is run. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption matcher = 2; + * @return int + */ + public function getMatcher() + { + return $this->matcher; + } + + /** + * The type of content matcher that will be applied to the server output, + * compared to the `content` string when the check is run. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption matcher = 2; + * @param int $var + * @return $this + */ + public function setMatcher($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\ContentMatcherOption::class); + $this->matcher = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ContentMatcher::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php new file mode 100644 index 00000000000..b2d900726d2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php @@ -0,0 +1,89 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption + */ +class ContentMatcherOption +{ + /** + * No content matcher type specified (maintained for backward + * compatibility, but deprecated for future use). + * Treated as `CONTAINS_STRING`. + * + * Generated from protobuf enum CONTENT_MATCHER_OPTION_UNSPECIFIED = 0; + */ + const CONTENT_MATCHER_OPTION_UNSPECIFIED = 0; + /** + * Selects substring matching. The match succeeds if the output contains + * the `content` string. This is the default value for checks without + * a `matcher` option, or where the value of `matcher` is + * `CONTENT_MATCHER_OPTION_UNSPECIFIED`. + * + * Generated from protobuf enum CONTAINS_STRING = 1; + */ + const CONTAINS_STRING = 1; + /** + * Selects negation of substring matching. The match succeeds if the + * output does _NOT_ contain the `content` string. + * + * Generated from protobuf enum NOT_CONTAINS_STRING = 2; + */ + const NOT_CONTAINS_STRING = 2; + /** + * Selects regular-expression matching. The match succeeds of the output + * matches the regular expression specified in the `content` string. + * Regex matching is only supported for HTTP/HTTPS checks. + * + * Generated from protobuf enum MATCHES_REGEX = 3; + */ + const MATCHES_REGEX = 3; + /** + * Selects negation of regular-expression matching. The match succeeds if + * the output does _NOT_ match the regular expression specified in the + * `content` string. Regex matching is only supported for HTTP/HTTPS + * checks. + * + * Generated from protobuf enum NOT_MATCHES_REGEX = 4; + */ + const NOT_MATCHES_REGEX = 4; + + private static $valueToName = [ + self::CONTENT_MATCHER_OPTION_UNSPECIFIED => 'CONTENT_MATCHER_OPTION_UNSPECIFIED', + self::CONTAINS_STRING => 'CONTAINS_STRING', + self::NOT_CONTAINS_STRING => 'NOT_CONTAINS_STRING', + self::MATCHES_REGEX => 'MATCHES_REGEX', + self::NOT_MATCHES_REGEX => 'NOT_MATCHES_REGEX', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ContentMatcherOption::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_ContentMatcherOption::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php new file mode 100644 index 00000000000..f4575813f5a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php @@ -0,0 +1,538 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck + */ +class HttpCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP request method to use for the check. If set to + * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + */ + protected $request_method = 0; + /** + * If `true`, use HTTPS instead of HTTP to run the check. + * + * Generated from protobuf field bool use_ssl = 1; + */ + protected $use_ssl = false; + /** + * Optional (defaults to "/"). The path to the page against which to run + * the check. Will be combined with the `host` (specified within the + * `monitored_resource`) and `port` to construct the full URL. If the + * provided path does not begin with "/", a "/" will be prepended + * automatically. + * + * Generated from protobuf field string path = 2; + */ + protected $path = ''; + /** + * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when + * `use_ssl` is `true`). The TCP port on the HTTP server against which to + * run the check. Will be combined with host (specified within the + * `monitored_resource`) and `path` to construct the full URL. + * + * Generated from protobuf field int32 port = 3; + */ + protected $port = 0; + /** + * The authentication information. Optional when creating an HTTP check; + * defaults to empty. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication auth_info = 4; + */ + protected $auth_info = null; + /** + * Boolean specifying whether to encrypt the header information. + * Encryption should be specified for any headers related to authentication + * that you do not wish to be seen when retrieving the configuration. The + * server will be responsible for encrypting the headers. + * On Get/List calls, if `mask_headers` is set to `true` then the headers + * will be obscured with `******.` + * + * Generated from protobuf field bool mask_headers = 5; + */ + protected $mask_headers = false; + /** + * The list of headers to send as part of the Uptime check request. + * If two headers have the same key and different values, they should + * be entered as a single header, with the value being a comma-separated + * list of all the desired values as described at + * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). + * Entering two separate headers with the same key in a Create call will + * cause the first to be overwritten by the second. + * The maximum number of headers allowed is 100. + * + * Generated from protobuf field map headers = 6; + */ + private $headers; + /** + * The content type header to use for the check. The following + * configurations result in errors: + * 1. Content type is specified in both the `headers` field and the + * `content_type` field. + * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` + * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. + * 4. Request method is `POST` and a "Content-Type" header is provided via + * `headers` field. The `content_type` field should be used instead. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + */ + protected $content_type = 0; + /** + * Boolean specifying whether to include SSL certificate validation as a + * part of the Uptime check. Only applies to checks where + * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, + * setting `validate_ssl` to `true` has no effect. + * + * Generated from protobuf field bool validate_ssl = 7; + */ + protected $validate_ssl = false; + /** + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". + * + * Generated from protobuf field bytes body = 10; + */ + protected $body = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $request_method + * The HTTP request method to use for the check. If set to + * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. + * @type bool $use_ssl + * If `true`, use HTTPS instead of HTTP to run the check. + * @type string $path + * Optional (defaults to "/"). The path to the page against which to run + * the check. Will be combined with the `host` (specified within the + * `monitored_resource`) and `port` to construct the full URL. If the + * provided path does not begin with "/", a "/" will be prepended + * automatically. + * @type int $port + * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when + * `use_ssl` is `true`). The TCP port on the HTTP server against which to + * run the check. Will be combined with host (specified within the + * `monitored_resource`) and `path` to construct the full URL. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication $auth_info + * The authentication information. Optional when creating an HTTP check; + * defaults to empty. + * @type bool $mask_headers + * Boolean specifying whether to encrypt the header information. + * Encryption should be specified for any headers related to authentication + * that you do not wish to be seen when retrieving the configuration. The + * server will be responsible for encrypting the headers. + * On Get/List calls, if `mask_headers` is set to `true` then the headers + * will be obscured with `******.` + * @type array|\Google\Protobuf\Internal\MapField $headers + * The list of headers to send as part of the Uptime check request. + * If two headers have the same key and different values, they should + * be entered as a single header, with the value being a comma-separated + * list of all the desired values as described at + * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). + * Entering two separate headers with the same key in a Create call will + * cause the first to be overwritten by the second. + * The maximum number of headers allowed is 100. + * @type int $content_type + * The content type header to use for the check. The following + * configurations result in errors: + * 1. Content type is specified in both the `headers` field and the + * `content_type` field. + * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` + * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. + * 4. Request method is `POST` and a "Content-Type" header is provided via + * `headers` field. The `content_type` field should be used instead. + * @type bool $validate_ssl + * Boolean specifying whether to include SSL certificate validation as a + * part of the Uptime check. Only applies to checks where + * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, + * setting `validate_ssl` to `true` has no effect. + * @type string $body + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP request method to use for the check. If set to + * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * @return int + */ + public function getRequestMethod() + { + return $this->request_method; + } + + /** + * The HTTP request method to use for the check. If set to + * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; + * @param int $var + * @return $this + */ + public function setRequestMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\RequestMethod::class); + $this->request_method = $var; + + return $this; + } + + /** + * If `true`, use HTTPS instead of HTTP to run the check. + * + * Generated from protobuf field bool use_ssl = 1; + * @return bool + */ + public function getUseSsl() + { + return $this->use_ssl; + } + + /** + * If `true`, use HTTPS instead of HTTP to run the check. + * + * Generated from protobuf field bool use_ssl = 1; + * @param bool $var + * @return $this + */ + public function setUseSsl($var) + { + GPBUtil::checkBool($var); + $this->use_ssl = $var; + + return $this; + } + + /** + * Optional (defaults to "/"). The path to the page against which to run + * the check. Will be combined with the `host` (specified within the + * `monitored_resource`) and `port` to construct the full URL. If the + * provided path does not begin with "/", a "/" will be prepended + * automatically. + * + * Generated from protobuf field string path = 2; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional (defaults to "/"). The path to the page against which to run + * the check. Will be combined with the `host` (specified within the + * `monitored_resource`) and `port` to construct the full URL. If the + * provided path does not begin with "/", a "/" will be prepended + * automatically. + * + * Generated from protobuf field string path = 2; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when + * `use_ssl` is `true`). The TCP port on the HTTP server against which to + * run the check. Will be combined with host (specified within the + * `monitored_resource`) and `path` to construct the full URL. + * + * Generated from protobuf field int32 port = 3; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when + * `use_ssl` is `true`). The TCP port on the HTTP server against which to + * run the check. Will be combined with host (specified within the + * `monitored_resource`) and `path` to construct the full URL. + * + * Generated from protobuf field int32 port = 3; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * The authentication information. Optional when creating an HTTP check; + * defaults to empty. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication auth_info = 4; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication|null + */ + public function getAuthInfo() + { + return $this->auth_info; + } + + public function hasAuthInfo() + { + return isset($this->auth_info); + } + + public function clearAuthInfo() + { + unset($this->auth_info); + } + + /** + * The authentication information. Optional when creating an HTTP check; + * defaults to empty. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication auth_info = 4; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication $var + * @return $this + */ + public function setAuthInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication::class); + $this->auth_info = $var; + + return $this; + } + + /** + * Boolean specifying whether to encrypt the header information. + * Encryption should be specified for any headers related to authentication + * that you do not wish to be seen when retrieving the configuration. The + * server will be responsible for encrypting the headers. + * On Get/List calls, if `mask_headers` is set to `true` then the headers + * will be obscured with `******.` + * + * Generated from protobuf field bool mask_headers = 5; + * @return bool + */ + public function getMaskHeaders() + { + return $this->mask_headers; + } + + /** + * Boolean specifying whether to encrypt the header information. + * Encryption should be specified for any headers related to authentication + * that you do not wish to be seen when retrieving the configuration. The + * server will be responsible for encrypting the headers. + * On Get/List calls, if `mask_headers` is set to `true` then the headers + * will be obscured with `******.` + * + * Generated from protobuf field bool mask_headers = 5; + * @param bool $var + * @return $this + */ + public function setMaskHeaders($var) + { + GPBUtil::checkBool($var); + $this->mask_headers = $var; + + return $this; + } + + /** + * The list of headers to send as part of the Uptime check request. + * If two headers have the same key and different values, they should + * be entered as a single header, with the value being a comma-separated + * list of all the desired values as described at + * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). + * Entering two separate headers with the same key in a Create call will + * cause the first to be overwritten by the second. + * The maximum number of headers allowed is 100. + * + * Generated from protobuf field map headers = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * The list of headers to send as part of the Uptime check request. + * If two headers have the same key and different values, they should + * be entered as a single header, with the value being a comma-separated + * list of all the desired values as described at + * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). + * Entering two separate headers with the same key in a Create call will + * cause the first to be overwritten by the second. + * The maximum number of headers allowed is 100. + * + * Generated from protobuf field map headers = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * The content type header to use for the check. The following + * configurations result in errors: + * 1. Content type is specified in both the `headers` field and the + * `content_type` field. + * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` + * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. + * 4. Request method is `POST` and a "Content-Type" header is provided via + * `headers` field. The `content_type` field should be used instead. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * @return int + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * The content type header to use for the check. The following + * configurations result in errors: + * 1. Content type is specified in both the `headers` field and the + * `content_type` field. + * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` + * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. + * 4. Request method is `POST` and a "Content-Type" header is provided via + * `headers` field. The `content_type` field should be used instead. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * @param int $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ContentType::class); + $this->content_type = $var; + + return $this; + } + + /** + * Boolean specifying whether to include SSL certificate validation as a + * part of the Uptime check. Only applies to checks where + * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, + * setting `validate_ssl` to `true` has no effect. + * + * Generated from protobuf field bool validate_ssl = 7; + * @return bool + */ + public function getValidateSsl() + { + return $this->validate_ssl; + } + + /** + * Boolean specifying whether to include SSL certificate validation as a + * part of the Uptime check. Only applies to checks where + * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, + * setting `validate_ssl` to `true` has no effect. + * + * Generated from protobuf field bool validate_ssl = 7; + * @param bool $var + * @return $this + */ + public function setValidateSsl($var) + { + GPBUtil::checkBool($var); + $this->validate_ssl = $var; + + return $this; + } + + /** + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". + * + * Generated from protobuf field bytes body = 10; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". + * + * Generated from protobuf field bytes body = 10; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HttpCheck::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php new file mode 100644 index 00000000000..d193ecd51c7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php @@ -0,0 +1,107 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication + */ +class BasicAuthentication extends \Google\Protobuf\Internal\Message +{ + /** + * The username to use when authenticating with the HTTP server. + * + * Generated from protobuf field string username = 1; + */ + protected $username = ''; + /** + * The password to use when authenticating with the HTTP server. + * + * Generated from protobuf field string password = 2; + */ + protected $password = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $username + * The username to use when authenticating with the HTTP server. + * @type string $password + * The password to use when authenticating with the HTTP server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * The username to use when authenticating with the HTTP server. + * + * Generated from protobuf field string username = 1; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * The username to use when authenticating with the HTTP server. + * + * Generated from protobuf field string username = 1; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * The password to use when authenticating with the HTTP server. + * + * Generated from protobuf field string password = 2; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * The password to use when authenticating with the HTTP server. + * + * Generated from protobuf field string password = 2; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BasicAuthentication::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_BasicAuthentication::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php new file mode 100644 index 00000000000..8e06ad7b38b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php @@ -0,0 +1,58 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType + */ +class ContentType +{ + /** + * No content type specified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * `body` is in URL-encoded form. Equivalent to setting the `Content-Type` + * to `application/x-www-form-urlencoded` in the HTTP request. + * + * Generated from protobuf enum URL_ENCODED = 1; + */ + const URL_ENCODED = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::URL_ENCODED => 'URL_ENCODED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ContentType::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ContentType::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php new file mode 100644 index 00000000000..981e2cbc372 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php @@ -0,0 +1,64 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod + */ +class RequestMethod +{ + /** + * No request method specified. + * + * Generated from protobuf enum METHOD_UNSPECIFIED = 0; + */ + const METHOD_UNSPECIFIED = 0; + /** + * GET request. + * + * Generated from protobuf enum GET = 1; + */ + const GET = 1; + /** + * POST request. + * + * Generated from protobuf enum POST = 2; + */ + const POST = 2; + + private static $valueToName = [ + self::METHOD_UNSPECIFIED => 'METHOD_UNSPECIFIED', + self::GET => 'GET', + self::POST => 'POST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RequestMethod::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_RequestMethod::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php new file mode 100644 index 00000000000..25ef6cb80c6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php @@ -0,0 +1,113 @@ +google.monitoring.v3.UptimeCheckConfig.ResourceGroup + */ +class ResourceGroup extends \Google\Protobuf\Internal\Message +{ + /** + * The group of resources being monitored. Should be only the `[GROUP_ID]`, + * and not the full-path + * `projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]`. + * + * Generated from protobuf field string group_id = 1; + */ + protected $group_id = ''; + /** + * The resource type of the group members. + * + * Generated from protobuf field .google.monitoring.v3.GroupResourceType resource_type = 2; + */ + protected $resource_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $group_id + * The group of resources being monitored. Should be only the `[GROUP_ID]`, + * and not the full-path + * `projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]`. + * @type int $resource_type + * The resource type of the group members. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * The group of resources being monitored. Should be only the `[GROUP_ID]`, + * and not the full-path + * `projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]`. + * + * Generated from protobuf field string group_id = 1; + * @return string + */ + public function getGroupId() + { + return $this->group_id; + } + + /** + * The group of resources being monitored. Should be only the `[GROUP_ID]`, + * and not the full-path + * `projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]`. + * + * Generated from protobuf field string group_id = 1; + * @param string $var + * @return $this + */ + public function setGroupId($var) + { + GPBUtil::checkString($var, True); + $this->group_id = $var; + + return $this; + } + + /** + * The resource type of the group members. + * + * Generated from protobuf field .google.monitoring.v3.GroupResourceType resource_type = 2; + * @return int + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * The resource type of the group members. + * + * Generated from protobuf field .google.monitoring.v3.GroupResourceType resource_type = 2; + * @param int $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\GroupResourceType::class); + $this->resource_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResourceGroup::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ResourceGroup::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php new file mode 100644 index 00000000000..8acc7779e6b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php @@ -0,0 +1,78 @@ +google.monitoring.v3.UptimeCheckConfig.TcpCheck + */ +class TcpCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The TCP port on the server against which to run the check. Will be + * combined with host (specified within the `monitored_resource`) to + * construct the full URL. Required. + * + * Generated from protobuf field int32 port = 1; + */ + protected $port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $port + * The TCP port on the server against which to run the check. Will be + * combined with host (specified within the `monitored_resource`) to + * construct the full URL. Required. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * The TCP port on the server against which to run the check. Will be + * combined with host (specified within the `monitored_resource`) to + * construct the full URL. Required. + * + * Generated from protobuf field int32 port = 1; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * The TCP port on the server against which to run the check. Will be + * combined with host (specified within the `monitored_resource`) to + * construct the full URL. Required. + * + * Generated from protobuf field int32 port = 1; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TcpCheck::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_TcpCheck::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher.php new file mode 100644 index 00000000000..4ba1f5d9ac4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher.php @@ -0,0 +1,16 @@ +google.monitoring.v3.UptimeCheckIp + */ +class UptimeCheckIp extends \Google\Protobuf\Internal\Message +{ + /** + * A broad region category in which the IP address is located. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckRegion region = 1; + */ + protected $region = 0; + /** + * A more specific location within the region that typically encodes + * a particular city/town/metro (and its containing state/province or country) + * within the broader umbrella region category. + * + * Generated from protobuf field string location = 2; + */ + protected $location = ''; + /** + * The IP address from which the Uptime check originates. This is a fully + * specified IP address (not an IP address range). Most IP addresses, as of + * this publication, are in IPv4 format; however, one should not rely on the + * IP addresses being in IPv4 format indefinitely, and should support + * interpreting this field in either IPv4 or IPv6 format. + * + * Generated from protobuf field string ip_address = 3; + */ + protected $ip_address = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $region + * A broad region category in which the IP address is located. + * @type string $location + * A more specific location within the region that typically encodes + * a particular city/town/metro (and its containing state/province or country) + * within the broader umbrella region category. + * @type string $ip_address + * The IP address from which the Uptime check originates. This is a fully + * specified IP address (not an IP address range). Most IP addresses, as of + * this publication, are in IPv4 format; however, one should not rely on the + * IP addresses being in IPv4 format indefinitely, and should support + * interpreting this field in either IPv4 or IPv6 format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * A broad region category in which the IP address is located. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckRegion region = 1; + * @return int + */ + public function getRegion() + { + return $this->region; + } + + /** + * A broad region category in which the IP address is located. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckRegion region = 1; + * @param int $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckRegion::class); + $this->region = $var; + + return $this; + } + + /** + * A more specific location within the region that typically encodes + * a particular city/town/metro (and its containing state/province or country) + * within the broader umbrella region category. + * + * Generated from protobuf field string location = 2; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * A more specific location within the region that typically encodes + * a particular city/town/metro (and its containing state/province or country) + * within the broader umbrella region category. + * + * Generated from protobuf field string location = 2; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * The IP address from which the Uptime check originates. This is a fully + * specified IP address (not an IP address range). Most IP addresses, as of + * this publication, are in IPv4 format; however, one should not rely on the + * IP addresses being in IPv4 format indefinitely, and should support + * interpreting this field in either IPv4 or IPv6 format. + * + * Generated from protobuf field string ip_address = 3; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * The IP address from which the Uptime check originates. This is a fully + * specified IP address (not an IP address range). Most IP addresses, as of + * this publication, are in IPv4 format; however, one should not rely on the + * IP addresses being in IPv4 format indefinitely, and should support + * interpreting this field in either IPv4 or IPv6 format. + * + * Generated from protobuf field string ip_address = 3; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php new file mode 100644 index 00000000000..e0ba1c64364 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php @@ -0,0 +1,78 @@ +google.monitoring.v3.UptimeCheckRegion + */ +class UptimeCheckRegion +{ + /** + * Default value if no region is specified. Will result in Uptime checks + * running from all regions. + * + * Generated from protobuf enum REGION_UNSPECIFIED = 0; + */ + const REGION_UNSPECIFIED = 0; + /** + * Allows checks to run from locations within the United States of America. + * + * Generated from protobuf enum USA = 1; + */ + const USA = 1; + /** + * Allows checks to run from locations within the continent of Europe. + * + * Generated from protobuf enum EUROPE = 2; + */ + const EUROPE = 2; + /** + * Allows checks to run from locations within the continent of South + * America. + * + * Generated from protobuf enum SOUTH_AMERICA = 3; + */ + const SOUTH_AMERICA = 3; + /** + * Allows checks to run from locations within the Asia Pacific area (ex: + * Singapore). + * + * Generated from protobuf enum ASIA_PACIFIC = 4; + */ + const ASIA_PACIFIC = 4; + + private static $valueToName = [ + self::REGION_UNSPECIFIED => 'REGION_UNSPECIFIED', + self::USA => 'USA', + self::EUROPE => 'EUROPE', + self::SOUTH_AMERICA => 'SOUTH_AMERICA', + self::ASIA_PACIFIC => 'ASIA_PACIFIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckServiceGrpcClient.php new file mode 100644 index 00000000000..602a63f3bcd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckServiceGrpcClient.php @@ -0,0 +1,138 @@ +_simpleRequest('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs', + $argument, + ['\Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets a single Uptime check configuration. + * @param \Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetUptimeCheckConfig(\Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig', + $argument, + ['\Google\Cloud\Monitoring\V3\UptimeCheckConfig', 'decode'], + $metadata, $options); + } + + /** + * Creates a new Uptime check configuration. + * @param \Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig', + $argument, + ['\Google\Cloud\Monitoring\V3\UptimeCheckConfig', 'decode'], + $metadata, $options); + } + + /** + * Updates an Uptime check configuration. You can either replace the entire + * configuration with a new one or replace only certain fields in the current + * configuration by specifying the fields to be updated via `updateMask`. + * Returns the updated configuration. + * @param \Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig', + $argument, + ['\Google\Cloud\Monitoring\V3\UptimeCheckConfig', 'decode'], + $metadata, $options); + } + + /** + * Deletes an Uptime check configuration. Note that this method will fail + * if the Uptime check configuration is referenced by an alert policy or + * other dependent configs that would be rendered invalid by the deletion. + * @param \Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteUptimeCheckConfig(\Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Returns the list of IP addresses that checkers run from + * @param \Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListUptimeCheckIps(\Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps', + $argument, + ['\Google\Cloud\Monitoring\V3\ListUptimeCheckIpsResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php new file mode 100644 index 00000000000..926f5089a26 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php @@ -0,0 +1,125 @@ +google.monitoring.v3.VerifyNotificationChannelRequest + */ +class VerifyNotificationChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The notification channel to verify. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The verification code that was delivered to the channel as + * a result of invoking the `SendNotificationChannelVerificationCode` API + * method or that was retrieved from a verified channel via + * `GetNotificationChannelVerificationCode`. For example, one might have + * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only + * guaranteed that the code is valid UTF-8; one should not + * make any assumptions regarding the structure or format of the code). + * + * Generated from protobuf field string code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The notification channel to verify. + * @type string $code + * Required. The verification code that was delivered to the channel as + * a result of invoking the `SendNotificationChannelVerificationCode` API + * method or that was retrieved from a verified channel via + * `GetNotificationChannelVerificationCode`. For example, one might have + * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only + * guaranteed that the code is valid UTF-8; one should not + * make any assumptions regarding the structure or format of the code). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The notification channel to verify. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The notification channel to verify. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The verification code that was delivered to the channel as + * a result of invoking the `SendNotificationChannelVerificationCode` API + * method or that was retrieved from a verified channel via + * `GetNotificationChannelVerificationCode`. For example, one might have + * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only + * guaranteed that the code is valid UTF-8; one should not + * make any assumptions regarding the structure or format of the code). + * + * Generated from protobuf field string code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * Required. The verification code that was delivered to the channel as + * a result of invoking the `SendNotificationChannelVerificationCode` API + * method or that was retrieved from a verified channel via + * `GetNotificationChannelVerificationCode`. For example, one might have + * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only + * guaranteed that the code is valid UTF-8; one should not + * make any assumptions regarding the structure or format of the code). + * + * Generated from protobuf field string code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php new file mode 100644 index 00000000000..f049ead8c43 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php @@ -0,0 +1,236 @@ +google.monitoring.v3.WindowsBasedSli + */ +class WindowsBasedSli extends \Google\Protobuf\Internal\Message +{ + /** + * Duration over which window quality is evaluated. Must be an integer + * fraction of a day and at least `60s`. + * + * Generated from protobuf field .google.protobuf.Duration window_period = 4; + */ + protected $window_period = null; + protected $window_criterion; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $good_bad_metric_filter + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if + * any `true` values appear in the window. + * @type \Google\Cloud\Monitoring\V3\WindowsBasedSli\PerformanceThreshold $good_total_ratio_threshold + * A window is good if its `performance` is high enough. + * @type \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange $metric_mean_in_range + * A window is good if the metric's value is in a good range, averaged + * across returned streams. + * @type \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange $metric_sum_in_range + * A window is good if the metric's value is in a good range, summed across + * returned streams. + * @type \Google\Protobuf\Duration $window_period + * Duration over which window quality is evaluated. Must be an integer + * fraction of a day and at least `60s`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if + * any `true` values appear in the window. + * + * Generated from protobuf field string good_bad_metric_filter = 5; + * @return string + */ + public function getGoodBadMetricFilter() + { + return $this->readOneof(5); + } + + public function hasGoodBadMetricFilter() + { + return $this->hasOneof(5); + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if + * any `true` values appear in the window. + * + * Generated from protobuf field string good_bad_metric_filter = 5; + * @param string $var + * @return $this + */ + public function setGoodBadMetricFilter($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A window is good if its `performance` is high enough. + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli\PerformanceThreshold|null + */ + public function getGoodTotalRatioThreshold() + { + return $this->readOneof(2); + } + + public function hasGoodTotalRatioThreshold() + { + return $this->hasOneof(2); + } + + /** + * A window is good if its `performance` is high enough. + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.PerformanceThreshold good_total_ratio_threshold = 2; + * @param \Google\Cloud\Monitoring\V3\WindowsBasedSli\PerformanceThreshold $var + * @return $this + */ + public function setGoodTotalRatioThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli\PerformanceThreshold::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A window is good if the metric's value is in a good range, averaged + * across returned streams. + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange|null + */ + public function getMetricMeanInRange() + { + return $this->readOneof(6); + } + + public function hasMetricMeanInRange() + { + return $this->hasOneof(6); + } + + /** + * A window is good if the metric's value is in a good range, averaged + * across returned streams. + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; + * @param \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange $var + * @return $this + */ + public function setMetricMeanInRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * A window is good if the metric's value is in a good range, summed across + * returned streams. + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange|null + */ + public function getMetricSumInRange() + { + return $this->readOneof(7); + } + + public function hasMetricSumInRange() + { + return $this->hasOneof(7); + } + + /** + * A window is good if the metric's value is in a good range, summed across + * returned streams. + * + * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; + * @param \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange $var + * @return $this + */ + public function setMetricSumInRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Duration over which window quality is evaluated. Must be an integer + * fraction of a day and at least `60s`. + * + * Generated from protobuf field .google.protobuf.Duration window_period = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getWindowPeriod() + { + return $this->window_period; + } + + public function hasWindowPeriod() + { + return isset($this->window_period); + } + + public function clearWindowPeriod() + { + unset($this->window_period); + } + + /** + * Duration over which window quality is evaluated. Must be an integer + * fraction of a day and at least `60s`. + * + * Generated from protobuf field .google.protobuf.Duration window_period = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWindowPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->window_period = $var; + + return $this; + } + + /** + * @return string + */ + public function getWindowCriterion() + { + return $this->whichOneof("window_criterion"); + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php new file mode 100644 index 00000000000..2a86a24e4ea --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php @@ -0,0 +1,125 @@ +google.monitoring.v3.WindowsBasedSli.MetricRange + */ +class MetricRange extends \Google\Protobuf\Internal\Message +{ + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying the `TimeSeries` to use for evaluating window quality. + * + * Generated from protobuf field string time_series = 1; + */ + protected $time_series = ''; + /** + * Range of values considered "good." For a one-sided range, set one bound + * to an infinite value. + * + * Generated from protobuf field .google.monitoring.v3.Range range = 4; + */ + protected $range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $time_series + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying the `TimeSeries` to use for evaluating window quality. + * @type \Google\Cloud\Monitoring\V3\Range $range + * Range of values considered "good." For a one-sided range, set one bound + * to an infinite value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying the `TimeSeries` to use for evaluating window quality. + * + * Generated from protobuf field string time_series = 1; + * @return string + */ + public function getTimeSeries() + { + return $this->time_series; + } + + /** + * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifying the `TimeSeries` to use for evaluating window quality. + * + * Generated from protobuf field string time_series = 1; + * @param string $var + * @return $this + */ + public function setTimeSeries($var) + { + GPBUtil::checkString($var, True); + $this->time_series = $var; + + return $this; + } + + /** + * Range of values considered "good." For a one-sided range, set one bound + * to an infinite value. + * + * Generated from protobuf field .google.monitoring.v3.Range range = 4; + * @return \Google\Cloud\Monitoring\V3\Range|null + */ + public function getRange() + { + return $this->range; + } + + public function hasRange() + { + return isset($this->range); + } + + public function clearRange() + { + unset($this->range); + } + + /** + * Range of values considered "good." For a one-sided range, set one bound + * to an infinite value. + * + * Generated from protobuf field .google.monitoring.v3.Range range = 4; + * @param \Google\Cloud\Monitoring\V3\Range $var + * @return $this + */ + public function setRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Range::class); + $this->range = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MetricRange::class, \Google\Cloud\Monitoring\V3\WindowsBasedSli_MetricRange::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php new file mode 100644 index 00000000000..7ff22f3a677 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php @@ -0,0 +1,146 @@ +google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + */ +class PerformanceThreshold extends \Google\Protobuf\Internal\Message +{ + /** + * If window `performance >= threshold`, the window is counted as good. + * + * Generated from protobuf field double threshold = 2; + */ + protected $threshold = 0.0; + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\RequestBasedSli $performance + * `RequestBasedSli` to evaluate to judge window quality. + * @type \Google\Cloud\Monitoring\V3\BasicSli $basic_sli_performance + * `BasicSli` to evaluate to judge window quality. + * @type float $threshold + * If window `performance >= threshold`, the window is counted as good. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); + parent::__construct($data); + } + + /** + * `RequestBasedSli` to evaluate to judge window quality. + * + * Generated from protobuf field .google.monitoring.v3.RequestBasedSli performance = 1; + * @return \Google\Cloud\Monitoring\V3\RequestBasedSli|null + */ + public function getPerformance() + { + return $this->readOneof(1); + } + + public function hasPerformance() + { + return $this->hasOneof(1); + } + + /** + * `RequestBasedSli` to evaluate to judge window quality. + * + * Generated from protobuf field .google.monitoring.v3.RequestBasedSli performance = 1; + * @param \Google\Cloud\Monitoring\V3\RequestBasedSli $var + * @return $this + */ + public function setPerformance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\RequestBasedSli::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * `BasicSli` to evaluate to judge window quality. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli basic_sli_performance = 3; + * @return \Google\Cloud\Monitoring\V3\BasicSli|null + */ + public function getBasicSliPerformance() + { + return $this->readOneof(3); + } + + public function hasBasicSliPerformance() + { + return $this->hasOneof(3); + } + + /** + * `BasicSli` to evaluate to judge window quality. + * + * Generated from protobuf field .google.monitoring.v3.BasicSli basic_sli_performance = 3; + * @param \Google\Cloud\Monitoring\V3\BasicSli $var + * @return $this + */ + public function setBasicSliPerformance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * If window `performance >= threshold`, the window is counted as good. + * + * Generated from protobuf field double threshold = 2; + * @return float + */ + public function getThreshold() + { + return $this->threshold; + } + + /** + * If window `performance >= threshold`, the window is counted as good. + * + * Generated from protobuf field double threshold = 2; + * @param float $var + * @return $this + */ + public function setThreshold($var) + { + GPBUtil::checkDouble($var); + $this->threshold = $var; + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PerformanceThreshold::class, \Google\Cloud\Monitoring\V3\WindowsBasedSli_PerformanceThreshold::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli_MetricRange.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli_MetricRange.php new file mode 100644 index 00000000000..e35bfef8d80 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli_MetricRange.php @@ -0,0 +1,16 @@ +createAlertPolicy($name, $alertPolicy); + * } finally { + * $alertPolicyServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class AlertPolicyServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.monitoring.v3.AlertPolicyService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + + private static $alertPolicyNameTemplate; + + private static $folderAlertPolicyNameTemplate; + + private static $organizationAlertPolicyNameTemplate; + + private static $projectAlertPolicyNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/alert_policy_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/alert_policy_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/alert_policy_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/alert_policy_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getAlertPolicyNameTemplate() + { + if (self::$alertPolicyNameTemplate == null) { + self::$alertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); + } + + return self::$alertPolicyNameTemplate; + } + + private static function getFolderAlertPolicyNameTemplate() + { + if (self::$folderAlertPolicyNameTemplate == null) { + self::$folderAlertPolicyNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}'); + } + + return self::$folderAlertPolicyNameTemplate; + } + + private static function getOrganizationAlertPolicyNameTemplate() + { + if (self::$organizationAlertPolicyNameTemplate == null) { + self::$organizationAlertPolicyNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}'); + } + + return self::$organizationAlertPolicyNameTemplate; + } + + private static function getProjectAlertPolicyNameTemplate() + { + if (self::$projectAlertPolicyNameTemplate == null) { + self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); + } + + return self::$projectAlertPolicyNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'alertPolicy' => self::getAlertPolicyNameTemplate(), + 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), + 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), + 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a alert_policy + * resource. + * + * @param string $project + * @param string $alertPolicy + * + * @return string The formatted alert_policy resource. + */ + public static function alertPolicyName($project, $alertPolicy) + { + return self::getAlertPolicyNameTemplate()->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_alert_policy resource. + * + * @param string $folder + * @param string $alertPolicy + * + * @return string The formatted folder_alert_policy resource. + */ + public static function folderAlertPolicyName($folder, $alertPolicy) + { + return self::getFolderAlertPolicyNameTemplate()->render([ + 'folder' => $folder, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_alert_policy resource. + * + * @param string $organization + * @param string $alertPolicy + * + * @return string The formatted organization_alert_policy resource. + */ + public static function organizationAlertPolicyName($organization, $alertPolicy) + { + return self::getOrganizationAlertPolicyNameTemplate()->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_alert_policy resource. + * + * @param string $project + * @param string $alertPolicy + * + * @return string The formatted project_alert_policy resource. + */ + public static function projectAlertPolicyName($project, $alertPolicy) + { + return self::getProjectAlertPolicyNameTemplate()->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'monitoring.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new alerting policy. + * + * Sample code: + * ``` + * $alertPolicyServiceClient = new AlertPolicyServiceClient(); + * try { + * $name = 'name'; + * $alertPolicy = new AlertPolicy(); + * $response = $alertPolicyServiceClient->createAlertPolicy($name, $alertPolicy); + * } finally { + * $alertPolicyServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the alerting policy. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * + * Note that this field names the parent container in which the alerting + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. + * @param AlertPolicy $alertPolicy Required. The requested alerting policy. You should omit the `name` field in this + * policy. The name will be returned in the new policy, including + * a new `[ALERT_POLICY_ID]` value. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\AlertPolicy + * + * @throws ApiException if the remote call fails + */ + public function createAlertPolicy($name, $alertPolicy, array $optionalArgs = []) + { + $request = new CreateAlertPolicyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setAlertPolicy($alertPolicy); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateAlertPolicy', AlertPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes an alerting policy. + * + * Sample code: + * ``` + * $alertPolicyServiceClient = new AlertPolicyServiceClient(); + * try { + * $formattedName = $alertPolicyServiceClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + * $alertPolicyServiceClient->deleteAlertPolicy($formattedName); + * } finally { + * $alertPolicyServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The alerting policy to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * + * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteAlertPolicy($name, array $optionalArgs = []) + { + $request = new DeleteAlertPolicyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteAlertPolicy', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single alerting policy. + * + * Sample code: + * ``` + * $alertPolicyServiceClient = new AlertPolicyServiceClient(); + * try { + * $formattedName = $alertPolicyServiceClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + * $response = $alertPolicyServiceClient->getAlertPolicy($formattedName); + * } finally { + * $alertPolicyServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The alerting policy to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\AlertPolicy + * + * @throws ApiException if the remote call fails + */ + public function getAlertPolicy($name, array $optionalArgs = []) + { + $request = new GetAlertPolicyRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetAlertPolicy', AlertPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the existing alerting policies for the workspace. + * + * Sample code: + * ``` + * $alertPolicyServiceClient = new AlertPolicyServiceClient(); + * try { + * $name = 'name'; + * // Iterate over pages of elements + * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($name); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($name); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $alertPolicyServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose alert policies are to be listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type string $orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listAlertPolicies($name, array $optionalArgs = []) + { + $request = new ListAlertPoliciesRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListAlertPolicies', $optionalArgs, ListAlertPoliciesResponse::class, $request); + } + + /** + * Updates an alerting policy. You can either replace the entire policy with + * a new one or replace only certain fields in the current alerting policy by + * specifying the fields to be updated via `updateMask`. Returns the + * updated alerting policy. + * + * Sample code: + * ``` + * $alertPolicyServiceClient = new AlertPolicyServiceClient(); + * try { + * $alertPolicy = new AlertPolicy(); + * $response = $alertPolicyServiceClient->updateAlertPolicy($alertPolicy); + * } finally { + * $alertPolicyServiceClient->close(); + * } + * ``` + * + * @param AlertPolicy $alertPolicy Required. The updated alerting policy or the updated values for the + * fields listed in `update_mask`. + * If `update_mask` is not empty, any fields in this policy that are + * not in `update_mask` are ignored. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. A list of alerting policy field names. If this field is not + * empty, each listed field in the existing alerting policy is set to the + * value of the corresponding field in the supplied policy (`alert_policy`), + * or to the field's default value if the field is not in the supplied + * alerting policy. Fields not listed retain their previous value. + * + * Examples of valid field masks include `display_name`, `documentation`, + * `documentation.content`, `documentation.mime_type`, `user_labels`, + * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. + * + * If this field is empty, then the supplied alerting policy replaces the + * existing policy. It is the same as deleting the existing policy and + * adding the supplied policy, except for the following: + * + * + The new policy will have the same `[ALERT_POLICY_ID]` as the former + * policy. This gives you continuity with the former policy in your + * notifications and incidents. + * + Conditions in the new policy will keep their former `[CONDITION_ID]` if + * the supplied condition includes the `name` field with that + * `[CONDITION_ID]`. If the supplied condition omits the `name` field, + * then a new `[CONDITION_ID]` is created. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\AlertPolicy + * + * @throws ApiException if the remote call fails + */ + public function updateAlertPolicy($alertPolicy, array $optionalArgs = []) + { + $request = new UpdateAlertPolicyRequest(); + $requestParamHeaders = []; + $request->setAlertPolicy($alertPolicy); + $requestParamHeaders['alert_policy.name'] = $alertPolicy->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateAlertPolicy', AlertPolicy::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php new file mode 100644 index 00000000000..c8615f7dbee --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php @@ -0,0 +1,757 @@ +createGroup($name, $group); + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class GroupServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.monitoring.v3.GroupService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + + private static $folderGroupNameTemplate; + + private static $groupNameTemplate; + + private static $organizationGroupNameTemplate; + + private static $projectGroupNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/group_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/group_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/group_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/group_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getFolderGroupNameTemplate() + { + if (self::$folderGroupNameTemplate == null) { + self::$folderGroupNameTemplate = new PathTemplate('folders/{folder}/groups/{group}'); + } + + return self::$folderGroupNameTemplate; + } + + private static function getGroupNameTemplate() + { + if (self::$groupNameTemplate == null) { + self::$groupNameTemplate = new PathTemplate('projects/{project}/groups/{group}'); + } + + return self::$groupNameTemplate; + } + + private static function getOrganizationGroupNameTemplate() + { + if (self::$organizationGroupNameTemplate == null) { + self::$organizationGroupNameTemplate = new PathTemplate('organizations/{organization}/groups/{group}'); + } + + return self::$organizationGroupNameTemplate; + } + + private static function getProjectGroupNameTemplate() + { + if (self::$projectGroupNameTemplate == null) { + self::$projectGroupNameTemplate = new PathTemplate('projects/{project}/groups/{group}'); + } + + return self::$projectGroupNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'folderGroup' => self::getFolderGroupNameTemplate(), + 'group' => self::getGroupNameTemplate(), + 'organizationGroup' => self::getOrganizationGroupNameTemplate(), + 'projectGroup' => self::getProjectGroupNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a folder_group + * resource. + * + * @param string $folder + * @param string $group + * + * @return string The formatted folder_group resource. + */ + public static function folderGroupName($folder, $group) + { + return self::getFolderGroupNameTemplate()->render([ + 'folder' => $folder, + 'group' => $group, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a group + * resource. + * + * @param string $project + * @param string $group + * + * @return string The formatted group resource. + */ + public static function groupName($project, $group) + { + return self::getGroupNameTemplate()->render([ + 'project' => $project, + 'group' => $group, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_group resource. + * + * @param string $organization + * @param string $group + * + * @return string The formatted organization_group resource. + */ + public static function organizationGroupName($organization, $group) + { + return self::getOrganizationGroupNameTemplate()->render([ + 'organization' => $organization, + 'group' => $group, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_group resource. + * + * @param string $project + * @param string $group + * + * @return string The formatted project_group resource. + */ + public static function projectGroupName($project, $group) + { + return self::getProjectGroupNameTemplate()->render([ + 'project' => $project, + 'group' => $group, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folderGroup: folders/{folder}/groups/{group} + * - group: projects/{project}/groups/{group} + * - organizationGroup: organizations/{organization}/groups/{group} + * - projectGroup: projects/{project}/groups/{group} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'monitoring.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new group. + * + * Sample code: + * ``` + * $groupServiceClient = new GroupServiceClient(); + * try { + * $name = 'name'; + * $group = new Group(); + * $response = $groupServiceClient->createGroup($name, $group); + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the group. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param Group $group Required. A group definition. It is an error to define the `name` field because + * the system assigns the name. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * If true, validate this request but do not create the group. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Group + * + * @throws ApiException if the remote call fails + */ + public function createGroup($name, $group, array $optionalArgs = []) + { + $request = new CreateGroupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setGroup($group); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateGroup', Group::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes an existing group. + * + * Sample code: + * ``` + * $groupServiceClient = new GroupServiceClient(); + * try { + * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); + * $groupServiceClient->deleteGroup($formattedName); + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The group to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @param array $optionalArgs { + * Optional. + * + * @type bool $recursive + * If this field is true, then the request means to delete a group with all + * its descendants. Otherwise, the request means to delete a group only when + * it has no descendants. The default value is false. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteGroup($name, array $optionalArgs = []) + { + $request = new DeleteGroupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['recursive'])) { + $request->setRecursive($optionalArgs['recursive']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteGroup', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single group. + * + * Sample code: + * ``` + * $groupServiceClient = new GroupServiceClient(); + * try { + * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); + * $response = $groupServiceClient->getGroup($formattedName); + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The group to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Group + * + * @throws ApiException if the remote call fails + */ + public function getGroup($name, array $optionalArgs = []) + { + $request = new GetGroupRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetGroup', Group::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the monitored resources that are members of a group. + * + * Sample code: + * ``` + * $groupServiceClient = new GroupServiceClient(); + * try { + * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); + * // Iterate over pages of elements + * $pagedResponse = $groupServiceClient->listGroupMembers($formattedName); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $groupServiceClient->listGroupMembers($formattedName); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The group whose members are listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * An optional [list + * filter](https://cloud.google.com/monitoring/api/learn_more#filtering) + * describing the members to be returned. The filter may reference the type, + * labels, and metadata of monitored resources that comprise the group. For + * example, to return only resources representing Compute Engine VM instances, + * use this filter: + * + * `resource.type = "gce_instance"` + * @type TimeInterval $interval + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listGroupMembers($name, array $optionalArgs = []) + { + $request = new ListGroupMembersRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['interval'])) { + $request->setInterval($optionalArgs['interval']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListGroupMembers', $optionalArgs, ListGroupMembersResponse::class, $request); + } + + /** + * Lists the existing groups. + * + * Sample code: + * ``` + * $groupServiceClient = new GroupServiceClient(); + * try { + * $name = 'name'; + * // Iterate over pages of elements + * $pagedResponse = $groupServiceClient->listGroups($name); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $groupServiceClient->listGroups($name); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose groups are to be listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. + * + * @type string $childrenOfGroup + * A group name. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Returns groups whose `parent_name` field contains the group + * name. If no groups have this parent, the results are empty. + * @type string $ancestorsOfGroup + * A group name. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Returns groups that are ancestors of the specified group. + * The groups are returned in order, starting with the immediate parent and + * ending with the most distant ancestor. If the specified group has no + * immediate parent, the results are empty. + * @type string $descendantsOfGroup + * A group name. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * + * Returns the descendants of the specified group. This is a superset of + * the results returned by the `children_of_group` filter, and includes + * children-of-children, and so forth. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listGroups($name, array $optionalArgs = []) + { + $request = new ListGroupsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['childrenOfGroup'])) { + $request->setChildrenOfGroup($optionalArgs['childrenOfGroup']); + } + + if (isset($optionalArgs['ancestorsOfGroup'])) { + $request->setAncestorsOfGroup($optionalArgs['ancestorsOfGroup']); + } + + if (isset($optionalArgs['descendantsOfGroup'])) { + $request->setDescendantsOfGroup($optionalArgs['descendantsOfGroup']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListGroups', $optionalArgs, ListGroupsResponse::class, $request); + } + + /** + * Updates an existing group. + * You can change any group attributes except `name`. + * + * Sample code: + * ``` + * $groupServiceClient = new GroupServiceClient(); + * try { + * $group = new Group(); + * $response = $groupServiceClient->updateGroup($group); + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * @param Group $group Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * If true, validate this request but do not update the existing group. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Group + * + * @throws ApiException if the remote call fails + */ + public function updateGroup($group, array $optionalArgs = []) + { + $request = new UpdateGroupRequest(); + $requestParamHeaders = []; + $request->setGroup($group); + $requestParamHeaders['group.name'] = $group->getName(); + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateGroup', Group::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php new file mode 100644 index 00000000000..ff05de43799 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php @@ -0,0 +1,1176 @@ +createMetricDescriptor($name, $metricDescriptor); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class MetricServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.monitoring.v3.MetricService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + 'https://www.googleapis.com/auth/monitoring.write', + ]; + + private static $folderNameTemplate; + + private static $folderMetricDescriptorNameTemplate; + + private static $folderMonitoredResourceDescriptorNameTemplate; + + private static $metricDescriptorNameTemplate; + + private static $monitoredResourceDescriptorNameTemplate; + + private static $organizationNameTemplate; + + private static $organizationMetricDescriptorNameTemplate; + + private static $organizationMonitoredResourceDescriptorNameTemplate; + + private static $projectNameTemplate; + + private static $projectMetricDescriptorNameTemplate; + + private static $projectMonitoredResourceDescriptorNameTemplate; + + private static $workspaceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/metric_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/metric_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/metric_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/metric_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getFolderNameTemplate() + { + if (self::$folderNameTemplate == null) { + self::$folderNameTemplate = new PathTemplate('folders/{folder}'); + } + + return self::$folderNameTemplate; + } + + private static function getFolderMetricDescriptorNameTemplate() + { + if (self::$folderMetricDescriptorNameTemplate == null) { + self::$folderMetricDescriptorNameTemplate = new PathTemplate('folders/{folder}/metricDescriptors/{metric_descriptor=**}'); + } + + return self::$folderMetricDescriptorNameTemplate; + } + + private static function getFolderMonitoredResourceDescriptorNameTemplate() + { + if (self::$folderMonitoredResourceDescriptorNameTemplate == null) { + self::$folderMonitoredResourceDescriptorNameTemplate = new PathTemplate('folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); + } + + return self::$folderMonitoredResourceDescriptorNameTemplate; + } + + private static function getMetricDescriptorNameTemplate() + { + if (self::$metricDescriptorNameTemplate == null) { + self::$metricDescriptorNameTemplate = new PathTemplate('projects/{project}/metricDescriptors/{metric_descriptor=**}'); + } + + return self::$metricDescriptorNameTemplate; + } + + private static function getMonitoredResourceDescriptorNameTemplate() + { + if (self::$monitoredResourceDescriptorNameTemplate == null) { + self::$monitoredResourceDescriptorNameTemplate = new PathTemplate('projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); + } + + return self::$monitoredResourceDescriptorNameTemplate; + } + + private static function getOrganizationNameTemplate() + { + if (self::$organizationNameTemplate == null) { + self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); + } + + return self::$organizationNameTemplate; + } + + private static function getOrganizationMetricDescriptorNameTemplate() + { + if (self::$organizationMetricDescriptorNameTemplate == null) { + self::$organizationMetricDescriptorNameTemplate = new PathTemplate('organizations/{organization}/metricDescriptors/{metric_descriptor=**}'); + } + + return self::$organizationMetricDescriptorNameTemplate; + } + + private static function getOrganizationMonitoredResourceDescriptorNameTemplate() + { + if (self::$organizationMonitoredResourceDescriptorNameTemplate == null) { + self::$organizationMonitoredResourceDescriptorNameTemplate = new PathTemplate('organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); + } + + return self::$organizationMonitoredResourceDescriptorNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectMetricDescriptorNameTemplate() + { + if (self::$projectMetricDescriptorNameTemplate == null) { + self::$projectMetricDescriptorNameTemplate = new PathTemplate('projects/{project}/metricDescriptors/{metric_descriptor=**}'); + } + + return self::$projectMetricDescriptorNameTemplate; + } + + private static function getProjectMonitoredResourceDescriptorNameTemplate() + { + if (self::$projectMonitoredResourceDescriptorNameTemplate == null) { + self::$projectMonitoredResourceDescriptorNameTemplate = new PathTemplate('projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); + } + + return self::$projectMonitoredResourceDescriptorNameTemplate; + } + + private static function getWorkspaceNameTemplate() + { + if (self::$workspaceNameTemplate == null) { + self::$workspaceNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$workspaceNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'folder' => self::getFolderNameTemplate(), + 'folderMetricDescriptor' => self::getFolderMetricDescriptorNameTemplate(), + 'folderMonitoredResourceDescriptor' => self::getFolderMonitoredResourceDescriptorNameTemplate(), + 'metricDescriptor' => self::getMetricDescriptorNameTemplate(), + 'monitoredResourceDescriptor' => self::getMonitoredResourceDescriptorNameTemplate(), + 'organization' => self::getOrganizationNameTemplate(), + 'organizationMetricDescriptor' => self::getOrganizationMetricDescriptorNameTemplate(), + 'organizationMonitoredResourceDescriptor' => self::getOrganizationMonitoredResourceDescriptorNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectMetricDescriptor' => self::getProjectMetricDescriptorNameTemplate(), + 'projectMonitoredResourceDescriptor' => self::getProjectMonitoredResourceDescriptorNameTemplate(), + 'workspace' => self::getWorkspaceNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a folder + * resource. + * + * @param string $folder + * + * @return string The formatted folder resource. + */ + public static function folderName($folder) + { + return self::getFolderNameTemplate()->render([ + 'folder' => $folder, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_metric_descriptor resource. + * + * @param string $folder + * @param string $metricDescriptor + * + * @return string The formatted folder_metric_descriptor resource. + */ + public static function folderMetricDescriptorName($folder, $metricDescriptor) + { + return self::getFolderMetricDescriptorNameTemplate()->render([ + 'folder' => $folder, + 'metric_descriptor' => $metricDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_monitored_resource_descriptor resource. + * + * @param string $folder + * @param string $monitoredResourceDescriptor + * + * @return string The formatted folder_monitored_resource_descriptor resource. + */ + public static function folderMonitoredResourceDescriptorName($folder, $monitoredResourceDescriptor) + { + return self::getFolderMonitoredResourceDescriptorNameTemplate()->render([ + 'folder' => $folder, + 'monitored_resource_descriptor' => $monitoredResourceDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * metric_descriptor resource. + * + * @param string $project + * @param string $metricDescriptor + * + * @return string The formatted metric_descriptor resource. + */ + public static function metricDescriptorName($project, $metricDescriptor) + { + return self::getMetricDescriptorNameTemplate()->render([ + 'project' => $project, + 'metric_descriptor' => $metricDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * monitored_resource_descriptor resource. + * + * @param string $project + * @param string $monitoredResourceDescriptor + * + * @return string The formatted monitored_resource_descriptor resource. + */ + public static function monitoredResourceDescriptorName($project, $monitoredResourceDescriptor) + { + return self::getMonitoredResourceDescriptorNameTemplate()->render([ + 'project' => $project, + 'monitored_resource_descriptor' => $monitoredResourceDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a organization + * resource. + * + * @param string $organization + * + * @return string The formatted organization resource. + */ + public static function organizationName($organization) + { + return self::getOrganizationNameTemplate()->render([ + 'organization' => $organization, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_metric_descriptor resource. + * + * @param string $organization + * @param string $metricDescriptor + * + * @return string The formatted organization_metric_descriptor resource. + */ + public static function organizationMetricDescriptorName($organization, $metricDescriptor) + { + return self::getOrganizationMetricDescriptorNameTemplate()->render([ + 'organization' => $organization, + 'metric_descriptor' => $metricDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_monitored_resource_descriptor resource. + * + * @param string $organization + * @param string $monitoredResourceDescriptor + * + * @return string The formatted organization_monitored_resource_descriptor resource. + */ + public static function organizationMonitoredResourceDescriptorName($organization, $monitoredResourceDescriptor) + { + return self::getOrganizationMonitoredResourceDescriptorNameTemplate()->render([ + 'organization' => $organization, + 'monitored_resource_descriptor' => $monitoredResourceDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName($project) + { + return self::getProjectNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_metric_descriptor resource. + * + * @param string $project + * @param string $metricDescriptor + * + * @return string The formatted project_metric_descriptor resource. + */ + public static function projectMetricDescriptorName($project, $metricDescriptor) + { + return self::getProjectMetricDescriptorNameTemplate()->render([ + 'project' => $project, + 'metric_descriptor' => $metricDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_monitored_resource_descriptor resource. + * + * @param string $project + * @param string $monitoredResourceDescriptor + * + * @return string The formatted project_monitored_resource_descriptor resource. + */ + public static function projectMonitoredResourceDescriptorName($project, $monitoredResourceDescriptor) + { + return self::getProjectMonitoredResourceDescriptorNameTemplate()->render([ + 'project' => $project, + 'monitored_resource_descriptor' => $monitoredResourceDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a workspace + * resource. + * + * @param string $project + * + * @return string The formatted workspace resource. + */ + public static function workspaceName($project) + { + return self::getWorkspaceNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folder: folders/{folder} + * - folderMetricDescriptor: folders/{folder}/metricDescriptors/{metric_descriptor=**} + * - folderMonitoredResourceDescriptor: folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor} + * - metricDescriptor: projects/{project}/metricDescriptors/{metric_descriptor=**} + * - monitoredResourceDescriptor: projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor} + * - organization: organizations/{organization} + * - organizationMetricDescriptor: organizations/{organization}/metricDescriptors/{metric_descriptor=**} + * - organizationMonitoredResourceDescriptor: organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor} + * - project: projects/{project} + * - projectMetricDescriptor: projects/{project}/metricDescriptors/{metric_descriptor=**} + * - projectMonitoredResourceDescriptor: projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor} + * - workspace: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'monitoring.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new metric descriptor. + * The creation is executed asynchronously and callers may check the returned + * operation to track its progress. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $name = 'name'; + * $metricDescriptor = new MetricDescriptor(); + * $response = $metricServiceClient->createMetricDescriptor($name, $metricDescriptor); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * 4 + * projects/[PROJECT_ID_OR_NUMBER] + * @param MetricDescriptor $metricDescriptor Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) + * descriptor. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Api\MetricDescriptor + * + * @throws ApiException if the remote call fails + */ + public function createMetricDescriptor($name, $metricDescriptor, array $optionalArgs = []) + { + $request = new CreateMetricDescriptorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setMetricDescriptor($metricDescriptor); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateMetricDescriptor', MetricDescriptor::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates or adds data to one or more service time series. A service time + * series is a time series for a metric from a Google Cloud service. The + * response is empty if all time series in the request were written. If any + * time series could not be written, a corresponding failure message is + * included in the error response. This endpoint rejects writes to + * user-defined metrics. + * This method is only for use by Google Cloud services. Use + * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + * instead. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->projectName('[PROJECT]'); + * $timeSeries = []; + * $metricServiceClient->createServiceTimeSeries($formattedName, $timeSeries); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param TimeSeries[] $timeSeries Required. The new data to be added to a list of time series. + * Adds at most one data point to each of several time series. The new data + * point must be more recent than any other point in its time series. Each + * `TimeSeries` value must fully specify a unique time series by supplying + * all label values for the metric and the monitored resource. + * + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function createServiceTimeSeries($name, $timeSeries, array $optionalArgs = []) + { + $request = new CreateTimeSeriesRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setTimeSeries($timeSeries); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateServiceTimeSeries', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates or adds data to one or more time series. + * The response is empty if all time series in the request were written. + * If any time series could not be written, a corresponding failure message is + * included in the error response. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->projectName('[PROJECT]'); + * $timeSeries = []; + * $metricServiceClient->createTimeSeries($formattedName, $timeSeries); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param TimeSeries[] $timeSeries Required. The new data to be added to a list of time series. + * Adds at most one data point to each of several time series. The new data + * point must be more recent than any other point in its time series. Each + * `TimeSeries` value must fully specify a unique time series by supplying + * all label values for the metric and the monitored resource. + * + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function createTimeSeries($name, $timeSeries, array $optionalArgs = []) + { + $request = new CreateTimeSeriesRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setTimeSeries($timeSeries); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateTimeSeries', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a metric descriptor. Only user-created + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + * deleted. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + * $metricServiceClient->deleteMetricDescriptor($formattedName); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The metric descriptor on which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * + * An example of `[METRIC_ID]` is: + * `"custom.googleapis.com/my_test_metric"`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteMetricDescriptor($name, array $optionalArgs = []) + { + $request = new DeleteMetricDescriptorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteMetricDescriptor', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single metric descriptor. This method does not require a Workspace. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + * $response = $metricServiceClient->getMetricDescriptor($formattedName); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The metric descriptor on which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + * + * An example value of `[METRIC_ID]` is + * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Api\MetricDescriptor + * + * @throws ApiException if the remote call fails + */ + public function getMetricDescriptor($name, array $optionalArgs = []) + { + $request = new GetMetricDescriptorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetMetricDescriptor', MetricDescriptor::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single monitored resource descriptor. This method does not require a Workspace. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + * $response = $metricServiceClient->getMonitoredResourceDescriptor($formattedName); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The monitored resource descriptor to get. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * + * The `[RESOURCE_TYPE]` is a predefined type, such as + * `cloudsql_database`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Api\MonitoredResourceDescriptor + * + * @throws ApiException if the remote call fails + */ + public function getMonitoredResourceDescriptor($name, array $optionalArgs = []) + { + $request = new GetMonitoredResourceDescriptorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetMonitoredResourceDescriptor', MonitoredResourceDescriptor::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists metric descriptors that match a filter. This method does not require a Workspace. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $name = 'name'; + * // Iterate over pages of elements + * $pagedResponse = $metricServiceClient->listMetricDescriptors($name); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $metricServiceClient->listMetricDescriptors($name); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * + * metric.type = starts_with("custom.googleapis.com/") + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listMetricDescriptors($name, array $optionalArgs = []) + { + $request = new ListMetricDescriptorsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListMetricDescriptors', $optionalArgs, ListMetricDescriptorsResponse::class, $request); + } + + /** + * Lists monitored resource descriptors that match a filter. This method does not require a Workspace. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $name = 'name'; + * // Iterate over pages of elements + * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($name); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($name); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) + * describing the descriptors to be returned. The filter can reference the + * descriptor's type and labels. For example, the following filter returns + * only Google Compute Engine descriptors that have an `id` label: + * + * resource.type = starts_with("gce_") AND resource.label:id + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listMonitoredResourceDescriptors($name, array $optionalArgs = []) + { + $request = new ListMonitoredResourceDescriptorsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListMonitoredResourceDescriptors', $optionalArgs, ListMonitoredResourceDescriptorsResponse::class, $request); + } + + /** + * Lists time series that match a filter. This method does not require a Workspace. + * + * Sample code: + * ``` + * $metricServiceClient = new MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->workspaceName('[PROJECT]'); + * $filter = 'filter'; + * $interval = new TimeInterval(); + * $view = TimeSeriesView::FULL; + * // Iterate over pages of elements + * $pagedResponse = $metricServiceClient->listTimeSeries($formattedName, $filter, $interval, $view); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $metricServiceClient->listTimeSeries($formattedName, $filter, $interval, $view); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * organization or folder on which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * organizations/[ORGANIZATION_ID] + * folders/[FOLDER_ID] + * @param string $filter Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + * that specifies which time series should be returned. The filter must + * specify a single metric type, and can additionally specify metric labels + * and other information. For example: + * + * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * @param TimeInterval $interval Required. The time interval for which results should be returned. Only time series + * that contain data points in the specified interval are included + * in the response. + * @param int $view Required. Specifies which information is returned about the time series. + * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest\TimeSeriesView} + * @param array $optionalArgs { + * Optional. + * + * @type Aggregation $aggregation + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series across specified labels. + * + * By default (if no `aggregation` is explicitly specified), the raw time + * series data is returned. + * @type Aggregation $secondaryAggregation + * Apply a second aggregation after `aggregation` is applied. May only be + * specified if `aggregation` is specified. + * @type string $orderBy + * Unsupported: must be left blank. The points in each time series are + * currently returned in reverse time order (most recent to oldest). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listTimeSeries($name, $filter, $interval, $view, array $optionalArgs = []) + { + $request = new ListTimeSeriesRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setFilter($filter); + $request->setInterval($interval); + $request->setView($view); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['aggregation'])) { + $request->setAggregation($optionalArgs['aggregation']); + } + + if (isset($optionalArgs['secondaryAggregation'])) { + $request->setSecondaryAggregation($optionalArgs['secondaryAggregation']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTimeSeries', $optionalArgs, ListTimeSeriesResponse::class, $request); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php new file mode 100644 index 00000000000..a0947a58b8c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php @@ -0,0 +1,1068 @@ +createNotificationChannel($name, $notificationChannel); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class NotificationChannelServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.monitoring.v3.NotificationChannelService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + + private static $folderChannelDescriptorNameTemplate; + + private static $folderNotificationChannelNameTemplate; + + private static $notificationChannelNameTemplate; + + private static $notificationChannelDescriptorNameTemplate; + + private static $organizationChannelDescriptorNameTemplate; + + private static $organizationNotificationChannelNameTemplate; + + private static $projectChannelDescriptorNameTemplate; + + private static $projectNotificationChannelNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/notification_channel_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/notification_channel_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/notification_channel_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/notification_channel_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getFolderChannelDescriptorNameTemplate() + { + if (self::$folderChannelDescriptorNameTemplate == null) { + self::$folderChannelDescriptorNameTemplate = new PathTemplate('folders/{folder}/notificationChannelDescriptors/{channel_descriptor}'); + } + + return self::$folderChannelDescriptorNameTemplate; + } + + private static function getFolderNotificationChannelNameTemplate() + { + if (self::$folderNotificationChannelNameTemplate == null) { + self::$folderNotificationChannelNameTemplate = new PathTemplate('folders/{folder}/notificationChannels/{notification_channel}'); + } + + return self::$folderNotificationChannelNameTemplate; + } + + private static function getNotificationChannelNameTemplate() + { + if (self::$notificationChannelNameTemplate == null) { + self::$notificationChannelNameTemplate = new PathTemplate('projects/{project}/notificationChannels/{notification_channel}'); + } + + return self::$notificationChannelNameTemplate; + } + + private static function getNotificationChannelDescriptorNameTemplate() + { + if (self::$notificationChannelDescriptorNameTemplate == null) { + self::$notificationChannelDescriptorNameTemplate = new PathTemplate('projects/{project}/notificationChannelDescriptors/{channel_descriptor}'); + } + + return self::$notificationChannelDescriptorNameTemplate; + } + + private static function getOrganizationChannelDescriptorNameTemplate() + { + if (self::$organizationChannelDescriptorNameTemplate == null) { + self::$organizationChannelDescriptorNameTemplate = new PathTemplate('organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}'); + } + + return self::$organizationChannelDescriptorNameTemplate; + } + + private static function getOrganizationNotificationChannelNameTemplate() + { + if (self::$organizationNotificationChannelNameTemplate == null) { + self::$organizationNotificationChannelNameTemplate = new PathTemplate('organizations/{organization}/notificationChannels/{notification_channel}'); + } + + return self::$organizationNotificationChannelNameTemplate; + } + + private static function getProjectChannelDescriptorNameTemplate() + { + if (self::$projectChannelDescriptorNameTemplate == null) { + self::$projectChannelDescriptorNameTemplate = new PathTemplate('projects/{project}/notificationChannelDescriptors/{channel_descriptor}'); + } + + return self::$projectChannelDescriptorNameTemplate; + } + + private static function getProjectNotificationChannelNameTemplate() + { + if (self::$projectNotificationChannelNameTemplate == null) { + self::$projectNotificationChannelNameTemplate = new PathTemplate('projects/{project}/notificationChannels/{notification_channel}'); + } + + return self::$projectNotificationChannelNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'folderChannelDescriptor' => self::getFolderChannelDescriptorNameTemplate(), + 'folderNotificationChannel' => self::getFolderNotificationChannelNameTemplate(), + 'notificationChannel' => self::getNotificationChannelNameTemplate(), + 'notificationChannelDescriptor' => self::getNotificationChannelDescriptorNameTemplate(), + 'organizationChannelDescriptor' => self::getOrganizationChannelDescriptorNameTemplate(), + 'organizationNotificationChannel' => self::getOrganizationNotificationChannelNameTemplate(), + 'projectChannelDescriptor' => self::getProjectChannelDescriptorNameTemplate(), + 'projectNotificationChannel' => self::getProjectNotificationChannelNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_channel_descriptor resource. + * + * @param string $folder + * @param string $channelDescriptor + * + * @return string The formatted folder_channel_descriptor resource. + */ + public static function folderChannelDescriptorName($folder, $channelDescriptor) + { + return self::getFolderChannelDescriptorNameTemplate()->render([ + 'folder' => $folder, + 'channel_descriptor' => $channelDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_notification_channel resource. + * + * @param string $folder + * @param string $notificationChannel + * + * @return string The formatted folder_notification_channel resource. + */ + public static function folderNotificationChannelName($folder, $notificationChannel) + { + return self::getFolderNotificationChannelNameTemplate()->render([ + 'folder' => $folder, + 'notification_channel' => $notificationChannel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * notification_channel resource. + * + * @param string $project + * @param string $notificationChannel + * + * @return string The formatted notification_channel resource. + */ + public static function notificationChannelName($project, $notificationChannel) + { + return self::getNotificationChannelNameTemplate()->render([ + 'project' => $project, + 'notification_channel' => $notificationChannel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * notification_channel_descriptor resource. + * + * @param string $project + * @param string $channelDescriptor + * + * @return string The formatted notification_channel_descriptor resource. + */ + public static function notificationChannelDescriptorName($project, $channelDescriptor) + { + return self::getNotificationChannelDescriptorNameTemplate()->render([ + 'project' => $project, + 'channel_descriptor' => $channelDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_channel_descriptor resource. + * + * @param string $organization + * @param string $channelDescriptor + * + * @return string The formatted organization_channel_descriptor resource. + */ + public static function organizationChannelDescriptorName($organization, $channelDescriptor) + { + return self::getOrganizationChannelDescriptorNameTemplate()->render([ + 'organization' => $organization, + 'channel_descriptor' => $channelDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_notification_channel resource. + * + * @param string $organization + * @param string $notificationChannel + * + * @return string The formatted organization_notification_channel resource. + */ + public static function organizationNotificationChannelName($organization, $notificationChannel) + { + return self::getOrganizationNotificationChannelNameTemplate()->render([ + 'organization' => $organization, + 'notification_channel' => $notificationChannel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_channel_descriptor resource. + * + * @param string $project + * @param string $channelDescriptor + * + * @return string The formatted project_channel_descriptor resource. + */ + public static function projectChannelDescriptorName($project, $channelDescriptor) + { + return self::getProjectChannelDescriptorNameTemplate()->render([ + 'project' => $project, + 'channel_descriptor' => $channelDescriptor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_notification_channel resource. + * + * @param string $project + * @param string $notificationChannel + * + * @return string The formatted project_notification_channel resource. + */ + public static function projectNotificationChannelName($project, $notificationChannel) + { + return self::getProjectNotificationChannelNameTemplate()->render([ + 'project' => $project, + 'notification_channel' => $notificationChannel, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folderChannelDescriptor: folders/{folder}/notificationChannelDescriptors/{channel_descriptor} + * - folderNotificationChannel: folders/{folder}/notificationChannels/{notification_channel} + * - notificationChannel: projects/{project}/notificationChannels/{notification_channel} + * - notificationChannelDescriptor: projects/{project}/notificationChannelDescriptors/{channel_descriptor} + * - organizationChannelDescriptor: organizations/{organization}/notificationChannelDescriptors/{channel_descriptor} + * - organizationNotificationChannel: organizations/{organization}/notificationChannels/{notification_channel} + * - projectChannelDescriptor: projects/{project}/notificationChannelDescriptors/{channel_descriptor} + * - projectNotificationChannel: projects/{project}/notificationChannels/{notification_channel} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'monitoring.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new notification channel, representing a single notification + * endpoint such as an email address, SMS number, or PagerDuty service. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $name = 'name'; + * $notificationChannel = new NotificationChannel(); + * $response = $notificationChannelServiceClient->createNotificationChannel($name, $notificationChannel); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * + * This names the container into which the channel will be + * written, this does not name the newly created channel. The resulting + * channel's name will have a normalized version of this field as a prefix, + * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. + * @param NotificationChannel $notificationChannel Required. The definition of the `NotificationChannel` to create. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\NotificationChannel + * + * @throws ApiException if the remote call fails + */ + public function createNotificationChannel($name, $notificationChannel, array $optionalArgs = []) + { + $request = new CreateNotificationChannelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setNotificationChannel($notificationChannel); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a notification channel. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $notificationChannelServiceClient->deleteNotificationChannel($formattedName); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The channel for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param array $optionalArgs { + * Optional. + * + * @type bool $force + * If true, the notification channel will be deleted regardless of its + * use in alert policies (the policies will be updated to remove the + * channel). If false, channels that are still referenced by an existing + * alerting policy will fail to be deleted in a delete operation. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteNotificationChannel($name, array $optionalArgs = []) + { + $request = new DeleteNotificationChannelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteNotificationChannel', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single notification channel. The channel includes the relevant + * configuration details with which the channel was created. However, the + * response may truncate or omit passwords, API keys, or other private key + * matter and thus the response may not be 100% identical to the information + * that was supplied in the call to the create method. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $response = $notificationChannelServiceClient->getNotificationChannel($formattedName); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The channel for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\NotificationChannel + * + * @throws ApiException if the remote call fails + */ + public function getNotificationChannel($name, array $optionalArgs = []) + { + $request = new GetNotificationChannelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single channel descriptor. The descriptor indicates which fields + * are expected / permitted for a notification channel of the given type. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $formattedName = $notificationChannelServiceClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + * $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($formattedName); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The channel type for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor + * + * @throws ApiException if the remote call fails + */ + public function getNotificationChannelDescriptor($name, array $optionalArgs = []) + { + $request = new GetNotificationChannelDescriptorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetNotificationChannelDescriptor', NotificationChannelDescriptor::class, $optionalArgs, $request)->wait(); + } + + /** + * Requests a verification code for an already verified channel that can then + * be used in a call to VerifyNotificationChannel() on a different channel + * with an equivalent identity in the same or in a different project. This + * makes it possible to copy a channel between projects without requiring + * manual reverification of the channel. If the channel is not in the + * verified state, this method will fail (in other words, this may only be + * used if the SendNotificationChannelVerificationCode and + * VerifyNotificationChannel paths have already been used to put the given + * channel into the verified state). + * + * There is no guarantee that the verification codes returned by this method + * will be of a similar structure or form as the ones that are delivered + * to the channel via SendNotificationChannelVerificationCode; while + * VerifyNotificationChannel() will recognize both the codes delivered via + * SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that + * the verification codes delivered via + * SendNotificationChannelVerificationCode() will be shorter and also + * have a shorter expiration (e.g. codes such as "G-123456") whereas + * GetVerificationCode() will typically return a much longer, websafe base + * 64 encoded string that has a longer expiration time. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($formattedName); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if + * the specified channel is not verified, the request will fail. + * @param array $optionalArgs { + * Optional. + * + * @type Timestamp $expireTime + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be + * valid for at least as long as the requested time (the API puts an upper + * bound on the amount of time for which a code may be valid). If omitted, + * a default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse + * + * @throws ApiException if the remote call fails + */ + public function getNotificationChannelVerificationCode($name, array $optionalArgs = []) + { + $request = new GetNotificationChannelVerificationCodeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['expireTime'])) { + $request->setExpireTime($optionalArgs['expireTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetNotificationChannelVerificationCode', GetNotificationChannelVerificationCodeResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the descriptors for supported channel types. The use of descriptors + * makes it possible for new channel types to be dynamically added. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $name = 'name'; + * // Iterate over pages of elements + * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($name); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($name); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * + * Note that this + * [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent + * container in which to look for the descriptors; to retrieve a single + * descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listNotificationChannelDescriptors($name, array $optionalArgs = []) + { + $request = new ListNotificationChannelDescriptorsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListNotificationChannelDescriptors', $optionalArgs, ListNotificationChannelDescriptorsResponse::class, $request); + } + + /** + * Lists the notification channels that have been created for the project. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $name = 'name'; + * // Iterate over pages of elements + * $pagedResponse = $notificationChannelServiceClient->listNotificationChannels($name); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $notificationChannelServiceClient->listNotificationChannels($name); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * + * This names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type string $orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listNotificationChannels($name, array $optionalArgs = []) + { + $request = new ListNotificationChannelsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListNotificationChannels', $optionalArgs, ListNotificationChannelsResponse::class, $request); + } + + /** + * Causes a verification code to be delivered to the channel. The code + * can then be supplied in `VerifyNotificationChannel` to verify the channel. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $notificationChannelServiceClient->sendNotificationChannelVerificationCode($formattedName); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The notification channel to which to send a verification code. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function sendNotificationChannelVerificationCode($name, array $optionalArgs = []) + { + $request = new SendNotificationChannelVerificationCodeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SendNotificationChannelVerificationCode', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a notification channel. Fields not specified in the field mask + * remain unchanged. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $notificationChannel = new NotificationChannel(); + * $response = $notificationChannelServiceClient->updateNotificationChannel($notificationChannel); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param NotificationChannel $notificationChannel Required. A description of the changes to be applied to the specified + * notification channel. The description must provide a definition for + * fields to be updated; the names of these fields should also be + * included in the `update_mask`. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * The fields to update. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\NotificationChannel + * + * @throws ApiException if the remote call fails + */ + public function updateNotificationChannel($notificationChannel, array $optionalArgs = []) + { + $request = new UpdateNotificationChannelRequest(); + $requestParamHeaders = []; + $request->setNotificationChannel($notificationChannel); + $requestParamHeaders['notification_channel.name'] = $notificationChannel->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); + } + + /** + * Verifies a `NotificationChannel` by proving receipt of the code + * delivered to the channel as a result of calling + * `SendNotificationChannelVerificationCode`. + * + * Sample code: + * ``` + * $notificationChannelServiceClient = new NotificationChannelServiceClient(); + * try { + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $code = 'code'; + * $response = $notificationChannelServiceClient->verifyNotificationChannel($formattedName, $code); + * } finally { + * $notificationChannelServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The notification channel to verify. + * @param string $code Required. The verification code that was delivered to the channel as + * a result of invoking the `SendNotificationChannelVerificationCode` API + * method or that was retrieved from a verified channel via + * `GetNotificationChannelVerificationCode`. For example, one might have + * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only + * guaranteed that the code is valid UTF-8; one should not + * make any assumptions regarding the structure or format of the code). + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\NotificationChannel + * + * @throws ApiException if the remote call fails + */ + public function verifyNotificationChannel($name, $code, array $optionalArgs = []) + { + $request = new VerifyNotificationChannelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setCode($code); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('VerifyNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php new file mode 100644 index 00000000000..b4d099f5da0 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php @@ -0,0 +1,258 @@ +queryTimeSeries($name, $query); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $queryServiceClient->queryTimeSeries($name, $query); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $queryServiceClient->close(); + * } + * ``` + */ +class QueryServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.monitoring.v3.QueryService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/query_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/query_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/query_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/query_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'monitoring.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Queries time series using Monitoring Query Language. This method does not require a Workspace. + * + * Sample code: + * ``` + * $queryServiceClient = new QueryServiceClient(); + * try { + * $name = 'name'; + * $query = 'query'; + * // Iterate over pages of elements + * $pagedResponse = $queryServiceClient->queryTimeSeries($name, $query); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $queryServiceClient->queryTimeSeries($name, $query); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $queryServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on + * which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param string $query Required. The query in the [Monitoring Query + * Language](https://cloud.google.com/monitoring/mql/reference) format. + * The default time zone is in UTC. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function queryTimeSeries($name, $query, array $optionalArgs = []) + { + $request = new QueryTimeSeriesRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setQuery($query); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('QueryTimeSeries', $optionalArgs, QueryTimeSeriesResponse::class, $request); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php new file mode 100644 index 00000000000..a8b1df427af --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php @@ -0,0 +1,1054 @@ +createService($parent, $service); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class ServiceMonitoringServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.monitoring.v3.ServiceMonitoringService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + + private static $folderServiceNameTemplate; + + private static $folderServiceServiceLevelObjectiveNameTemplate; + + private static $organizationServiceNameTemplate; + + private static $organizationServiceServiceLevelObjectiveNameTemplate; + + private static $projectServiceNameTemplate; + + private static $projectServiceServiceLevelObjectiveNameTemplate; + + private static $serviceNameTemplate; + + private static $serviceLevelObjectiveNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/service_monitoring_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/service_monitoring_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/service_monitoring_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/service_monitoring_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getFolderServiceNameTemplate() + { + if (self::$folderServiceNameTemplate == null) { + self::$folderServiceNameTemplate = new PathTemplate('folders/{folder}/services/{service}'); + } + + return self::$folderServiceNameTemplate; + } + + private static function getFolderServiceServiceLevelObjectiveNameTemplate() + { + if (self::$folderServiceServiceLevelObjectiveNameTemplate == null) { + self::$folderServiceServiceLevelObjectiveNameTemplate = new PathTemplate('folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}'); + } + + return self::$folderServiceServiceLevelObjectiveNameTemplate; + } + + private static function getOrganizationServiceNameTemplate() + { + if (self::$organizationServiceNameTemplate == null) { + self::$organizationServiceNameTemplate = new PathTemplate('organizations/{organization}/services/{service}'); + } + + return self::$organizationServiceNameTemplate; + } + + private static function getOrganizationServiceServiceLevelObjectiveNameTemplate() + { + if (self::$organizationServiceServiceLevelObjectiveNameTemplate == null) { + self::$organizationServiceServiceLevelObjectiveNameTemplate = new PathTemplate('organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}'); + } + + return self::$organizationServiceServiceLevelObjectiveNameTemplate; + } + + private static function getProjectServiceNameTemplate() + { + if (self::$projectServiceNameTemplate == null) { + self::$projectServiceNameTemplate = new PathTemplate('projects/{project}/services/{service}'); + } + + return self::$projectServiceNameTemplate; + } + + private static function getProjectServiceServiceLevelObjectiveNameTemplate() + { + if (self::$projectServiceServiceLevelObjectiveNameTemplate == null) { + self::$projectServiceServiceLevelObjectiveNameTemplate = new PathTemplate('projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}'); + } + + return self::$projectServiceServiceLevelObjectiveNameTemplate; + } + + private static function getServiceNameTemplate() + { + if (self::$serviceNameTemplate == null) { + self::$serviceNameTemplate = new PathTemplate('projects/{project}/services/{service}'); + } + + return self::$serviceNameTemplate; + } + + private static function getServiceLevelObjectiveNameTemplate() + { + if (self::$serviceLevelObjectiveNameTemplate == null) { + self::$serviceLevelObjectiveNameTemplate = new PathTemplate('projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}'); + } + + return self::$serviceLevelObjectiveNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'folderService' => self::getFolderServiceNameTemplate(), + 'folderServiceServiceLevelObjective' => self::getFolderServiceServiceLevelObjectiveNameTemplate(), + 'organizationService' => self::getOrganizationServiceNameTemplate(), + 'organizationServiceServiceLevelObjective' => self::getOrganizationServiceServiceLevelObjectiveNameTemplate(), + 'projectService' => self::getProjectServiceNameTemplate(), + 'projectServiceServiceLevelObjective' => self::getProjectServiceServiceLevelObjectiveNameTemplate(), + 'service' => self::getServiceNameTemplate(), + 'serviceLevelObjective' => self::getServiceLevelObjectiveNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_service resource. + * + * @param string $folder + * @param string $service + * + * @return string The formatted folder_service resource. + */ + public static function folderServiceName($folder, $service) + { + return self::getFolderServiceNameTemplate()->render([ + 'folder' => $folder, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_service_service_level_objective resource. + * + * @param string $folder + * @param string $service + * @param string $serviceLevelObjective + * + * @return string The formatted folder_service_service_level_objective resource. + */ + public static function folderServiceServiceLevelObjectiveName($folder, $service, $serviceLevelObjective) + { + return self::getFolderServiceServiceLevelObjectiveNameTemplate()->render([ + 'folder' => $folder, + 'service' => $service, + 'service_level_objective' => $serviceLevelObjective, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_service resource. + * + * @param string $organization + * @param string $service + * + * @return string The formatted organization_service resource. + */ + public static function organizationServiceName($organization, $service) + { + return self::getOrganizationServiceNameTemplate()->render([ + 'organization' => $organization, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_service_service_level_objective resource. + * + * @param string $organization + * @param string $service + * @param string $serviceLevelObjective + * + * @return string The formatted organization_service_service_level_objective resource. + */ + public static function organizationServiceServiceLevelObjectiveName($organization, $service, $serviceLevelObjective) + { + return self::getOrganizationServiceServiceLevelObjectiveNameTemplate()->render([ + 'organization' => $organization, + 'service' => $service, + 'service_level_objective' => $serviceLevelObjective, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_service resource. + * + * @param string $project + * @param string $service + * + * @return string The formatted project_service resource. + */ + public static function projectServiceName($project, $service) + { + return self::getProjectServiceNameTemplate()->render([ + 'project' => $project, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_service_service_level_objective resource. + * + * @param string $project + * @param string $service + * @param string $serviceLevelObjective + * + * @return string The formatted project_service_service_level_objective resource. + */ + public static function projectServiceServiceLevelObjectiveName($project, $service, $serviceLevelObjective) + { + return self::getProjectServiceServiceLevelObjectiveNameTemplate()->render([ + 'project' => $project, + 'service' => $service, + 'service_level_objective' => $serviceLevelObjective, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName($project, $service) + { + return self::getServiceNameTemplate()->render([ + 'project' => $project, + 'service' => $service, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * service_level_objective resource. + * + * @param string $project + * @param string $service + * @param string $serviceLevelObjective + * + * @return string The formatted service_level_objective resource. + */ + public static function serviceLevelObjectiveName($project, $service, $serviceLevelObjective) + { + return self::getServiceLevelObjectiveNameTemplate()->render([ + 'project' => $project, + 'service' => $service, + 'service_level_objective' => $serviceLevelObjective, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folderService: folders/{folder}/services/{service} + * - folderServiceServiceLevelObjective: folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective} + * - organizationService: organizations/{organization}/services/{service} + * - organizationServiceServiceLevelObjective: organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective} + * - projectService: projects/{project}/services/{service} + * - projectServiceServiceLevelObjective: projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective} + * - service: projects/{project}/services/{service} + * - serviceLevelObjective: projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'monitoring.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Create a `Service`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $parent = 'parent'; + * $service = new Service(); + * $response = $serviceMonitoringServiceClient->createService($parent, $service); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param Service $service Required. The `Service` to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $serviceId + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern `[a-z0-9\-]+` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Service + * + * @throws ApiException if the remote call fails + */ + public function createService($parent, $service, array $optionalArgs = []) + { + $request = new CreateServiceRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setService($service); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['serviceId'])) { + $request->setServiceId($optionalArgs['serviceId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $formattedParent = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); + * $serviceLevelObjective = new ServiceLevelObjective(); + * $response = $serviceMonitoringServiceClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Resource name of the parent `Service`. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @param ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * @param array $optionalArgs { + * Optional. + * + * @type string $serviceLevelObjectiveId + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern `[a-z0-9\-]+` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective + * + * @throws ApiException if the remote call fails + */ + public function createServiceLevelObjective($parent, $serviceLevelObjective, array $optionalArgs = []) + { + $request = new CreateServiceLevelObjectiveRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setServiceLevelObjective($serviceLevelObjective); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['serviceLevelObjectiveId'])) { + $request->setServiceLevelObjectiveId($optionalArgs['serviceLevelObjectiveId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateServiceLevelObjective', ServiceLevelObjective::class, $optionalArgs, $request)->wait(); + } + + /** + * Soft delete this `Service`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $formattedName = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); + * $serviceMonitoringServiceClient->deleteService($formattedName); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the `Service` to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteService($name, array $optionalArgs = []) + { + $request = new DeleteServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteService', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Delete the given `ServiceLevelObjective`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + * $serviceMonitoringServiceClient->deleteServiceLevelObjective($formattedName); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteServiceLevelObjective($name, array $optionalArgs = []) + { + $request = new DeleteServiceLevelObjectiveRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteServiceLevelObjective', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Get the named `Service`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $formattedName = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); + * $response = $serviceMonitoringServiceClient->getService($formattedName); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the `Service`. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Service + * + * @throws ApiException if the remote call fails + */ + public function getService($name, array $optionalArgs = []) + { + $request = new GetServiceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Get a `ServiceLevelObjective` by name. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + * $response = $serviceMonitoringServiceClient->getServiceLevelObjective($formattedName); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective + * + * @throws ApiException if the remote call fails + */ + public function getServiceLevelObjective($name, array $optionalArgs = []) + { + $request = new GetServiceLevelObjectiveRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetServiceLevelObjective', ServiceLevelObjective::class, $optionalArgs, $request)->wait(); + } + + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $formattedParent = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); + * // Iterate over pages of elements + * $pagedResponse = $serviceMonitoringServiceClient->listServiceLevelObjectives($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $serviceMonitoringServiceClient->listServiceLevelObjectives($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Workspace. The formats are: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * A filter specifying what `ServiceLevelObjective`s to return. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type int $view + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View} + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listServiceLevelObjectives($parent, array $optionalArgs = []) + { + $request = new ListServiceLevelObjectivesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListServiceLevelObjectives', $optionalArgs, ListServiceLevelObjectivesResponse::class, $request); + } + + /** + * List `Service`s for this workspace. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $serviceMonitoringServiceClient->listServices($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $serviceMonitoringServiceClient->listServices($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Resource name of the parent containing the listed services, either a + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: + * + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) + * + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listServices($parent, array $optionalArgs = []) + { + $request = new ListServicesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); + } + + /** + * Update this `Service`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $service = new Service(); + * $response = $serviceMonitoringServiceClient->updateService($service); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param Service $service Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * A set of field paths defining which fields to use for the update. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Service + * + * @throws ApiException if the remote call fails + */ + public function updateService($service, array $optionalArgs = []) + { + $request = new UpdateServiceRequest(); + $requestParamHeaders = []; + $request->setService($service); + $requestParamHeaders['service.name'] = $service->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateService', Service::class, $optionalArgs, $request)->wait(); + } + + /** + * Update the given `ServiceLevelObjective`. + * + * Sample code: + * ``` + * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + * try { + * $serviceLevelObjective = new ServiceLevelObjective(); + * $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($serviceLevelObjective); + * } finally { + * $serviceMonitoringServiceClient->close(); + * } + * ``` + * + * @param ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * A set of field paths defining which fields to use for the update. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective + * + * @throws ApiException if the remote call fails + */ + public function updateServiceLevelObjective($serviceLevelObjective, array $optionalArgs = []) + { + $request = new UpdateServiceLevelObjectiveRequest(); + $requestParamHeaders = []; + $request->setServiceLevelObjective($serviceLevelObjective); + $requestParamHeaders['service_level_objective.name'] = $serviceLevelObjective->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateServiceLevelObjective', ServiceLevelObjective::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php new file mode 100644 index 00000000000..56fd169abab --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php @@ -0,0 +1,688 @@ +createUptimeCheckConfig($parent, $uptimeCheckConfig); + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class UptimeCheckServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.monitoring.v3.UptimeCheckService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + + private static $folderUptimeCheckConfigNameTemplate; + + private static $organizationUptimeCheckConfigNameTemplate; + + private static $projectUptimeCheckConfigNameTemplate; + + private static $uptimeCheckConfigNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/uptime_check_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/uptime_check_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/uptime_check_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/uptime_check_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getFolderUptimeCheckConfigNameTemplate() + { + if (self::$folderUptimeCheckConfigNameTemplate == null) { + self::$folderUptimeCheckConfigNameTemplate = new PathTemplate('folders/{folder}/uptimeCheckConfigs/{uptime_check_config}'); + } + + return self::$folderUptimeCheckConfigNameTemplate; + } + + private static function getOrganizationUptimeCheckConfigNameTemplate() + { + if (self::$organizationUptimeCheckConfigNameTemplate == null) { + self::$organizationUptimeCheckConfigNameTemplate = new PathTemplate('organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}'); + } + + return self::$organizationUptimeCheckConfigNameTemplate; + } + + private static function getProjectUptimeCheckConfigNameTemplate() + { + if (self::$projectUptimeCheckConfigNameTemplate == null) { + self::$projectUptimeCheckConfigNameTemplate = new PathTemplate('projects/{project}/uptimeCheckConfigs/{uptime_check_config}'); + } + + return self::$projectUptimeCheckConfigNameTemplate; + } + + private static function getUptimeCheckConfigNameTemplate() + { + if (self::$uptimeCheckConfigNameTemplate == null) { + self::$uptimeCheckConfigNameTemplate = new PathTemplate('projects/{project}/uptimeCheckConfigs/{uptime_check_config}'); + } + + return self::$uptimeCheckConfigNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'folderUptimeCheckConfig' => self::getFolderUptimeCheckConfigNameTemplate(), + 'organizationUptimeCheckConfig' => self::getOrganizationUptimeCheckConfigNameTemplate(), + 'projectUptimeCheckConfig' => self::getProjectUptimeCheckConfigNameTemplate(), + 'uptimeCheckConfig' => self::getUptimeCheckConfigNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_uptime_check_config resource. + * + * @param string $folder + * @param string $uptimeCheckConfig + * + * @return string The formatted folder_uptime_check_config resource. + */ + public static function folderUptimeCheckConfigName($folder, $uptimeCheckConfig) + { + return self::getFolderUptimeCheckConfigNameTemplate()->render([ + 'folder' => $folder, + 'uptime_check_config' => $uptimeCheckConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_uptime_check_config resource. + * + * @param string $organization + * @param string $uptimeCheckConfig + * + * @return string The formatted organization_uptime_check_config resource. + */ + public static function organizationUptimeCheckConfigName($organization, $uptimeCheckConfig) + { + return self::getOrganizationUptimeCheckConfigNameTemplate()->render([ + 'organization' => $organization, + 'uptime_check_config' => $uptimeCheckConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_uptime_check_config resource. + * + * @param string $project + * @param string $uptimeCheckConfig + * + * @return string The formatted project_uptime_check_config resource. + */ + public static function projectUptimeCheckConfigName($project, $uptimeCheckConfig) + { + return self::getProjectUptimeCheckConfigNameTemplate()->render([ + 'project' => $project, + 'uptime_check_config' => $uptimeCheckConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * uptime_check_config resource. + * + * @param string $project + * @param string $uptimeCheckConfig + * + * @return string The formatted uptime_check_config resource. + */ + public static function uptimeCheckConfigName($project, $uptimeCheckConfig) + { + return self::getUptimeCheckConfigNameTemplate()->render([ + 'project' => $project, + 'uptime_check_config' => $uptimeCheckConfig, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - folderUptimeCheckConfig: folders/{folder}/uptimeCheckConfigs/{uptime_check_config} + * - organizationUptimeCheckConfig: organizations/{organization}/uptimeCheckConfigs/{uptime_check_config} + * - projectUptimeCheckConfig: projects/{project}/uptimeCheckConfigs/{uptime_check_config} + * - uptimeCheckConfig: projects/{project}/uptimeCheckConfigs/{uptime_check_config} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'monitoring.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new Uptime check configuration. + * + * Sample code: + * ``` + * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); + * try { + * $parent = 'parent'; + * $uptimeCheckConfig = new UptimeCheckConfig(); + * $response = $uptimeCheckServiceClient->createUptimeCheckConfig($parent, $uptimeCheckConfig); + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in + * which to create the Uptime check. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig + * + * @throws ApiException if the remote call fails + */ + public function createUptimeCheckConfig($parent, $uptimeCheckConfig, array $optionalArgs = []) + { + $request = new CreateUptimeCheckConfigRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setUptimeCheckConfig($uptimeCheckConfig); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateUptimeCheckConfig', UptimeCheckConfig::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes an Uptime check configuration. Note that this method will fail + * if the Uptime check configuration is referenced by an alert policy or + * other dependent configs that would be rendered invalid by the deletion. + * + * Sample code: + * ``` + * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); + * try { + * $formattedName = $uptimeCheckServiceClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + * $uptimeCheckServiceClient->deleteUptimeCheckConfig($formattedName); + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The Uptime check configuration to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteUptimeCheckConfig($name, array $optionalArgs = []) + { + $request = new DeleteUptimeCheckConfigRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteUptimeCheckConfig', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single Uptime check configuration. + * + * Sample code: + * ``` + * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); + * try { + * $formattedName = $uptimeCheckServiceClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + * $response = $uptimeCheckServiceClient->getUptimeCheckConfig($formattedName); + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The Uptime check configuration to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig + * + * @throws ApiException if the remote call fails + */ + public function getUptimeCheckConfig($name, array $optionalArgs = []) + { + $request = new GetUptimeCheckConfigRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetUptimeCheckConfig', UptimeCheckConfig::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the existing valid Uptime check configurations for the project + * (leaving out any invalid configurations). + * + * Sample code: + * ``` + * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose Uptime check configurations are listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listUptimeCheckConfigs($parent, array $optionalArgs = []) + { + $request = new ListUptimeCheckConfigsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListUptimeCheckConfigs', $optionalArgs, ListUptimeCheckConfigsResponse::class, $request); + } + + /** + * Returns the list of IP addresses that checkers run from + * + * Sample code: + * ``` + * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckIps(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckIps(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listUptimeCheckIps(array $optionalArgs = []) + { + $request = new ListUptimeCheckIpsRequest(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + return $this->getPagedListResponse('ListUptimeCheckIps', $optionalArgs, ListUptimeCheckIpsResponse::class, $request); + } + + /** + * Updates an Uptime check configuration. You can either replace the entire + * configuration with a new one or replace only certain fields in the current + * configuration by specifying the fields to be updated via `updateMask`. + * Returns the updated configuration. + * + * Sample code: + * ``` + * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); + * try { + * $uptimeCheckConfig = new UptimeCheckConfig(); + * $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($uptimeCheckConfig); + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * @param UptimeCheckConfig $uptimeCheckConfig Required. If an `updateMask` has been specified, this field gives + * the values for the set of fields mentioned in the `updateMask`. If an + * `updateMask` has not been given, this Uptime check configuration replaces + * the current configuration. If a field is mentioned in `updateMask` but + * the corresonding field is omitted in this partial Uptime check + * configuration, it has the effect of deleting/clearing the field from the + * configuration on the server. + * + * The following fields can be updated: `display_name`, + * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and + * `selected_regions`. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. If present, only the listed fields in the current Uptime check + * configuration are updated with values from the new configuration. If this + * field is empty, then the current configuration is completely replaced with + * the new configuration. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig + * + * @throws ApiException if the remote call fails + */ + public function updateUptimeCheckConfig($uptimeCheckConfig, array $optionalArgs = []) + { + $request = new UpdateUptimeCheckConfigRequest(); + $requestParamHeaders = []; + $request->setUptimeCheckConfig($uptimeCheckConfig); + $requestParamHeaders['uptime_check_config.name'] = $uptimeCheckConfig->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateUptimeCheckConfig', UptimeCheckConfig::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php new file mode 100644 index 00000000000..d5c7856e7e8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php @@ -0,0 +1,34 @@ + [ + 'google.monitoring.v3.AlertPolicyService' => [ + 'ListAlertPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAlertPolicies', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php new file mode 100644 index 00000000000..67393699720 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php @@ -0,0 +1,66 @@ + [ + 'google.monitoring.v3.AlertPolicyService' => [ + 'CreateAlertPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/alertPolicies', + 'body' => 'alert_policy', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteAlertPolicy' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/alertPolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAlertPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/alertPolicies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAlertPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/alertPolicies', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAlertPolicy' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{alert_policy.name=projects/*/alertPolicies/*}', + 'body' => 'alert_policy', + 'placeholders' => [ + 'alert_policy.name' => [ + 'getters' => [ + 'getAlertPolicy', + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json new file mode 100644 index 00000000000..3701e6baf28 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json @@ -0,0 +1,86 @@ +{ + "interfaces": { + "google.monitoring.v3.GroupService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "UNAVAILABLE" + ], + "no_retry_2_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 180000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 180000, + "total_timeout_millis": 180000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CreateGroup": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + }, + "DeleteGroup": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGroup": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGroupMembers": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGroups": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateGroup": { + "timeout_millis": 180000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php new file mode 100644 index 00000000000..23b49cfcfbc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php @@ -0,0 +1,28 @@ + [ + 'google.monitoring.v3.GroupService' => [ + 'ListGroupMembers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMembers', + ], + ], + 'ListGroups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGroup', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php new file mode 100644 index 00000000000..1d828ba8b14 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php @@ -0,0 +1,77 @@ + [ + 'google.monitoring.v3.GroupService' => [ + 'CreateGroup' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/groups', + 'body' => 'group', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGroup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/groups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGroup' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/groups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListGroupMembers' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/groups/*}/members', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListGroups' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/groups', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateGroup' => [ + 'method' => 'put', + 'uriTemplate' => '/v3/{group.name=projects/*/groups/*}', + 'body' => 'group', + 'placeholders' => [ + 'group.name' => [ + 'getters' => [ + 'getGroup', + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json new file mode 100644 index 00000000000..37d238c0584 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json @@ -0,0 +1,101 @@ +{ + "interfaces": { + "google.monitoring.v3.MetricService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_3_codes": [], + "retry_policy_7_codes": [ + "UNAVAILABLE" + ], + "retry_policy_8_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_3_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 12000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 12000, + "total_timeout_millis": 12000 + }, + "retry_policy_7_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "retry_policy_8_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 90000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 90000, + "total_timeout_millis": 90000 + } + }, + "methods": { + "CreateMetricDescriptor": { + "timeout_millis": 12000, + "retry_codes_name": "no_retry_3_codes", + "retry_params_name": "no_retry_3_params" + }, + "CreateServiceTimeSeries": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateTimeSeries": { + "timeout_millis": 12000, + "retry_codes_name": "no_retry_3_codes", + "retry_params_name": "no_retry_3_params" + }, + "DeleteMetricDescriptor": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "GetMetricDescriptor": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "GetMonitoredResourceDescriptor": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "ListMetricDescriptors": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "ListMonitoredResourceDescriptors": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_7_codes", + "retry_params_name": "retry_policy_7_params" + }, + "ListTimeSeries": { + "timeout_millis": 90000, + "retry_codes_name": "retry_policy_8_codes", + "retry_params_name": "retry_policy_8_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php new file mode 100644 index 00000000000..e18d6331cf5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php @@ -0,0 +1,38 @@ + [ + 'google.monitoring.v3.MetricService' => [ + 'ListMetricDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMetricDescriptors', + ], + ], + 'ListMonitoredResourceDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResourceDescriptors', + ], + ], + 'ListTimeSeries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTimeSeries', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php new file mode 100644 index 00000000000..c7ed1143106 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php @@ -0,0 +1,135 @@ + [ + 'google.monitoring.v3.MetricService' => [ + 'CreateMetricDescriptor' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/metricDescriptors', + 'body' => 'metric_descriptor', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateServiceTimeSeries' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries:createService', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateTimeSeries' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMetricDescriptor' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/metricDescriptors/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMetricDescriptor' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/metricDescriptors/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMonitoredResourceDescriptor' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/monitoredResourceDescriptors/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListMetricDescriptors' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/metricDescriptors', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListMonitoredResourceDescriptors' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/monitoredResourceDescriptors', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTimeSeries' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=organizations/*}/timeSeries', + 'queryParams' => [ + 'filter', + 'interval', + 'view', + ], + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=folders/*}/timeSeries', + 'queryParams' => [ + 'filter', + 'interval', + 'view', + ], + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'filter', + 'interval', + 'view', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json new file mode 100644 index 00000000000..90437e7f64c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json @@ -0,0 +1,94 @@ +{ + "interfaces": { + "google.monitoring.v3.NotificationChannelService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_3_codes": [ + "UNAVAILABLE" + ], + "no_retry_5_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_3_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "no_retry_5_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CreateNotificationChannel": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" + }, + "DeleteNotificationChannel": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "GetNotificationChannel": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "GetNotificationChannelDescriptor": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "GetNotificationChannelVerificationCode": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "ListNotificationChannelDescriptors": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "ListNotificationChannels": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + }, + "SendNotificationChannelVerificationCode": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" + }, + "UpdateNotificationChannel": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" + }, + "VerifyNotificationChannel": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php new file mode 100644 index 00000000000..022f03a9552 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php @@ -0,0 +1,28 @@ + [ + 'google.monitoring.v3.NotificationChannelService' => [ + 'ListNotificationChannelDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getChannelDescriptors', + ], + ], + 'ListNotificationChannels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNotificationChannels', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php new file mode 100644 index 00000000000..72d0fce4308 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php @@ -0,0 +1,124 @@ + [ + 'google.monitoring.v3.NotificationChannelService' => [ + 'CreateNotificationChannel' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/notificationChannels', + 'body' => 'notification_channel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNotificationChannel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannel' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannelDescriptor' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannelDescriptors/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannelVerificationCode' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}:getVerificationCode', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationChannelDescriptors' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/notificationChannelDescriptors', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationChannels' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/notificationChannels', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SendNotificationChannelVerificationCode' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateNotificationChannel' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{notification_channel.name=projects/*/notificationChannels/*}', + 'body' => 'notification_channel', + 'placeholders' => [ + 'notification_channel.name' => [ + 'getters' => [ + 'getNotificationChannel', + 'getName', + ], + ], + ], + ], + 'VerifyNotificationChannel' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}:verify', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json new file mode 100644 index 00000000000..c20408d0ece --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json @@ -0,0 +1,27 @@ +{ + "interfaces": { + "google.monitoring.v3.QueryService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "QueryTimeSeries": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php new file mode 100644 index 00000000000..12a59d769e4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.monitoring.v3.QueryService' => [ + 'QueryTimeSeries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTimeSeriesData', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php new file mode 100644 index 00000000000..35a51170d71 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php @@ -0,0 +1,20 @@ + [ + 'google.monitoring.v3.QueryService' => [ + 'QueryTimeSeries' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries:query', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json new file mode 100644 index 00000000000..daae71bdd45 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json @@ -0,0 +1,94 @@ +{ + "interfaces": { + "google.monitoring.v3.ServiceMonitoringService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_4_codes": [], + "retry_policy_4_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_4_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "retry_policy_4_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CreateService": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_4_codes", + "retry_params_name": "no_retry_4_params" + }, + "CreateServiceLevelObjective": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_4_codes", + "retry_params_name": "no_retry_4_params" + }, + "DeleteService": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "DeleteServiceLevelObjective": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "GetService": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "GetServiceLevelObjective": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "ListServiceLevelObjectives": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "ListServices": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "UpdateService": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_4_codes", + "retry_params_name": "no_retry_4_params" + }, + "UpdateServiceLevelObjective": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_4_codes", + "retry_params_name": "no_retry_4_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php new file mode 100644 index 00000000000..dec870024e1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php @@ -0,0 +1,28 @@ + [ + 'google.monitoring.v3.ServiceMonitoringService' => [ + 'ListServiceLevelObjectives' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServiceLevelObjectives', + ], + ], + 'ListServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServices', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php new file mode 100644 index 00000000000..cea286539d5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php @@ -0,0 +1,124 @@ + [ + 'google.monitoring.v3.ServiceMonitoringService' => [ + 'CreateService' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=*/*}/services', + 'body' => 'service', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateServiceLevelObjective' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=*/*/services/*}/serviceLevelObjectives', + 'body' => 'service_level_objective', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteService' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=*/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteServiceLevelObjective' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=*/*/services/*/serviceLevelObjectives/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetService' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=*/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetServiceLevelObjective' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=*/*/services/*/serviceLevelObjectives/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListServiceLevelObjectives' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=*/*/services/*}/serviceLevelObjectives', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=*/*}/services', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateService' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{service.name=*/*/services/*}', + 'body' => 'service', + 'placeholders' => [ + 'service.name' => [ + 'getters' => [ + 'getService', + 'getName', + ], + ], + ], + ], + 'UpdateServiceLevelObjective' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}', + 'body' => 'service_level_objective', + 'placeholders' => [ + 'service_level_objective.name' => [ + 'getters' => [ + 'getServiceLevelObjective', + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json new file mode 100644 index 00000000000..4e19af23389 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.monitoring.v3.UptimeCheckService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_5_codes": [ + "UNAVAILABLE" + ], + "no_retry_6_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_5_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + }, + "no_retry_6_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CreateUptimeCheckConfig": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_6_codes", + "retry_params_name": "no_retry_6_params" + }, + "DeleteUptimeCheckConfig": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "GetUptimeCheckConfig": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "ListUptimeCheckConfigs": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "ListUptimeCheckIps": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "UpdateUptimeCheckConfig": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_6_codes", + "retry_params_name": "no_retry_6_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php new file mode 100644 index 00000000000..04c912eeb82 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php @@ -0,0 +1,28 @@ + [ + 'google.monitoring.v3.UptimeCheckService' => [ + 'ListUptimeCheckConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUptimeCheckConfigs', + ], + ], + 'ListUptimeCheckIps' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUptimeCheckIps', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php new file mode 100644 index 00000000000..7e11767438d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.monitoring.v3.UptimeCheckService' => [ + 'CreateUptimeCheckConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=projects/*}/uptimeCheckConfigs', + 'body' => 'uptime_check_config', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteUptimeCheckConfig' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/uptimeCheckConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetUptimeCheckConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/uptimeCheckConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListUptimeCheckConfigs' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=projects/*}/uptimeCheckConfigs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListUptimeCheckIps' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/uptimeCheckIps', + ], + 'UpdateUptimeCheckConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}', + 'body' => 'uptime_check_config', + 'placeholders' => [ + 'uptime_check_config.name' => [ + 'getters' => [ + 'getUptimeCheckConfig', + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php new file mode 100644 index 00000000000..a3c03c59780 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php @@ -0,0 +1,408 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return AlertPolicyServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AlertPolicyServiceClient($options); + } + + /** + * @test + */ + public function createAlertPolicyTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new AlertPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $alertPolicy = new AlertPolicy(); + $response = $client->createAlertPolicy($name, $alertPolicy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getAlertPolicy(); + $this->assertProtobufEquals($alertPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createAlertPolicyExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $alertPolicy = new AlertPolicy(); + try { + $client->createAlertPolicy($name, $alertPolicy); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteAlertPolicyTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $client->deleteAlertPolicy($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteAlertPolicyExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + try { + $client->deleteAlertPolicy($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getAlertPolicyTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new AlertPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $response = $client->getAlertPolicy($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.AlertPolicyService/GetAlertPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getAlertPolicyExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + try { + $client->getAlertPolicy($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listAlertPoliciesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $alertPoliciesElement = new AlertPolicy(); + $alertPolicies = [ + $alertPoliciesElement, + ]; + $expectedResponse = new ListAlertPoliciesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setAlertPolicies($alertPolicies); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $client->listAlertPolicies($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAlertPolicies()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.AlertPolicyService/ListAlertPolicies', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listAlertPoliciesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $client->listAlertPolicies($name); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateAlertPolicyTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new AlertPolicy(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $alertPolicy = new AlertPolicy(); + $response = $client->updateAlertPolicy($alertPolicy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getAlertPolicy(); + $this->assertProtobufEquals($alertPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateAlertPolicyExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $alertPolicy = new AlertPolicy(); + try { + $client->updateAlertPolicy($alertPolicy); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php new file mode 100644 index 00000000000..6cf6c75915a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php @@ -0,0 +1,500 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return GroupServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GroupServiceClient($options); + } + + /** + * @test + */ + public function createGroupTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $parentName = 'parentName1015022848'; + $filter = 'filter-1274492040'; + $isCluster = false; + $expectedResponse = new Group(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setParentName($parentName); + $expectedResponse->setFilter($filter); + $expectedResponse->setIsCluster($isCluster); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $group = new Group(); + $response = $client->createGroup($name, $group); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.GroupService/CreateGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getGroup(); + $this->assertProtobufEquals($group, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createGroupExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $group = new Group(); + try { + $client->createGroup($name, $group); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteGroupTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + $client->deleteGroup($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.GroupService/DeleteGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteGroupExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + try { + $client->deleteGroup($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getGroupTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $parentName = 'parentName1015022848'; + $filter = 'filter-1274492040'; + $isCluster = false; + $expectedResponse = new Group(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setParentName($parentName); + $expectedResponse->setFilter($filter); + $expectedResponse->setIsCluster($isCluster); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + $response = $client->getGroup($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.GroupService/GetGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getGroupExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + try { + $client->getGroup($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listGroupMembersTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $membersElement = new MonitoredResource(); + $members = [ + $membersElement, + ]; + $expectedResponse = new ListGroupMembersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setMembers($members); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + $response = $client->listGroupMembers($formattedName); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMembers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.GroupService/ListGroupMembers', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listGroupMembersExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + try { + $client->listGroupMembers($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listGroupsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $groupElement = new Group(); + $group = [ + $groupElement, + ]; + $expectedResponse = new ListGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGroup($group); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $client->listGroups($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGroup()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.GroupService/ListGroups', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listGroupsExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $client->listGroups($name); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateGroupTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $parentName = 'parentName1015022848'; + $filter = 'filter-1274492040'; + $isCluster = false; + $expectedResponse = new Group(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setParentName($parentName); + $expectedResponse->setFilter($filter); + $expectedResponse->setIsCluster($isCluster); + $transport->addResponse($expectedResponse); + // Mock request + $group = new Group(); + $response = $client->updateGroup($group); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.GroupService/UpdateGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getGroup(); + $this->assertProtobufEquals($group, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateGroupExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $group = new Group(); + try { + $client->updateGroup($group); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php new file mode 100644 index 00000000000..d7676aa13fd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php @@ -0,0 +1,716 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return MetricServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new MetricServiceClient($options); + } + + /** + * @test + */ + public function createMetricDescriptorTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $unit = 'unit3594628'; + $description = 'description-1724546052'; + $displayName = 'displayName1615086568'; + $expectedResponse = new MetricDescriptor(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setUnit($unit); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $metricDescriptor = new MetricDescriptor(); + $response = $client->createMetricDescriptor($name, $metricDescriptor); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/CreateMetricDescriptor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getMetricDescriptor(); + $this->assertProtobufEquals($metricDescriptor, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createMetricDescriptorExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $metricDescriptor = new MetricDescriptor(); + try { + $client->createMetricDescriptor($name, $metricDescriptor); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createServiceTimeSeriesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->projectName('[PROJECT]'); + $timeSeries = []; + $client->createServiceTimeSeries($formattedName, $timeSeries); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/CreateServiceTimeSeries', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getTimeSeries(); + $this->assertProtobufEquals($timeSeries, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createServiceTimeSeriesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->projectName('[PROJECT]'); + $timeSeries = []; + try { + $client->createServiceTimeSeries($formattedName, $timeSeries); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createTimeSeriesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->projectName('[PROJECT]'); + $timeSeries = []; + $client->createTimeSeries($formattedName, $timeSeries); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/CreateTimeSeries', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getTimeSeries(); + $this->assertProtobufEquals($timeSeries, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createTimeSeriesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->projectName('[PROJECT]'); + $timeSeries = []; + try { + $client->createTimeSeries($formattedName, $timeSeries); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteMetricDescriptorTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $client->deleteMetricDescriptor($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/DeleteMetricDescriptor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteMetricDescriptorExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + try { + $client->deleteMetricDescriptor($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getMetricDescriptorTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $unit = 'unit3594628'; + $description = 'description-1724546052'; + $displayName = 'displayName1615086568'; + $expectedResponse = new MetricDescriptor(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setUnit($unit); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $response = $client->getMetricDescriptor($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/GetMetricDescriptor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getMetricDescriptorExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + try { + $client->getMetricDescriptor($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getMonitoredResourceDescriptorTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new MonitoredResourceDescriptor(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $response = $client->getMonitoredResourceDescriptor($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getMonitoredResourceDescriptorExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + try { + $client->getMonitoredResourceDescriptor($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listMetricDescriptorsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $metricDescriptorsElement = new MetricDescriptor(); + $metricDescriptors = [ + $metricDescriptorsElement, + ]; + $expectedResponse = new ListMetricDescriptorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMetricDescriptors($metricDescriptors); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $client->listMetricDescriptors($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMetricDescriptors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/ListMetricDescriptors', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listMetricDescriptorsExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $client->listMetricDescriptors($name); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listMonitoredResourceDescriptorsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resourceDescriptorsElement = new MonitoredResourceDescriptor(); + $resourceDescriptors = [ + $resourceDescriptorsElement, + ]; + $expectedResponse = new ListMonitoredResourceDescriptorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResourceDescriptors($resourceDescriptors); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $client->listMonitoredResourceDescriptors($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResourceDescriptors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listMonitoredResourceDescriptorsExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $client->listMonitoredResourceDescriptors($name); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listTimeSeriesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $unit = 'unit3594628'; + $timeSeriesElement = new TimeSeries(); + $timeSeries = [ + $timeSeriesElement, + ]; + $expectedResponse = new ListTimeSeriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUnit($unit); + $expectedResponse->setTimeSeries($timeSeries); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $response = $client->listTimeSeries($formattedName, $filter, $interval, $view); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTimeSeries()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/ListTimeSeries', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $actualValue = $actualRequestObject->getInterval(); + $this->assertProtobufEquals($interval, $actualValue); + $actualValue = $actualRequestObject->getView(); + $this->assertProtobufEquals($view, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listTimeSeriesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + try { + $client->listTimeSeries($formattedName, $filter, $interval, $view); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php new file mode 100644 index 00000000000..d3d56a96975 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php @@ -0,0 +1,764 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return NotificationChannelServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NotificationChannelServiceClient($options); + } + + /** + * @test + */ + public function createNotificationChannelTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $type = 'type3575610'; + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new NotificationChannel(); + $expectedResponse->setType($type); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $notificationChannel = new NotificationChannel(); + $response = $client->createNotificationChannel($name, $notificationChannel); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getNotificationChannel(); + $this->assertProtobufEquals($notificationChannel, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createNotificationChannelExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $notificationChannel = new NotificationChannel(); + try { + $client->createNotificationChannel($name, $notificationChannel); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteNotificationChannelTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $client->deleteNotificationChannel($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteNotificationChannelExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $client->deleteNotificationChannel($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getNotificationChannelTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $type = 'type3575610'; + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new NotificationChannel(); + $expectedResponse->setType($type); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $client->getNotificationChannel($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getNotificationChannelExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $client->getNotificationChannel($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getNotificationChannelDescriptorTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new NotificationChannelDescriptor(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $response = $client->getNotificationChannelDescriptor($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getNotificationChannelDescriptorExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + try { + $client->getNotificationChannelDescriptor($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getNotificationChannelVerificationCodeTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $code = 'code3059181'; + $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); + $expectedResponse->setCode($code); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $client->getNotificationChannelVerificationCode($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getNotificationChannelVerificationCodeExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $client->getNotificationChannelVerificationCode($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listNotificationChannelDescriptorsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $channelDescriptorsElement = new NotificationChannelDescriptor(); + $channelDescriptors = [ + $channelDescriptorsElement, + ]; + $expectedResponse = new ListNotificationChannelDescriptorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setChannelDescriptors($channelDescriptors); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $client->listNotificationChannelDescriptors($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getChannelDescriptors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listNotificationChannelDescriptorsExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $client->listNotificationChannelDescriptors($name); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listNotificationChannelsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $notificationChannelsElement = new NotificationChannel(); + $notificationChannels = [ + $notificationChannelsElement, + ]; + $expectedResponse = new ListNotificationChannelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setNotificationChannels($notificationChannels); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $client->listNotificationChannels($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNotificationChannels()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannels', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listNotificationChannelsExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $client->listNotificationChannels($name); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function sendNotificationChannelVerificationCodeTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $client->sendNotificationChannelVerificationCode($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function sendNotificationChannelVerificationCodeExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $client->sendNotificationChannelVerificationCode($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateNotificationChannelTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $type = 'type3575610'; + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new NotificationChannel(); + $expectedResponse->setType($type); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $notificationChannel = new NotificationChannel(); + $response = $client->updateNotificationChannel($notificationChannel); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel', $actualFuncCall); + $actualValue = $actualRequestObject->getNotificationChannel(); + $this->assertProtobufEquals($notificationChannel, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateNotificationChannelExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $notificationChannel = new NotificationChannel(); + try { + $client->updateNotificationChannel($notificationChannel); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function verifyNotificationChannelTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $type = 'type3575610'; + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new NotificationChannel(); + $expectedResponse->setType($type); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + $response = $client->verifyNotificationChannel($formattedName, $code); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCode(); + $this->assertProtobufEquals($code, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function verifyNotificationChannelExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + try { + $client->verifyNotificationChannel($formattedName, $code); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php new file mode 100644 index 00000000000..b0becaf179f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php @@ -0,0 +1,145 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return QueryServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new QueryServiceClient($options); + } + + /** + * @test + */ + public function queryTimeSeriesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $timeSeriesDataElement = new TimeSeriesData(); + $timeSeriesData = [ + $timeSeriesDataElement, + ]; + $expectedResponse = new QueryTimeSeriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTimeSeriesData($timeSeriesData); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $query = 'query107944136'; + $response = $client->queryTimeSeries($name, $query); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTimeSeriesData()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.QueryService/QueryTimeSeries', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function queryTimeSeriesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $query = 'query107944136'; + try { + $client->queryTimeSeries($name, $query); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php new file mode 100644 index 00000000000..2830db5ad6c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php @@ -0,0 +1,749 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return ServiceMonitoringServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ServiceMonitoringServiceClient($options); + } + + /** + * @test + */ + public function createServiceTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $service = new Service(); + $response = $client->createService($parent, $service); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/CreateService', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createServiceExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $service = new Service(); + try { + $client->createService($parent, $service); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createServiceLevelObjectiveTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $goal = 317825.0; + $expectedResponse = new ServiceLevelObjective(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setGoal($goal); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $response = $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getServiceLevelObjective(); + $this->assertProtobufEquals($serviceLevelObjective, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createServiceLevelObjectiveExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + try { + $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteServiceTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); + $client->deleteService($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteServiceExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); + try { + $client->deleteService($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteServiceLevelObjectiveTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $client->deleteServiceLevelObjective($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteServiceLevelObjectiveExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + try { + $client->deleteServiceLevelObjective($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getServiceTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); + $response = $client->getService($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getServiceExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); + try { + $client->getService($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getServiceLevelObjectiveTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $goal = 317825.0; + $expectedResponse = new ServiceLevelObjective(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setGoal($goal); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $response = $client->getServiceLevelObjective($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getServiceLevelObjectiveExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + try { + $client->getServiceLevelObjective($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listServiceLevelObjectivesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $serviceLevelObjectivesElement = new ServiceLevelObjective(); + $serviceLevelObjectives = [ + $serviceLevelObjectivesElement, + ]; + $expectedResponse = new ListServiceLevelObjectivesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServiceLevelObjectives($serviceLevelObjectives); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); + $response = $client->listServiceLevelObjectives($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServiceLevelObjectives()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listServiceLevelObjectivesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); + try { + $client->listServiceLevelObjectives($formattedParent); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listServicesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $servicesElement = new Service(); + $services = [ + $servicesElement, + ]; + $expectedResponse = new ListServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServices($services); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $client->listServices($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/ListServices', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listServicesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + try { + $client->listServices($parent); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateServiceTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $service = new Service(); + $response = $client->updateService($service); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateService', $actualFuncCall); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateServiceExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $service = new Service(); + try { + $client->updateService($service); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateServiceLevelObjectiveTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $goal = 317825.0; + $expectedResponse = new ServiceLevelObjective(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setGoal($goal); + $transport->addResponse($expectedResponse); + // Mock request + $serviceLevelObjective = new ServiceLevelObjective(); + $response = $client->updateServiceLevelObjective($serviceLevelObjective); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective', $actualFuncCall); + $actualValue = $actualRequestObject->getServiceLevelObjective(); + $this->assertProtobufEquals($serviceLevelObjective, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateServiceLevelObjectiveExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $serviceLevelObjective = new ServiceLevelObjective(); + try { + $client->updateServiceLevelObjective($serviceLevelObjective); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php new file mode 100644 index 00000000000..f6b02f0203e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php @@ -0,0 +1,482 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return UptimeCheckServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new UptimeCheckServiceClient($options); + } + + /** + * @test + */ + public function createUptimeCheckConfigTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $isInternal = true; + $expectedResponse = new UptimeCheckConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setIsInternal($isInternal); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $uptimeCheckConfig = new UptimeCheckConfig(); + $response = $client->createUptimeCheckConfig($parent, $uptimeCheckConfig); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getUptimeCheckConfig(); + $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createUptimeCheckConfigExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $uptimeCheckConfig = new UptimeCheckConfig(); + try { + $client->createUptimeCheckConfig($parent, $uptimeCheckConfig); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteUptimeCheckConfigTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $client->deleteUptimeCheckConfig($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteUptimeCheckConfigExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + try { + $client->deleteUptimeCheckConfig($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getUptimeCheckConfigTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $isInternal = true; + $expectedResponse = new UptimeCheckConfig(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setIsInternal($isInternal); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $response = $client->getUptimeCheckConfig($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getUptimeCheckConfigExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + try { + $client->getUptimeCheckConfig($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listUptimeCheckConfigsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $uptimeCheckConfigsElement = new UptimeCheckConfig(); + $uptimeCheckConfigs = [ + $uptimeCheckConfigsElement, + ]; + $expectedResponse = new ListUptimeCheckConfigsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setUptimeCheckConfigs($uptimeCheckConfigs); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $client->listUptimeCheckConfigs($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUptimeCheckConfigs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listUptimeCheckConfigsExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + try { + $client->listUptimeCheckConfigs($parent); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listUptimeCheckIpsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $uptimeCheckIpsElement = new UptimeCheckIp(); + $uptimeCheckIps = [ + $uptimeCheckIpsElement, + ]; + $expectedResponse = new ListUptimeCheckIpsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUptimeCheckIps($uptimeCheckIps); + $transport->addResponse($expectedResponse); + $response = $client->listUptimeCheckIps(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUptimeCheckIps()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listUptimeCheckIpsExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $client->listUptimeCheckIps(); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateUptimeCheckConfigTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $isInternal = true; + $expectedResponse = new UptimeCheckConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setIsInternal($isInternal); + $transport->addResponse($expectedResponse); + // Mock request + $uptimeCheckConfig = new UptimeCheckConfig(); + $response = $client->updateUptimeCheckConfig($uptimeCheckConfig); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getUptimeCheckConfig(); + $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateUptimeCheckConfigExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $uptimeCheckConfig = new UptimeCheckConfig(); + try { + $client->updateUptimeCheckConfig($uptimeCheckConfig); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +}