From 12b96a3709dde1681926dd308d384c26923ffc55 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 12 Apr 2024 21:01:18 +0000 Subject: [PATCH 1/4] docs: Various updates PiperOrigin-RevId: 624233552 Source-Link: https://github.com/googleapis/googleapis/commit/1413b13ee1741183772b57481d5f9a99c9bdc129 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fa02723cdbcf0db44ebdfe41858d0fe4100945ad Copy-Tag: eyJwIjoiTW9uaXRvcmluZy8uT3dsQm90LnlhbWwiLCJoIjoiZmEwMjcyM2NkYmNmMGRiNDRlYmRmZTQxODU4ZDBmZTQxMDA5NDVhZCJ9 --- .../Google/Monitoring/V3/Alert.php | Bin 0 -> 5915 bytes .../Google/Monitoring/V3/AlertService.php | 64 + .../Google/Monitoring/V3/Common.php | Bin 0 -> 2532 bytes .../Google/Monitoring/V3/DroppedLabels.php | 33 + .../Google/Monitoring/V3/Group.php | 37 + .../Google/Monitoring/V3/GroupService.php | Bin 0 -> 3723 bytes .../Google/Monitoring/V3/Metric.php | Bin 0 -> 2648 bytes .../Google/Monitoring/V3/MetricService.php | Bin 0 -> 7118 bytes .../Google/Monitoring/V3/MutationRecord.php | 32 + .../Google/Monitoring/V3/Notification.php | Bin 0 -> 2855 bytes .../Monitoring/V3/NotificationService.php | 97 ++ .../Google/Monitoring/V3/QueryService.php | 32 + .../Google/Monitoring/V3/Service.php | Bin 0 -> 4653 bytes .../Google/Monitoring/V3/ServiceService.php | 95 ++ .../Google/Monitoring/V3/Snooze.php | 39 + .../Google/Monitoring/V3/SnoozeService.php | 56 + .../Google/Monitoring/V3/SpanContext.php | 29 + .../Google/Monitoring/V3/Uptime.php | Bin 0 -> 5190 bytes .../Google/Monitoring/V3/UptimeService.php | 72 + .../Cloud/Monitoring/V3/Aggregation.php | 389 ++++++ .../Monitoring/V3/Aggregation/Aligner.php | 269 ++++ .../Monitoring/V3/Aggregation/Reducer.php | 191 +++ .../Cloud/Monitoring/V3/AlertPolicy.php | 805 +++++++++++ .../V3/AlertPolicy/AlertStrategy.php | 167 +++ .../NotificationChannelStrategy.php | 139 ++ .../AlertStrategy/NotificationRateLimit.php | 81 ++ .../Monitoring/V3/AlertPolicy/Condition.php | 373 ++++++ .../Condition/EvaluationMissingData.php | 76 ++ .../V3/AlertPolicy/Condition/LogMatch.php | 151 +++ .../AlertPolicy/Condition/MetricAbsence.php | 304 +++++ .../AlertPolicy/Condition/MetricThreshold.php | 635 +++++++++ .../MetricThreshold/ForecastOptions.php | 101 ++ .../MonitoringQueryLanguageCondition.php | 257 ++++ .../PrometheusQueryLanguageCondition.php | 433 ++++++ .../V3/AlertPolicy/Condition/Trigger.php | 118 ++ .../V3/AlertPolicy/ConditionCombinerType.php | 81 ++ .../V3/AlertPolicy/Documentation.php | 207 +++ .../Monitoring/V3/AlertPolicy/Severity.php | 75 ++ .../Google/Cloud/Monitoring/V3/BasicSli.php | 269 ++++ .../V3/BasicSli/AvailabilityCriteria.php | 36 + .../V3/BasicSli/LatencyCriteria.php | 84 ++ .../Cloud/Monitoring/V3/ComparisonType.php | 90 ++ .../V3/CreateAlertPolicyRequest.php | 188 +++ .../Monitoring/V3/CreateGroupRequest.php | 181 +++ .../V3/CreateMetricDescriptorRequest.php | 151 +++ .../V3/CreateNotificationChannelRequest.php | 163 +++ .../V3/CreateServiceLevelObjectiveRequest.php | 185 +++ .../Monitoring/V3/CreateServiceRequest.php | 180 +++ .../Monitoring/V3/CreateSnoozeRequest.php | 149 +++ .../Monitoring/V3/CreateTimeSeriesError.php | 135 ++ .../Monitoring/V3/CreateTimeSeriesRequest.php | 159 +++ .../Monitoring/V3/CreateTimeSeriesSummary.php | 135 ++ .../V3/CreateTimeSeriesSummary/Error.php | 114 ++ .../V3/CreateUptimeCheckConfigRequest.php | 142 ++ .../V3/DeleteAlertPolicyRequest.php | 93 ++ .../Monitoring/V3/DeleteGroupRequest.php | 130 ++ .../V3/DeleteMetricDescriptorRequest.php | 103 ++ .../V3/DeleteNotificationChannelRequest.php | 138 ++ .../V3/DeleteServiceLevelObjectiveRequest.php | 92 ++ .../Monitoring/V3/DeleteServiceRequest.php | 87 ++ .../V3/DeleteUptimeCheckConfigRequest.php | 87 ++ .../Cloud/Monitoring/V3/DistributionCut.php | 127 ++ .../Cloud/Monitoring/V3/DroppedLabels.php | 80 ++ .../Monitoring/V3/GetAlertPolicyRequest.php | 87 ++ .../Cloud/Monitoring/V3/GetGroupRequest.php | 87 ++ .../V3/GetMetricDescriptorRequest.php | 103 ++ .../GetMonitoredResourceDescriptorRequest.php | 98 ++ ...etNotificationChannelDescriptorRequest.php | 87 ++ .../V3/GetNotificationChannelRequest.php | 87 ++ ...ficationChannelVerificationCodeRequest.php | 167 +++ ...icationChannelVerificationCodeResponse.php | 131 ++ .../V3/GetServiceLevelObjectiveRequest.php | 138 ++ .../Cloud/Monitoring/V3/GetServiceRequest.php | 87 ++ .../Cloud/Monitoring/V3/GetSnoozeRequest.php | 88 ++ .../V3/GetUptimeCheckConfigRequest.php | 87 ++ .../src/Google/Cloud/Monitoring/V3/Group.php | 257 ++++ .../Cloud/Monitoring/V3/GroupResourceType.php | 66 + .../Cloud/Monitoring/V3/InternalChecker.php | 271 ++++ .../Monitoring/V3/InternalChecker/State.php | 74 ++ .../Google/Cloud/Monitoring/V3/LabelValue.php | 141 ++ .../V3/ListAlertPoliciesRequest.php | 294 ++++ .../V3/ListAlertPoliciesResponse.php | 147 ++ .../Monitoring/V3/ListGroupMembersRequest.php | 277 ++++ .../V3/ListGroupMembersResponse.php | 143 ++ .../Cloud/Monitoring/V3/ListGroupsRequest.php | 316 +++++ .../Monitoring/V3/ListGroupsResponse.php | 109 ++ .../V3/ListMetricDescriptorsRequest.php | 238 ++++ .../V3/ListMetricDescriptorsResponse.php | 113 ++ ...istMonitoredResourceDescriptorsRequest.php | 222 ++++ ...stMonitoredResourceDescriptorsResponse.php | 113 ++ ...tNotificationChannelDescriptorsRequest.php | 206 +++ ...NotificationChannelDescriptorsResponse.php | 117 ++ .../V3/ListNotificationChannelsRequest.php | 307 +++++ .../V3/ListNotificationChannelsResponse.php | 151 +++ .../V3/ListServiceLevelObjectivesRequest.php | 257 ++++ .../V3/ListServiceLevelObjectivesResponse.php | 109 ++ .../Monitoring/V3/ListServicesRequest.php | 275 ++++ .../Monitoring/V3/ListServicesResponse.php | 109 ++ .../Monitoring/V3/ListSnoozesRequest.php | 252 ++++ .../Monitoring/V3/ListSnoozesResponse.php | 106 ++ .../Monitoring/V3/ListTimeSeriesRequest.php | 501 +++++++ .../ListTimeSeriesRequest/TimeSeriesView.php | 59 + .../Monitoring/V3/ListTimeSeriesResponse.php | 201 +++ .../V3/ListUptimeCheckConfigsRequest.php | 230 ++++ .../V3/ListUptimeCheckConfigsResponse.php | 155 +++ .../V3/ListUptimeCheckIpsRequest.php | 129 ++ .../V3/ListUptimeCheckIpsResponse.php | 125 ++ .../Cloud/Monitoring/V3/MutationRecord.php | 111 ++ .../Monitoring/V3/NotificationChannel.php | 594 +++++++++ .../VerificationStatus.php | 76 ++ .../V3/NotificationChannelDescriptor.php | 326 +++++ .../src/Google/Cloud/Monitoring/V3/Point.php | 153 +++ .../Google/Cloud/Monitoring/V3/QueryError.php | 115 ++ .../Cloud/Monitoring/V3/QueryErrorList.php | 105 ++ .../Monitoring/V3/QueryTimeSeriesRequest.php | 197 +++ .../Monitoring/V3/QueryTimeSeriesResponse.php | 195 +++ .../src/Google/Cloud/Monitoring/V3/Range.php | 101 ++ .../Cloud/Monitoring/V3/RequestBasedSli.php | 121 ++ ...ficationChannelVerificationCodeRequest.php | 81 ++ .../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 + .../Cloud/Monitoring/V3/ServiceTier.php | 74 ++ .../src/Google/Cloud/Monitoring/V3/Snooze.php | 224 ++++ .../Cloud/Monitoring/V3/Snooze/Criteria.php | 88 ++ .../Cloud/Monitoring/V3/SpanContext.php | 91 ++ .../Cloud/Monitoring/V3/TextLocator.php | 303 +++++ .../Monitoring/V3/TextLocator/Position.php | 108 ++ .../Cloud/Monitoring/V3/TimeInterval.php | 165 +++ .../Google/Cloud/Monitoring/V3/TimeSeries.php | 404 ++++++ .../Cloud/Monitoring/V3/TimeSeriesData.php | 114 ++ .../V3/TimeSeriesData/PointData.php | 116 ++ .../Monitoring/V3/TimeSeriesDescriptor.php | 101 ++ .../TimeSeriesDescriptor/ValueDescriptor.php | 184 +++ .../Cloud/Monitoring/V3/TimeSeriesRatio.php | 180 +++ .../Google/Cloud/Monitoring/V3/TypedValue.php | 213 +++ .../V3/UpdateAlertPolicyRequest.php | 239 ++++ .../Monitoring/V3/UpdateGroupRequest.php | 134 ++ .../V3/UpdateNotificationChannelRequest.php | 151 +++ .../V3/UpdateServiceLevelObjectiveRequest.php | 139 ++ .../Monitoring/V3/UpdateServiceRequest.php | 139 ++ .../Monitoring/V3/UpdateSnoozeRequest.php | 227 ++++ .../V3/UpdateUptimeCheckConfigRequest.php | 192 +++ .../Cloud/Monitoring/V3/UptimeCheckConfig.php | 711 ++++++++++ .../V3/UptimeCheckConfig/CheckerType.php | 69 + .../V3/UptimeCheckConfig/ContentMatcher.php | 158 +++ .../ContentMatcher/ContentMatcherOption.php | 107 ++ .../ContentMatcher/JsonPathMatcher.php | 114 ++ .../JsonPathMatcher/JsonPathMatcherOption.php | 68 + .../V3/UptimeCheckConfig/HttpCheck.php | 678 ++++++++++ .../HttpCheck/BasicAuthentication.php | 107 ++ .../HttpCheck/ContentType.php | 67 + .../HttpCheck/RequestMethod.php | 64 + .../HttpCheck/ResponseStatusCode.php | 112 ++ .../ResponseStatusCode/StatusClass.php | 92 ++ .../V3/UptimeCheckConfig/PingConfig.php | 72 + .../V3/UptimeCheckConfig/ResourceGroup.php | 113 ++ .../V3/UptimeCheckConfig/TcpCheck.php | 122 ++ .../Cloud/Monitoring/V3/UptimeCheckIp.php | 160 +++ .../Cloud/Monitoring/V3/UptimeCheckRegion.php | 102 ++ .../V3/VerifyNotificationChannelRequest.php | 147 ++ .../Cloud/Monitoring/V3/WindowsBasedSli.php | 236 ++++ .../V3/WindowsBasedSli/MetricRange.php | 125 ++ .../WindowsBasedSli/PerformanceThreshold.php | 146 ++ .../create_alert_policy.php | 88 ++ .../delete_alert_policy.php | 77 ++ .../get_alert_policy.php | 73 + .../list_alert_policies.php | 85 ++ .../update_alert_policy.php | 66 + .../V3/GroupServiceClient/create_group.php | 76 ++ .../V3/GroupServiceClient/delete_group.php | 71 + .../V3/GroupServiceClient/get_group.php | 73 + .../GroupServiceClient/list_group_members.php | 78 ++ .../V3/GroupServiceClient/list_groups.php | 79 ++ .../V3/GroupServiceClient/update_group.php | 60 + .../create_metric_descriptor.php | 81 ++ .../create_service_time_series.php | 84 ++ .../create_time_series.php | 82 ++ .../delete_metric_descriptor.php | 77 ++ .../get_metric_descriptor.php | 77 ++ .../get_monitored_resource_descriptor.php | 79 ++ .../list_metric_descriptors.php | 79 ++ .../list_monitored_resource_descriptors.php | 79 ++ .../MetricServiceClient/list_time_series.php | 99 ++ .../create_notification_channel.php | 87 ++ .../delete_notification_channel.php | 79 ++ .../get_notification_channel.php | 80 ++ .../get_notification_channel_descriptor.php | 77 ++ ...notification_channel_verification_code.php | 96 ++ .../list_notification_channel_descriptors.php | 86 ++ .../list_notification_channels.php | 88 ++ ...notification_channel_verification_code.php | 73 + .../update_notification_channel.php | 65 + .../verify_notification_channel.php | 85 ++ .../QueryServiceClient/query_time_series.php | 84 ++ .../create_service.php | 76 ++ .../create_service_level_objective.php | 75 ++ .../delete_service.php | 71 + .../delete_service_level_objective.php | 76 ++ .../get_service.php | 73 + .../get_service_level_objective.php | 78 ++ .../list_service_level_objectives.php | 80 ++ .../list_services.php | 80 ++ .../update_service.php | 59 + .../update_service_level_objective.php | 59 + .../V3/SnoozeServiceClient/create_snooze.php | 99 ++ .../V3/SnoozeServiceClient/get_snooze.php | 73 + .../V3/SnoozeServiceClient/list_snoozes.php | 81 ++ .../V3/SnoozeServiceClient/update_snooze.php | 90 ++ .../create_uptime_check_config.php | 76 ++ .../delete_uptime_check_config.php | 76 ++ .../get_uptime_check_config.php | 76 ++ .../list_uptime_check_configs.php | 80 ++ .../list_uptime_check_ips.php | 62 + .../update_uptime_check_config.php | 62 + .../v3/src/V3/AlertPolicyServiceClient.php | 34 + .../V3/Client/AlertPolicyServiceClient.php | 507 +++++++ .../v3/src/V3/Client/GroupServiceClient.php | 444 +++++++ .../v3/src/V3/Client/MetricServiceClient.php | 675 ++++++++++ .../NotificationChannelServiceClient.php | 679 ++++++++++ .../v3/src/V3/Client/QueryServiceClient.php | 193 +++ .../Client/ServiceMonitoringServiceClient.php | 635 +++++++++ .../v3/src/V3/Client/SnoozeServiceClient.php | 434 ++++++ .../V3/Client/UptimeCheckServiceClient.php | 451 +++++++ .../Gapic/AlertPolicyServiceGapicClient.php | 806 +++++++++++ .../src/V3/Gapic/GroupServiceGapicClient.php | 752 +++++++++++ .../src/V3/Gapic/MetricServiceGapicClient.php | 1178 +++++++++++++++++ .../NotificationChannelServiceGapicClient.php | 1075 +++++++++++++++ .../src/V3/Gapic/QueryServiceGapicClient.php | 256 ++++ .../ServiceMonitoringServiceGapicClient.php | 1044 +++++++++++++++ .../src/V3/Gapic/SnoozeServiceGapicClient.php | 680 ++++++++++ .../Gapic/UptimeCheckServiceGapicClient.php | 692 ++++++++++ .../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/SnoozeServiceClient.php | 34 + .../v3/src/V3/UptimeCheckServiceClient.php | 34 + .../Monitoring/v3/src/V3/gapic_metadata.json | 336 +++++ .../alert_policy_service_client_config.json | 69 + ...alert_policy_service_descriptor_config.php | 87 ++ ...lert_policy_service_rest_client_config.php | 67 + .../group_service_client_config.json | 86 ++ .../group_service_descriptor_config.php | 103 ++ .../group_service_rest_client_config.php | 78 ++ .../metric_service_client_config.json | 101 ++ .../metric_service_descriptor_config.php | 154 +++ .../metric_service_rest_client_config.php | 136 ++ ...ication_channel_service_client_config.json | 94 ++ ...tion_channel_service_descriptor_config.php | 155 +++ ...ion_channel_service_rest_client_config.php | 125 ++ .../query_service_client_config.json | 27 + .../query_service_descriptor_config.php | 28 + .../query_service_rest_client_config.php | 21 + ...vice_monitoring_service_client_config.json | 94 ++ ...e_monitoring_service_descriptor_config.php | 156 +++ ..._monitoring_service_rest_client_config.php | 125 ++ .../snooze_service_client_config.json | 64 + .../snooze_service_descriptor_config.php | 74 ++ .../snooze_service_rest_client_config.php | 59 + .../uptime_check_service_client_config.json | 74 ++ ...uptime_check_service_descriptor_config.php | 95 ++ ...ptime_check_service_rest_client_config.php | 71 + .../Unit/V3/AlertPolicyServiceClientTest.php | 380 ++++++ .../Client/AlertPolicyServiceClientTest.php | 442 +++++++ .../Unit/V3/Client/GroupServiceClientTest.php | 541 ++++++++ .../V3/Client/MetricServiceClientTest.php | 769 +++++++++++ .../NotificationChannelServiceClientTest.php | 809 +++++++++++ .../Unit/V3/Client/QueryServiceClientTest.php | 182 +++ .../ServiceMonitoringServiceClientTest.php | 790 +++++++++++ .../V3/Client/SnoozeServiceClientTest.php | 426 ++++++ .../Client/UptimeCheckServiceClientTest.php | 517 ++++++++ .../tests/Unit/V3/GroupServiceClientTest.php | 468 +++++++ .../tests/Unit/V3/MetricServiceClientTest.php | 672 ++++++++++ .../NotificationChannelServiceClientTest.php | 716 ++++++++++ .../tests/Unit/V3/QueryServiceClientTest.php | 134 ++ .../V3/ServiceMonitoringServiceClientTest.php | 701 ++++++++++ .../tests/Unit/V3/SnoozeServiceClientTest.php | 359 +++++ .../Unit/V3/UptimeCheckServiceClientTest.php | 450 +++++++ 288 files changed, 52726 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/Snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.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/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/NotificationChannelStrategy.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/EvaluationMissingData.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/MetricThreshold/ForecastOptions.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/PrometheusQueryLanguageCondition.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/AlertPolicy/Severity.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/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/CreateSnoozeRequest.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/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/GetSnoozeRequest.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/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/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/ListSnoozesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.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/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/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/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/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/ServiceTier.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.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/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/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/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/UpdateSnoozeRequest.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/CheckerType.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/ContentMatcher/JsonPathMatcher.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.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/HttpCheck/ResponseStatusCode.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.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/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/samples/V3/AlertPolicyServiceClient/create_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/AlertPolicyServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.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/SnoozeServiceGapicClient.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/SnoozeServiceClient.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/snooze_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_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/Client/AlertPolicyServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.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/SnoozeServiceClientTest.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..611022bae32b07a433dbc0ce39a6519f97b2cf48 GIT binary patch literal 5915 zcmcgwO>-Mb8II)m>y^LKw(+c}q$W-vPIe=)^1|-Qge_T;9kI4#WZ7Z2R5djkwd8@( z%rGBb6qoPZse&6nfGYk0R}OI6+g>?v%AMlM+ubvxkt0P`iXxZD)BQgE@jlPfZ}(5X zurF+QBp*_fI;uz8a;qZxtjQ=5l8u6Z2A zHP3hV05n5&UAe&G;R`>2l%soDD25=qyYL3{af~_|XbZWHs>4kc! zTTVVdSk(YzTxgvJ`MPz~P-2=ztA`oB{g}hi$39D*W!9-?Iqln{L@6ox$WjD&kI+|+ zYTMLtZy#E>wdN^K*dG(aiSzttdO(vxyB)FO0JX9c<&kCe3Ho>scqrpiou%;Yi(~ToEDY@@!<6UXTmL;mHX4J_!19$)X6d?O?~pwSNw8O~*1_X^F#pI2ooG#*hjuU}jo6nyoa4Ygx&CIz>2YkB2t;HYFdzJT=vp zLEF+jzANbvDNJ2vAFb(JHGE1Q!@?!{B+k4q5#F1Gy)jW4L2_~*HciXZJG#a-rf3(c zX|fGl!IdtO7qF^1R5S_BNWifkhgd_T%?yj3h2Nl@l$s*^5LWnMqPQMAsJeY=lSkiz z44fFJK^Q5(f=e%{!}j8P2(glTHhTVXKAi>;`!oM6B+?aF9wyi-%p);8sM6sq!}D`Q9%7?6BY;j2t~2PI=m$c#+XI&HLOP@RJ;qcgA2=O z^KnzTy~#_7M$6z4?C4q}gm`&}oWa@vTWz^)L2UM^+~?B+7g)STIqc>Dwx@d91#K&a z)s;3l_9xR|A6eaFhJdhF@F)fw8K&|ZpE`XMyV>>CE|u2#AV<>-GB~w*xj+I)bK*l}Yj`EUDeDL%Uq68XT2cb!MNZrzNb$Cz0pPX+P+03&=sv3JDV7}?F=ObLV`j%HNO9(5qWs;Ye&!&+ ztO-c+8FTuctvb4EnbKXH|4MF*&7ms?{kSi0!D=K*1x?qd(kzB2(6AT6vy^*(D)&J+ zm; zPhexzcanmcU(E9(mp5%rEHo&9 znB>ib3~hy=>yKi}pTs&Aksy1p9uqFVU|?c+-7rZ+3DSc(&LX7YbbzA5}Z3GwTRxUk^$&CTGsl8xDR$7rfi$Bw$m9snFCveZfdJZpzeSB@hDv{aHBo9k}468S<&J)g=Z51{nB@Eqj zw_v?kJKnEU%QqxF4>N^o2~|4>$y$9aNghBNKPay%jhD)Cp;3Ivyr5n_t)112<+YjZ zpTk0UjUy6loR-ha^-ANb8?Z~TP{hxbV&Mp}7h$$suXFem%)ctss|bn`|9j$1;cp4} zL97}ZFL9EcQrYD5xMopy@ju@!KJt7jtr8R^u0ujo8Y!)P;FQHv!Lv>hUl&j@emm^R zoUCibUwqNv@X_}&7yD+n_6D0|xBi?=AMyv^Op!wkYKzSI?mxoDW|OxzEgy-|;yRA9gXwTYx61}{AB;H$N&$DBnW_eHXfO-wr0RIIC{HG)U 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..8dcca57c07d --- /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ÚAname‚Óä“%#/v3/{name=projects/*}/alertPolicies– +GetAlertPolicy+.google.monitoring.v3.GetAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"4ÚAname‚Óä“\'%/v3/{name=projects/*/alertPolicies/*}µ +CreateAlertPolicy..google.monitoring.v3.CreateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"MÚAname,alert_policy‚Óä“3"#/v3/{name=projects/*}/alertPolicies: alert_policy‘ +DeleteAlertPolicy..google.monitoring.v3.DeleteAlertPolicyRequest.google.protobuf.Empty"4ÚAname‚Óä“\'*%/v3/{name=projects/*/alertPolicies/*}Ë +UpdateAlertPolicy..google.monitoring.v3.UpdateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"cÚAupdate_mask,alert_policy‚Óä“B22/v3/{alert_policy.name=projects/*/alertPolicies/*}: 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.v3BAlertServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..2164fb3c8760677a8795493e23bb7537bf54f102 GIT binary patch literal 2532 zcmbVO*>2lL6tyI;BQG@LB&yM6;s%Huq;z1_0YcX;XlX1HkSLX+g`f~XP~=D!)pUy6{qrsjG(!utQ9Cvqb!Ud7VdE4b-O_v?H)99rCxqe8 z4ab(LV?WRW_<3&nstLhN%`$(4%+K&dvwRAs4|OM@tp}!K$HA|6Q7apbJu}N z&v2GXKPnyyABlEAJzKLzE$Zu@=|W+BQ04h44Q7-@Nc}Jk8@V$lxSr(5^AD0d!+{sl zVswl>8ibyG8s{B3xSRbqT0oTGnxmHK2c9_&qnda=FDm!3$Z}R!D}-kMKU2ko9tPUA zyEtr2L2{JhN{AJ>d|RD zCu{>TaLcClHMIlPrJm^+F+vfg_xWW z1*9I^Mti#F_N%mSj&Ie8NiD;#t>8+1r>MP7 zi^$9}yM;Cqv@1#sDjbD(Of`4iC4$6k=CPZ-D@kFta{a+om)T|+w3&DtD6JM5GCO(H z*g{q0E5a~&iV1olbOwZ}0UwVN^9xyMDq>Gc^mlVXpU6!jDPo7HZ{ITPV!;XXXrbWb zHM6%+@cM*#%+}Ce5w&7FhYM$vkcJ!#R`{+rt*X;|kIDpPxNrOIViWeej!B7JU z1zB5xvAzdIlRXc06kzinL=r*^zR35?$~`T(MyoG1R2@+7#?+}|!kzvU)doZ!iqKd^ zB=WuVfaf{sxiAo$kRvcNhxcXD6``x;{c^2z{znPbVBc8yu$)(uMI!zJ_Deqqy5)pM zrV3U^Q>VDPz)K9<%gu2CbH}IoTjh>Fl=s{5;=(m!SNZzF4I6)E!qF&}j*8n2tT%s^ sKTC{xK9=)*ZqD<=#&|V;!y7MVpUYRt+ECasKDuGVn#m$?hwc#i8&pH#s{jB1 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..f7e45d86002 --- /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.v3BDroppedLabelsProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..999b703bd1a --- /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 +GroupProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..a03455b22eaefbdb97cd6bc07b10a02c337b4ce1 GIT binary patch literal 3723 zcmb_fL2nyH6vj@IIuoE|)DqXF?Zi!q8-E@PSnn>o zV~0?M12+UhLcQ=4fd9Z9Rh;0K69-QG1Wvq}on5aTJGLcqakTT^oA15%y>DjTe%EVx z=nkn+hx!Jiby7PatVN0EyUaCRo76gu2K9;Qwmr+HzCy_EK6!utkUZFZe7Fp*f!py- zs*sLyN<8*DRCt^Z!Z7G5BJk&RYPMyPfEf&aR;-|E!OoUpTVFyN+oWOG0fhkP zZ5tiOWR~j??y&Eev~Z7vF}dxE=R(@sBm#86D*;u|A3Kctj$!M&G%$V3gDelgR8^al z#r5M~3isr;Je<`ag%G2vo&&i}nBSqv-3jq2>-f%=z|8}k#{cO<%B6Xht~rj&tKd3; zs`hf~g&5_yV_Vc=)A>BKs9i79meI9be>zv$T3UZXC26KYJH1yQm-HRC4dk30a=*7= z;N;FRYoKQj+8#R@?kdQ(@s1^_rPb>(lODpj72@7=Caj`wuc5-EbB3>mmI@>-CsOH_ za!blio-i6%T9!*aJX|3_Sm1;7 zzCc8z#SIxmNC`}3k@Dh(i}~NuXz@KOV4_#S6Z(0F1`OXvm$>3&FOyVZzO1kQrKSJX zmhtT#4kZi zjG3uo?4ql65FF~%4TmM7T$(D%BAWM%Cangbj@emooy8a-@rk*gQ71bm!e!80!?Ho= z@*g3bEM?$Tv($h-1wFkqx3k?i_fU7F<;%jADep{2O{d$e7n{+MwZ z+bX_IkAWQHAOl6S@XHYc1xx4gnqY3Xv*^&$;}DAHEeUaH=w}Zr_e%TVDX476DAX(cZ*Zof?Alu6AciSH+QRKTxa%%h^5;M~ut=i2oI zqW+Wo5AB;&i!m=yi^b#PV+kof=Zy|)!6nG;)HgiaU=7!Aua7hD?KOp|0!LK6{Cf&z z;d(K&Fy+OhYKYt8LF!{ofQuaX)uibrUs#X{%zAe-@y)Ak^&on+U(&gXcvvYrJkLnp z;CZGTm7Yh7x-M4rU;czDug=QK>d3cvf1Cuc_LQ7pZ)U!4W_IWPH^IvQZjeLjQEo-l zA)_-Ay`&`Ie&pM}OGfc{OgXXrX~0~{bwUn~$q&Z^^6=pCU>l*KA9I@;Wa9f1m$s+A z$0DCIZ_+;Pwx=}W%+{qh0MDAzFtBV&4*R_$8d;7NS>~YxnnyFBdD7hluw5$*30k28 z_!$U(f_UUIn}m@S;nz(T4jBexmdk#^%=gIHazl#Hw{6FIOVXtXh%0$oFQ9tcAK1zUAz~)-B zaU=gCB|YQ`Yt_Gv#bI$WFo-f~dQj^7$V9sXWl8ANa_a?BXjMB+eNjsKfK91vGqlv& zP{Oa6){7ECmO#z|>YNC>=HEpC;o&*ujD}hh*44x%F}2hI64q4%V2pCgD+zOb&MIY} zmR$P^%IH+iYJEfIb?cn~j3bS;`%qQc3|}$Nsjnfn)-iYHz;e8^=}MCP9_=*)K#DPp zkZ=96M1S&5u+(IL*4k&V9*8=G^%7Y_@jp&+bN!&JT5ZDR7>|W|8ADW>e-&XXlQc_B zy9-xcF?K^|b{K@H^PGF3vz*Nw?nk&PbD6`bw2Z}REefwoa+%x4Zw0vW#xt!7Yp>{; zEPmw;{X|FAI;-mUKTDS?DvDNV{!)ZmjuM{vsO6^8QdT&XaY?^RK_ykK2asrqUa)#L+7no5nFb`L&?aN_Xl!Mg#m$q=nD-pv;PIWAiO zBfL6>GQO-?`OziqL#U$XyLXbuqHJsU_!?}6coTY)N@!uu*Y3AUGrL|;cwl%aM7Ht>25t%*8*D$QSuP#xq9YOtSKD1~-h8?r2?ZY2BUKefzmuRdSon(yc~XsvYDU&H?@d|07jR literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php new file mode 100644 index 0000000000000000000000000000000000000000..5cd56e066aeefad844fdcf1fcff8a8fcad56221e GIT binary patch literal 7118 zcmb_hOLH7o6{clLk?s&hzK-Rw5|eh@j->H;CN+ZtZdt~yheg1O9ocazVT!3%&z(_| zneL_^Qe>4j>|jL|3t$BcR#YWB3X0+fP$`N9*`&0himbfKItz+(AN`!3k;cIrkNTc- z?m6Fi+^=un{+_ezpeynwv52etq$Teh$o?*o9oP14!|uvELAy;{*|2+#*(Gj8me(K1 zZ$Ee}Z>+!d_%f(^cHkOBl{>cG>5^*CwoKo4O{-Jgt5puK< z)%2Ps>}~2@^C<+fBDeLfN5DeAY&)DgBDK;@kajk0-%O6eWo=Li`RkEw^nYKHcD$nAG zI=mi8YnzBt8!5ukwNeGxShIUj(x-PhtvzbMQK>R{{U4LyY1XG}$)0FuaOm)EqvGrX9UQnjTEb;u&}}fiXht zk#B!Utl~HoQ+^?##gqN@92h$UZ=jb$tedT9K6*t-KC@V;H5P=w6>zvR%-0L(C5wFI zHxu44rxhPv+a$xV%R)y3i=ac#2c7b33BAfNU{#otsJp2|)mWm+xHKeD8B5Qb9T#01 z;F!qBcM;}Qo0E@MQ|ZWhG%yE0M)NcW8TktS<_+p{T5$f!r!Oy0lKZWJCu?0^y%$(0Q8K$7YWJ<1tAz6jV`bh*fr()!OU$ z>fl<7P2h9s8Ni~!x6l+j5cc#g>-j=W2@4}(bgy2ah8X<;Nv`@PD(Ib#OFE2qusKzz zUC!6mVnKWto%e`gTP@u^XeKQbAgEJWm_<{z+ahjr=b$)Ak-%GMe9t8N#TVeOnVOpK zL@uN(Fb?t)u)sr0jmIglnH`VQbXTRZfM#NVsXCrQ)Ngd6P}J>92$j# zslu58{w5j^;Kb&qjPe@^UEtjp?-cg7CQ6U@cAb^p4Rqb;+CeLv`#s%)Q^ghgL?;uF znx7EE$7(v%G3M2Yq4KtSiq2;}+n~Wg1!wT1MRc;!v7&@uN0a<~7Tuo%&??9&pXb2x zDCqT|fbm6i)(7g{Z8|nIQq!;l%ZDV=l6eK4^8&*lo|jsrhuH*PLzAiG)WhVY+b$ck z*tWuApTCPHI0#A<3EetB)#p$l=_7MPX`{J!0^%O@=liV4H#IoT+XABr;3nO8}WcC0Zn`?Jr!_|@3Aag9>$ zL&|PffI!pH;8jaU;mtw(q8I1Y!~c-bw}!JnyqxdlaIG-JQ}a`0JsAuz^1NV%#!@Yn zj__Y3e#U2Mj)!acVX$0fcvr{^<_AoV0XiZpZzcm-!i|NzNFXiQP4Vv~bS{Sl;y3a= z&k+q#AIi6sTS*6jQs?>C?;eBq?{MJe^GG}Zt9RGN1BGG&+tFl9%yo zv0&To0{3JSD;B}OmC$VVu*Ns?!^+BqC=5!>onvj5g-iDnM3F^#O*t`2RVv|6BK{%{ zjmHrP|1THs4|1`tRAT6o(>}&dHP{QE@C_WEKbAh#E+*nAat?uvd z3ydSSsR#Zp+%^F%z2S6qziqp{@=4=C{>6xn!&Wz?4XP#Yw=GYRhac6}kbelPPcLWvJZ^d;3aay}k0N&b=N I2pu8xKQr*R@&Et; 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..cc7e45493f8 --- /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.v3BMutationRecordProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..2c8d7ae84e61c4a16489fdfe927e4f0b27f488c0 GIT binary patch literal 2855 zcmbVO-EQMV6vk<{-JNvX#a#&#RG4-vHQS|*NQ40Q2c>OVD$z7*(yTz1qKPv}2ON(z zwu7=&-h_+2;f4p`ArMc}N8kc+Ja!VNP1&%yif7Ju=J-3`H$Hpcy4NmxflsMJ1@UPM zH~ZMXrq~tS=N7kdGibM|z!vYi%%(!e`1k^sFKW1Sd{$crsK*0gQ3H24@7OfgJTB_sk!FwY#H3WwO{G4(9LTzJU}gc?SN`Xlv91XSHow}SnUy@mhn7APCkqUuUM08`w6c+=v z!bOKT?2YsS#3UczFXM5W+by6kcN6`2zbwl3#vhAlbqWc0^f0NFyXuI9a7P{UQXQp{ zI>J7u^Ir~Im1s$?piikF(vDYhe9>3SC>?lIG-9Pambt!}J=Yb0r559SKcLkf6{8Pb z=wUzbv?o$dd$Z@QCz8PB3^~+SXpuUkY15XLhIHwCW|(ehRs9gYIdx(ORNY4_mY`A= zvAwk=3ECWjCV85?Pt^nT?9T1rX-_3LGvPBkD4k>_jplx){rC!aiXQdC8a3&CBlWeC z`2wxnCGs7Rjn_z>!qE%#S-o_5c5-%9testy8`WB|c2#X$m8+G~5iFOEpM9V%BXm`c z!r)l}MLr%qrHp@++v48}+DY*9ZfmOtvl$v}g4dlq@gO|KvYqFELt`XT0=m1`*nD7`h!am2EblEvF0{+#{|30-&2`W zIrZsBGS&I`+gLCBIovc&xoajzLzoS3Q)>~}Fyy{rjNyh+FEkgVK?+-=ulDEBw3Qgn TLZ32g%3vlVqcLiL1_=ENc~HR9 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..8b1e14a465e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php @@ -0,0 +1,97 @@ +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/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ÚAname‚Óä“64/v3/{name=projects/*}/notificationChannelDescriptorsÝ + GetNotificationChannelDescriptor=.google.monitoring.v3.GetNotificationChannelDescriptorRequest3.google.monitoring.v3.NotificationChannelDescriptor"EÚAname‚Óä“86/v3/{name=projects/*/notificationChannelDescriptors/*}Ä +ListNotificationChannels5.google.monitoring.v3.ListNotificationChannelsRequest6.google.monitoring.v3.ListNotificationChannelsResponse"9ÚAname‚Óä“,*/v3/{name=projects/*}/notificationChannelsµ +GetNotificationChannel3.google.monitoring.v3.GetNotificationChannelRequest).google.monitoring.v3.NotificationChannel";ÚAname‚Óä“.,/v3/{name=projects/*/notificationChannels/*}ä +CreateNotificationChannel6.google.monitoring.v3.CreateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"dÚAname,notification_channel‚Óä“B"*/v3/{name=projects/*}/notificationChannels:notification_channelƒ +UpdateNotificationChannel6.google.monitoring.v3.UpdateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"‚ÚA update_mask,notification_channel‚Óä“Y2A/v3/{notification_channel.name=projects/*/notificationChannels/*}:notification_channel® +DeleteNotificationChannel6.google.monitoring.v3.DeleteNotificationChannelRequest.google.protobuf.Empty"AÚA +name,force‚Óä“.*,/v3/{name=projects/*/notificationChannels/*}Ü +\'SendNotificationChannelVerificationCodeD.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.google.protobuf.Empty"SÚAname‚Óä“F"A/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode:*‡ +&GetNotificationChannelVerificationCodeC.google.monitoring.v3.GetNotificationChannelVerificationCodeRequestD.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse"RÚAname‚Óä“E"@/v3/{name=projects/*/notificationChannels/*}:getVerificationCode:*Ê +VerifyNotificationChannel6.google.monitoring.v3.VerifyNotificationChannelRequest).google.monitoring.v3.NotificationChannel"JÚA name,code‚Óä“8"3/v3/{name=projects/*/notificationChannels/*}:verify:*©Ê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.v3BNotificationServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..fb4ffd3bc28 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' +¼ +(google/monitoring/v3/query_service.protogoogle.monitoring.v3google/api/client.proto)google/monitoring/v3/metric_service.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.v3BQueryServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..1627dee4f7a7b671b07fe8db70c22464a26abb42 GIT binary patch literal 4653 zcmbVQOLNm!6h?XbI1eKdFs98Y28NJ=T;dMXQ3y=zgy3mH+$4k!;~61K*UoKaN!7zN zFj@6Kbl>TsGhKDnpU|1I>rDSZxBQBpdnMVjG{sSw6R{^R?P0N7lAG$l5`11wc17 z&y)5-4e$;m{O1I9lj@S^Yd-#Wi+U=>5ccWvOI@*vH zLmL(4gpsR~?*=4!x+J;84_s@7+szalcmApkh}4=xYr7;0ywY{3iywsQ__Q8isxcJG zxuN?<4ylzjlURo4R*6e(V=$P<@&02PMQzP6Izf7h^jYk<#hknY|IS1H=d5cAU0LJus#ZN12Z&0_f5EQf&(Y4MgvX=MW*K= z)y?1>Ou1203~M%w;{%xK%afRf;qS;%6vZhRZEI#gvb@BVp)UpHSK-6jF9Iwi`b}8p znnOJqM`2+voJ!(tY(C!--S-ObqQ8#gnTL;}U>}PG+ihwVeao|lFOok80&X^J(;zO2 zhJOqc5|&Dn0MsCsPaBlD`JcvMF0yQkw28S>XSUHc`ABnPRhJUC;9ATMlc9068d#h- z@i=|b%b%TD4gADP3}GiWZO!C~62u}*yS8cKRuDDd>?p6#>#@qXiOcbD!g_v)U9Y!o z^R_#^d?QA&)-LzXCB#*GOL>x)@=A-)&#CyAp=cLh8iNtW{QMt7FcF(2PQw^ZzC+u<{bCr)IXN#T_!As4ZR{zy`Qg}S zB45Fz*48MFJZe(^huy_w={UNsdL+q2$d8hZ1(lktBepOuHxwZKP7~R#ZCSjAHMJ+xF z1pY(&fk#2e|17{vU*^!o49)>V^=%(_7QRGt=&7mOr!9gFnG$c8wSFF@4DOY_OX~q! z!Bsu*BlAyT&w4_-9Qe;JFYCMuY{W3}#^8VKRQuG;Ft};YZ9vsiU4Yp^9*d74 zjqNgy#M#8|s|o6`1z*&qdiI9nc7Ig&MD*Y`$7B{Lt6|el zOz#5DZM+6)FDITk^_6ZJIQ8F#a+~}DMCM-va`z1Rp!hz1S*!84wd5@cUXy$n`ZNS9 p3V*LCUAUqg6zgMru`1r_e0bjrZyyqu6{lWQaLMpa;TVnq{sWYrinternalAddGeneratedFile( + ' +ó +*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";ÚAparent,service‚Óä“$"/v3/{parent=*/*}/services:service~ + +GetService\'.google.monitoring.v3.GetServiceRequest.google.monitoring.v3.Service"(ÚAname‚Óä“/v3/{name=*/*/services/*}‘ + ListServices).google.monitoring.v3.ListServicesRequest*.google.monitoring.v3.ListServicesResponse"*ÚAparent‚Óä“/v3/{parent=*/*}/services˜ + UpdateService*.google.monitoring.v3.UpdateServiceRequest.google.monitoring.v3.Service"<ÚAservice‚Óä“,2!/v3/{service.name=*/*/services/*}:service} + DeleteService*.google.monitoring.v3.DeleteServiceRequest.google.protobuf.Empty"(ÚAname‚Óä“*/v3/{name=*/*/services/*}ú +CreateServiceLevelObjective8.google.monitoring.v3.CreateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"tÚAparent,service_level_objective‚Óä“M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:service_level_objectiveÁ +GetServiceLevelObjective5.google.monitoring.v3.GetServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"AÚAname‚Óä“42/v3/{name=*/*/services/*/serviceLevelObjectives/*}Ô +ListServiceLevelObjectives7.google.monitoring.v3.ListServiceLevelObjectivesRequest8.google.monitoring.v3.ListServiceLevelObjectivesResponse"CÚAparent‚Óä“42/v3/{parent=*/*/services/*}/serviceLevelObjectivesŒ +UpdateServiceLevelObjective8.google.monitoring.v3.UpdateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"…ÚAservice_level_objective‚Óä“e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:service_level_objective² +DeleteServiceLevelObjective8.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.google.protobuf.Empty"AÚAname‚Óä“4*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}©Ê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.v3BServiceMonitoringServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php new file mode 100644 index 00000000000..eeb8487aad2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' + +!google/monitoring/v3/snooze.protogoogle.monitoring.v3google/api/resource.proto!google/monitoring/v3/common.proto"Å +Snooze +name ( BàA< +criteria ( 2%.google.monitoring.v3.Snooze.CriteriaBàA9 +interval ( 2".google.monitoring.v3.TimeIntervalBàA + display_name ( BàAH +Criteria< +policies ( B*úA\' +%monitoring.googleapis.com/AlertPolicy:JêAG + monitoring.googleapis.com/Snooze#projects/{project}/snoozes/{snooze}BÆ +com.google.monitoring.v3B SnoozeProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/SnoozeService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php new file mode 100644 index 00000000000..c0b830a5319 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php @@ -0,0 +1,56 @@ +internalAddGeneratedFile( + ' +• +)google/monitoring/v3/snooze_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/snooze.proto google/protobuf/field_mask.proto"‚ +CreateSnoozeRequest8 +parent ( B(àAúA" monitoring.googleapis.com/Snooze1 +snooze ( 2.google.monitoring.v3.SnoozeBàA"” +ListSnoozesRequest8 +parent ( B(àAúA" monitoring.googleapis.com/Snooze +filter ( BàA + page_size (BàA + +page_token ( BàA"] +ListSnoozesResponse- +snoozes ( 2.google.monitoring.v3.Snooze +next_page_token ( "J +GetSnoozeRequest6 +name ( B(àAúA" + monitoring.googleapis.com/Snooze"~ +UpdateSnoozeRequest1 +snooze ( 2.google.monitoring.v3.SnoozeBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA2˜ + SnoozeService˜ + CreateSnooze).google.monitoring.v3.CreateSnoozeRequest.google.monitoring.v3.Snooze"?ÚA parent,snooze‚Óä“)"/v3/{parent=projects/*}/snoozes:snooze” + ListSnoozes(.google.monitoring.v3.ListSnoozesRequest).google.monitoring.v3.ListSnoozesResponse"0ÚAparent‚Óä“!/v3/{parent=projects/*}/snoozes + GetSnooze&.google.monitoring.v3.GetSnoozeRequest.google.monitoring.v3.Snooze".ÚAname‚Óä“!/v3/{name=projects/*/snoozes/*}¤ + UpdateSnooze).google.monitoring.v3.UpdateSnoozeRequest.google.monitoring.v3.Snooze"KÚAsnooze,update_mask‚Óä“02&/v3/{snooze.name=projects/*/snoozes/*}:snooze©Ê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.v3BSnoozeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..ed30a8928d9 --- /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.v3BSpanContextProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..36ba869253e4af40d3ac4226633f0eec61f3f9e6 GIT binary patch literal 5190 zcmb_gOLN=S6*ehRqz?6as~qdS0rKz zK=DvV_Gr^z&`tkDr^{};?PT&By6$wcXcz6aGd=eL;M=j3sWu|cz31HX_|D_rUw&o} zZ1|9`6O%ZqM|A$|iuVSDw;ju~G;7G8`RC`v;Wg{RHipD0@O(|;o080nwTAovSzXI_ zG*agKmen7U{R_)9Jj*f6{{CfY-?u&Ef)toE08_mnuB~c>ueU14#8Y+EQ+svB*gGCE z_D)I%0NPM>UB1f%z#HK4&-TxThQ_;|>fyhKhN~EOn4u1h*Qoh3{#+fp1X<_zp8KZe z8J5XY2FcXO-eW$HN%uaqEwuC*AF0x!#-riAhUpQdORP3tG{jow4r-mMwnag1H0zldmxg4!+icR0csZVp<$w1+Yy}z0%&c1GxzWFo zsRzJ?F`4i@vpQY8AL)+qDa^t3@D3-zMiddH?^wRgoRcno95GIXyD+C=Ap&uoGNZsc zz`*ltMWeyWCeVZF;?tW7J48-q{$Y$0Vb#Nc1#)O$(#4dE0vuLJ^ zyOE3tafK+CxF?XLCD!u2Y>J)t9eZ1l(Jag_(^D=~50!M>>?*&6O8z`L;9Z`>5L5o+ zfSqf=8nYD<>0Q|*yT!m)y0Nq%Ib>wz1jx8#h?r)8=wqF5vw+HN6nl@}DX&c^19uP7 ztSJOlJG+V6q$&tht_E9CVF`jmP2XUq|8TMJnM`3)jv(#3XzEZsBSSa4!}vd0%s&sh zF0vjmPSNz7tDFk!Q#j;kwo^dTqz=l&b66h%o%xs6iMKn1!8wviotk?9(85+6CgwJz zZTxZ-&GJo;osr1>a}`!c5awRe)cTE2T!aYm28ck4s*U1jH??vk3X_bn~uAvDi2LWqnto6{s zd!f3olmSt7iUFGIDJ&?-h_J$f`uz5%9R?CvY`G5RMVM(UZmZ0R&u%X@%r}-H@58p{ zyPkD{@e8t;$zDgIwp?x5#Oz%Ff6JJZB$w83fVPOAzduqRP-3OxldtxQ7AE8Xf{rC zRixNBG-3nQ16bw$76)#DYVW~XXg2!H51MiU`@mpCXVWJWvQcc^ROdV?YIyOfxA^A`7 zIr7ht{QIRj^2bR2&pcUZewq14va$~83B2SAur>wzG%UR$S7Gs5heY6Amf_|2FJk#J zEqRkw;XUAvMfp&w%@~}7rMf8N$dQ8Omei3m@jSw5G8xb%@|P`fhK~*~?IT5OR;3ya zFfncm*1H|Ct+d+GNrRH&Sa(xVt7S!qmK|Dd6SIh=dVfE}ev^QWP}!(cV*LxVHgr#~ z2g$GthdBG(b^H0kh8?!P$b z&QQ_gtD}QMQyo}iq-k?|z5kCMg&7S32jn%lyKsTqgNL7Yq^8mmk+@0J#URtT_!aY^j@j7kc zg*QSB>%h6EusJil;8ozeGrf!1Ix*Z~c|$i>zd$!E$Xcudw7fN{N~5KO`#R|E46L2B zs$BSQ~*-Z7+Bc>j!oQnT@A)G zIs@cQEOTR%8aDR{tT=2YW-0jgk#T}6oT0Ia4y|BX3THD8z_1kr2P)wPH`6D7h)v!6 zLS76c;&MKbu$*^00!9>IMeMevmY88+?nqtCLE%_zH>v`H83QhK8Um&!y@6IU%iIP4 zaw-yvm6`}(ypYoGhV)X%tkC`R>!i`HH<}G0lYH`P*qWPyx%;r&7V)fhRa^u=l!@sl z3(cyCDq@NVFFT5OR8fv3p{7)XBf8Sg#4CS|K^8H#uxwS*fh$||?Wh&|m7onRUyrs@ zWcID-u>oiBeFQANk6jigX!hB`7}xgMALF??dm1ZLnW*E@16kpu^i8zb>#^0|internalAddGeneratedFile( + ' +˜ +)google/monitoring/v3/uptime_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/uptime.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"› +ListUptimeCheckConfigsRequestC +parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfig +filter (  + 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";ÚAparent‚Óä“,*/v3/{parent=projects/*}/uptimeCheckConfigs­ +GetUptimeCheckConfig1.google.monitoring.v3.GetUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"9ÚAname‚Óä“,*/v3/{name=projects/*/uptimeCheckConfigs/*}Þ +CreateUptimeCheckConfig4.google.monitoring.v3.CreateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"dÚAparent,uptime_check_config‚Óä“A"*/v3/{parent=projects/*}/uptimeCheckConfigs:uptime_check_configë +UpdateUptimeCheckConfig4.google.monitoring.v3.UpdateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"qÚAuptime_check_config‚Óä“U2>/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}:uptime_check_config¢ +DeleteUptimeCheckConfig4.google.monitoring.v3.DeleteUptimeCheckConfigRequest.google.protobuf.Empty"9ÚAname‚Óä“,**/v3/{name=projects/*/uptimeCheckConfigs/*}“ +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.v3BUptimeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..7d97df10e8e --- /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 array|\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 array|\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/AlertPolicy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php new file mode 100644 index 00000000000..64b014d4429 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php @@ -0,0 +1,805 @@ +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 Cloud 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * + * 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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * + * 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`. + * If `condition_monitoring_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. This field is + * only set when the alert policy is invalid. An invalid 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; + /** + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $severity = 0; + + /** + * 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 Cloud 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * @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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * @type array<\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`. + * If `condition_monitoring_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. This field is + * only set when the alert policy is invalid. An invalid alert policy will not + * generate incidents. + * @type array|\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. + * @type int $severity + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * } + */ + 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 Cloud 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 Cloud 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * + * 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * + * 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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * + * 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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * + * 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`. + * If `condition_monitoring_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`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; + * @param array<\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. This field is + * only set when the alert policy is invalid. An invalid 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. This field is + * only set when the alert policy is invalid. An invalid 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 array|\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; + } + + /** + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Severity::class); + $this->severity = $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..d5a4cff1ce3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php @@ -0,0 +1,167 @@ +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; + /** + * Control how notifications will be sent out, on a per-channel basis. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + */ + private $notification_channel_strategy; + + /** + * 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 + * @type array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $notification_channel_strategy + * Control how notifications will be sent out, on a per-channel basis. + * } + */ + 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; + } + + /** + * Control how notifications will be sent out, on a per-channel basis. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationChannelStrategy() + { + return $this->notification_channel_strategy; + } + + /** + * Control how notifications will be sent out, on a per-channel basis. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * @param array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationChannelStrategy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy::class); + $this->notification_channel_strategy = $arr; + + 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/NotificationChannelStrategy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php new file mode 100644 index 00000000000..3fb4be79589 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php @@ -0,0 +1,139 @@ +google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + */ +class NotificationChannelStrategy extends \Google\Protobuf\Internal\Message +{ + /** + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channel_names = 1; + */ + private $notification_channel_names; + /** + * The frequency at which to send reminder notifications for open + * incidents. + * + * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; + */ + protected $renotify_interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $notification_channel_names + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @type \Google\Protobuf\Duration $renotify_interval + * The frequency at which to send reminder notifications for open + * incidents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channel_names = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationChannelNames() + { + return $this->notification_channel_names; + } + + /** + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channel_names = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationChannelNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->notification_channel_names = $arr; + + return $this; + } + + /** + * The frequency at which to send reminder notifications for open + * incidents. + * + * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getRenotifyInterval() + { + return $this->renotify_interval; + } + + public function hasRenotifyInterval() + { + return isset($this->renotify_interval); + } + + public function clearRenotifyInterval() + { + unset($this->renotify_interval); + } + + /** + * The frequency at which to send reminder notifications for open + * incidents. + * + * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRenotifyInterval($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->renotify_interval = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NotificationChannelStrategy::class, \Google\Cloud\Monitoring\V3\AlertPolicy_AlertStrategy_NotificationChannelStrategy::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..c476fb7bd10 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php @@ -0,0 +1,373 @@ +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 Cloud 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. Cloud 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 Cloud 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. Cloud 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. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $condition_prometheus_query_language + * A condition that uses the Prometheus 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 Cloud 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. Cloud 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 Cloud 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. Cloud 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; + } + + /** + * A condition that uses the Prometheus query language to define alerts. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition|null + */ + public function getConditionPrometheusQueryLanguage() + { + return $this->readOneof(21); + } + + public function hasConditionPrometheusQueryLanguage() + { + return $this->hasOneof(21); + } + + /** + * A condition that uses the Prometheus query language to define alerts. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $var + * @return $this + */ + public function setConditionPrometheusQueryLanguage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition::class); + $this->writeOneof(21, $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/EvaluationMissingData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php new file mode 100644 index 00000000000..6fc5a47b481 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php @@ -0,0 +1,76 @@ +google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + */ +class EvaluationMissingData +{ + /** + * An unspecified evaluation missing data option. Equivalent to + * EVALUATION_MISSING_DATA_NO_OP. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_UNSPECIFIED = 0; + */ + const EVALUATION_MISSING_DATA_UNSPECIFIED = 0; + /** + * If there is no data to evaluate the condition, then evaluate the + * condition as false. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_INACTIVE = 1; + */ + const EVALUATION_MISSING_DATA_INACTIVE = 1; + /** + * If there is no data to evaluate the condition, then evaluate the + * condition as true. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_ACTIVE = 2; + */ + const EVALUATION_MISSING_DATA_ACTIVE = 2; + /** + * Do not evaluate the condition to any value if there is no data. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_NO_OP = 3; + */ + const EVALUATION_MISSING_DATA_NO_OP = 3; + + private static $valueToName = [ + self::EVALUATION_MISSING_DATA_UNSPECIFIED => 'EVALUATION_MISSING_DATA_UNSPECIFIED', + self::EVALUATION_MISSING_DATA_INACTIVE => 'EVALUATION_MISSING_DATA_INACTIVE', + self::EVALUATION_MISSING_DATA_ACTIVE => 'EVALUATION_MISSING_DATA_ACTIVE', + self::EVALUATION_MISSING_DATA_NO_OP => 'EVALUATION_MISSING_DATA_NO_OP', + ]; + + 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(EvaluationMissingData::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_EvaluationMissingData::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..fc6aad1dfc4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php @@ -0,0 +1,304 @@ +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 array<\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 array<\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..74e9099f57f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php @@ -0,0 +1,635 @@ +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; + /** + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + */ + protected $forecast_options = null; + /** + * 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; + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + */ + protected $evaluation_missing_data = 0; + + /** + * 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 array<\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 array<\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 \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $forecast_options + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * @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. + * @type int $evaluation_missing_data + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * } + */ + 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 array<\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 array<\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; + } + + /** + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions|null + */ + public function getForecastOptions() + { + return $this->forecast_options; + } + + public function hasForecastOptions() + { + return isset($this->forecast_options); + } + + public function clearForecastOptions() + { + unset($this->forecast_options); + } + + /** + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $var + * @return $this + */ + public function setForecastOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions::class); + $this->forecast_options = $var; + + 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; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * @return int + */ + public function getEvaluationMissingData() + { + return $this->evaluation_missing_data; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * @param int $var + * @return $this + */ + public function setEvaluationMissingData($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); + $this->evaluation_missing_data = $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/MetricThreshold/ForecastOptions.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php new file mode 100644 index 00000000000..5b730b5b812 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php @@ -0,0 +1,101 @@ +google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + */ +class ForecastOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * + * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forecast_horizon = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $forecast_horizon + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * + * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getForecastHorizon() + { + return $this->forecast_horizon; + } + + public function hasForecastHorizon() + { + return isset($this->forecast_horizon); + } + + public function clearForecastHorizon() + { + unset($this->forecast_horizon); + } + + /** + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * + * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setForecastHorizon($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->forecast_horizon = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ForecastOptions::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold_ForecastOptions::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..4752ce7876d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php @@ -0,0 +1,257 @@ +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; + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + */ + protected $evaluation_missing_data = 0; + + /** + * 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. + * @type int $evaluation_missing_data + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * } + */ + 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; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * @return int + */ + public function getEvaluationMissingData() + { + return $this->evaluation_missing_data; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * @param int $var + * @return $this + */ + public function setEvaluationMissingData($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); + $this->evaluation_missing_data = $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/PrometheusQueryLanguageCondition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php new file mode 100644 index 00000000000..6db9f2637a4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php @@ -0,0 +1,433 @@ +google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + */ +class PrometheusQueryLanguageCondition extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $duration = null; + /** + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * + * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $evaluation_interval = null; + /** + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rule_group = ''; + /** + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $alert_rule = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * @type \Google\Protobuf\Duration $duration + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * @type \Google\Protobuf\Duration $evaluation_interval + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * @type string $rule_group + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * @type string $alert_rule + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * + * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getEvaluationInterval() + { + return $this->evaluation_interval; + } + + public function hasEvaluationInterval() + { + return isset($this->evaluation_interval); + } + + public function clearEvaluationInterval() + { + unset($this->evaluation_interval); + } + + /** + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * + * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEvaluationInterval($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->evaluation_interval = $var; + + return $this; + } + + /** + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @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; + } + + /** + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRuleGroup() + { + return $this->rule_group; + } + + /** + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRuleGroup($var) + { + GPBUtil::checkString($var, True); + $this->rule_group = $var; + + return $this; + } + + /** + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAlertRule() + { + return $this->alert_rule; + } + + /** + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAlertRule($var) + { + GPBUtil::checkString($var, True); + $this->alert_rule = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrometheusQueryLanguageCondition::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_PrometheusQueryLanguageCondition::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..bb9e016f4bd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php @@ -0,0 +1,81 @@ +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 => 'AND', + self::PBOR => 'OR', + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + 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..7df7159cc1b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php @@ -0,0 +1,207 @@ +google.monitoring.v3.AlertPolicy.Documentation + */ +class Documentation extends \Google\Protobuf\Internal\Message +{ + /** + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * + * 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 = ''; + /** + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * + * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subject = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * @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. + * @type string $subject + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * + * Generated from protobuf field string content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * + * 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; + } + + /** + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * + * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + /** + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * + * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubject($var) + { + GPBUtil::checkString($var, True); + $this->subject = $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/AlertPolicy/Severity.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php new file mode 100644 index 00000000000..76e47474924 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php @@ -0,0 +1,75 @@ +google.monitoring.v3.AlertPolicy.Severity + */ +class Severity +{ + /** + * No severity is specified. This is the default value. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * This is the highest severity level. Use this if the problem could + * cause significant damage or downtime. + * + * Generated from protobuf enum CRITICAL = 1; + */ + const CRITICAL = 1; + /** + * This is the medium severity level. Use this if the problem could + * cause minor damage or downtime. + * + * Generated from protobuf enum ERROR = 2; + */ + const ERROR = 2; + /** + * This is the lowest severity level. Use this if the problem is not causing + * any damage or downtime, but could potentially lead to a problem in the + * future. + * + * Generated from protobuf enum WARNING = 3; + */ + const WARNING = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::CRITICAL => 'CRITICAL', + self::ERROR => 'ERROR', + self::WARNING => 'WARNING', + ]; + + 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(Severity::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Severity::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php new file mode 100644 index 00000000000..5becfda99f4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php @@ -0,0 +1,269 @@ +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 array|\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 array|\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 array|\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 array|\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 array|\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 array|\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/ComparisonType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php new file mode 100644 index 00000000000..d86a3fbc2cd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php @@ -0,0 +1,90 @@ +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..6c9c18ef40f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php @@ -0,0 +1,188 @@ +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 Metrics Scope, 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; + + /** + * @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 Metrics Scope, 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 \Google\Cloud\Monitoring\V3\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. + * + * @return \Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self + { + return (new self()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + } + + /** + * 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 Metrics Scope, 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 Metrics Scope, 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 Metrics Scope, 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..bad7c64edac --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php @@ -0,0 +1,181 @@ +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; + + /** + * @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 \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. + * + * @return \Google\Cloud\Monitoring\V3\CreateGroupRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Monitoring\V3\Group $group): self + { + return (new self()) + ->setName($name) + ->setGroup($group); + } + + /** + * 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..45d737e63e8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php @@ -0,0 +1,151 @@ +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; + + /** + * @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 \Google\Api\MetricDescriptor $metricDescriptor Required. The new [custom + * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. + * + * @return \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest + * + * @experimental + */ + public static function build(string $name, \Google\Api\MetricDescriptor $metricDescriptor): self + { + return (new self()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + } + + /** + * 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..2a528898beb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php @@ -0,0 +1,163 @@ +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; + + /** + * @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 \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel Required. The definition of the `NotificationChannel` to create. + * + * @return \Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self + { + return (new self()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + } + + /** + * 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..151f66b7a84 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php @@ -0,0 +1,185 @@ +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-zA-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; + + /** + * @param string $parent Required. Resource name of the parent `Service`. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * + * @return \Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self + { + return (new self()) + ->setParent($parent) + ->setServiceLevelObjective($serviceLevelObjective); + } + + /** + * 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-zA-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-zA-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-zA-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..7d9425e30c5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php @@ -0,0 +1,180 @@ +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 Metrics Scope. 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; + + /** + * @param string $parent Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to create. + * + * @return \Google\Cloud\Monitoring\V3\CreateServiceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\Service $service): self + { + return (new self()) + ->setParent($parent) + ->setService($service); + } + + /** + * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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/CreateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php new file mode 100644 index 00000000000..c03b63fbc9d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php @@ -0,0 +1,149 @@ +google.monitoring.v3.CreateSnoozeRequest + */ +class CreateSnoozeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snooze = null; + + /** + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. + * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * @return \Google\Cloud\Monitoring\V3\CreateSnoozeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\Snooze $snooze): self + { + return (new self()) + ->setParent($parent) + ->setSnooze($snooze); + } + + /** + * 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 + * a `Snooze` should be created. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type \Google\Cloud\Monitoring\V3\Snooze $snooze + * Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. 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 + * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Snooze|null + */ + public function getSnooze() + { + return $this->snooze; + } + + public function hasSnooze() + { + return isset($this->snooze); + } + + public function clearSnooze() + { + unset($this->snooze); + } + + /** + * Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Snooze $var + * @return $this + */ + public function setSnooze($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); + $this->snooze = $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..66cb39cd93a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php @@ -0,0 +1,159 @@ +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; + + /** + * @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] + * Please see {@see MetricServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Monitoring\V3\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. + * + * @return \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest + * + * @experimental + */ + public static function build(string $name, array $timeSeries): self + { + return (new self()) + ->setName($name) + ->setTimeSeries($timeSeries); + } + + /** + * 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 array<\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 array<\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..8fb4fe1f025 --- /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 array<\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 array<\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/CreateUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php new file mode 100644 index 00000000000..991e2028b3a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php @@ -0,0 +1,142 @@ +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; + + /** + * @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 \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. + * + * @return \Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self + { + return (new self()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + } + + /** + * 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..2333c3a4691 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php @@ -0,0 +1,93 @@ +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 = ''; + + /** + * @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]. Please see + * {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..b63a0bdb79f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php @@ -0,0 +1,130 @@ +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; + + /** + * @param string $name Required. The group to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Please see {@see GroupServiceClient::groupName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..3d57dd66af3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php @@ -0,0 +1,103 @@ +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 = ''; + + /** + * @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"`. Please see + * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..56e0316342e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php @@ -0,0 +1,138 @@ +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; + + /** + * @param string $name Required. The channel for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * @param 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. + * + * @return \Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name, bool $force): self + { + return (new self()) + ->setName($name) + ->setForce($force); + } + + /** + * 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..8771b8fb4ab --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php @@ -0,0 +1,92 @@ +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 = ''; + + /** + * @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] + * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..378fecd0724 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. Resource name of the `Service` to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..dfda97aa016 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The Uptime check configuration to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..573ae71a8ad --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The alerting policy to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * Please see {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetAlertPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..da9c56f0a13 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The group to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Please see {@see GroupServiceClient::groupName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..360bdfac4cc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php @@ -0,0 +1,103 @@ +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 = ''; + + /** + * @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"`. Please see + * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..82d4800c5e1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php @@ -0,0 +1,98 @@ +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 = ''; + + /** + * @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`. Please see + * {@see MetricServiceClient::monitoredResourceDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..f7ff869b729 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The channel type for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * Please see {@see NotificationChannelServiceClient::notificationChannelDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..708a1446cd9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The channel for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..acb10877c21 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php @@ -0,0 +1,167 @@ +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; + + /** + * @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. Please see + * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..c22d24403f6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php @@ -0,0 +1,138 @@ +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; + + /** + * @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] + * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..6113d513f42 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. Resource name of the `Service`. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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/GetSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php new file mode 100644 index 00000000000..83b9da5e20f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php @@ -0,0 +1,88 @@ +google.monitoring.v3.GetSnoozeRequest + */ +class GetSnoozeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * Please see {@see SnoozeServiceClient::snoozeName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetSnoozeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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 ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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..83b9a3f2eaa --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The Uptime check configuration to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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/InternalChecker.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php new file mode 100644 index 00000000000..19273fdc3f2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php @@ -0,0 +1,271 @@ +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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Metrics Scope 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/LabelValue.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php new file mode 100644 index 00000000000..3a66a26a435 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php @@ -0,0 +1,141 @@ +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..cda153f70a1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php @@ -0,0 +1,294 @@ +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 = ''; + + /** + * @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. + * + * @return \Google\Cloud\Monitoring\V3\ListAlertPoliciesRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..45d31688ec1 --- /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 array<\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 array<\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..876c5364c1a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php @@ -0,0 +1,277 @@ +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; + + /** + * @param string $name Required. The group whose members are listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Please see {@see GroupServiceClient::groupName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\ListGroupMembersRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..8cfc0e8fcd3 --- /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 array<\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 array<\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..7203ea37100 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php @@ -0,0 +1,316 @@ +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; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListGroupsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..98e3257f20a --- /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 array<\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 array<\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..800b557691f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php @@ -0,0 +1,238 @@ +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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * + * 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 = ''; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * @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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * + * 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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * + * 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..4ea2039e212 --- /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 array<\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 array<\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..14696bd981c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php @@ -0,0 +1,222 @@ +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 = ''; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..07992037c86 --- /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 array<\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 array<\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..ef7d9522e6f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php @@ -0,0 +1,206 @@ +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 = ''; + + /** + * @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. + * + * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..93034ae1599 --- /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 array<\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 array<\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..6bced117ff1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php @@ -0,0 +1,307 @@ +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 = ''; + + /** + * @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. + * + * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..28dc01fb0af --- /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 array<\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 array<\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..19128d58f56 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php @@ -0,0 +1,257 @@ +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 Metrics Scope. 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; + + /** + * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Metrics Scope. The formats are: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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..8e9d2ead1ab --- /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 array<\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 array<\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..795a4e8e34e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php @@ -0,0 +1,275 @@ +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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * 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 = ''; + + /** + * @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 Metrics Scope. The formats are: + * + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * + * @return \Google\Cloud\Monitoring\V3\ListServicesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * @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 Metrics Scope. 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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * 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..4359a2689b2 --- /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 array<\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 array<\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/ListSnoozesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php new file mode 100644 index 00000000000..ff92a8e233f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php @@ -0,0 +1,252 @@ +google.monitoring.v3.ListSnoozesRequest + */ +class ListSnoozesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be 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 = ''; + /** + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\ListSnoozesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 + * `Snooze`s should be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type string $filter + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * @type int $page_size + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * @type string $page_token + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be 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 + * `Snooze`s should be 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; + } + + /** + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @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/ListSnoozesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php new file mode 100644 index 00000000000..e22e8db840e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php @@ -0,0 +1,106 @@ +google.monitoring.v3.ListSnoozesResponse + */ +class ListSnoozesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * `Snooze`s matching this list call. + * + * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; + */ + private $snoozes; + /** + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * + * 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 array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $snoozes + * `Snooze`s matching this list call. + * @type string $next_page_token + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * `Snooze`s matching this list call. + * + * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnoozes() + { + return $this->snoozes; + } + + /** + * `Snooze`s matching this list call. + * + * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; + * @param array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnoozes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Snooze::class); + $this->snoozes = $arr; + + return $this; + } + + /** + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * + * 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..0b123db098c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php @@ -0,0 +1,501 @@ +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 = ''; + + /** + * @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] + * Please see {@see MetricServiceClient::workspaceName()} for help formatting this field. + * @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 \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. + * @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} + * + * @return \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest + * + * @experimental + */ + public static function build(string $name, string $filter, \Google\Cloud\Monitoring\V3\TimeInterval $interval, int $view): self + { + return (new self()) + ->setName($name) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + } + + /** + * 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..cd4d2c1bcc5 --- /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/ListTimeSeriesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php new file mode 100644 index 00000000000..f2d874bd347 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php @@ -0,0 +1,201 @@ +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 array<\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 array<\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 array<\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 array<\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..0718e498334 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php @@ -0,0 +1,230 @@ +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 = ''; + /** + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * 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 = ''; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 string $filter + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * @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; + } + + /** + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * + * 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; + } + + /** + * 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..f12354762fe --- /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 array<\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 array<\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..26da2fcdd61 --- /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 array<\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 array<\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/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..0ef18788e23 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php @@ -0,0 +1,594 @@ +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 array<\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 array<\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..f9e6c8c2714 --- /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 array<\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 array|\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 array<\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 array|\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/Point.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php new file mode 100644 index 00000000000..5db4ed6c5b7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php @@ -0,0 +1,153 @@ +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..95542afd49b --- /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 array<\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 array<\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/QueryTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php new file mode 100644 index 00000000000..05eb26d2f95 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php @@ -0,0 +1,197 @@ +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..79b8487cb24 --- /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 array<\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 array<\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 array<\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 array<\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..efa0e97e35b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php @@ -0,0 +1,81 @@ +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 = ''; + + /** + * @param string $name Required. The notification channel to which to send a verification code. Please see + * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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/ServiceTier.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php new file mode 100644 index 00000000000..90668230848 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php @@ -0,0 +1,74 @@ +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 Cloud Monitoring 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 Cloud Monitoring Premium tier, a higher, more expensive tier of service + * that provides access to all Cloud Monitoring features, lets you use Cloud + * Monitoring 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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php new file mode 100644 index 00000000000..972f136cc0c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php @@ -0,0 +1,224 @@ +google.monitoring.v3.Snooze + */ +class Snooze extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * + * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $criteria = null; + /** + * Required. The `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interval = null; + /** + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * @type \Google\Cloud\Monitoring\V3\Snooze\Criteria $criteria + * Required. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * @type \Google\Cloud\Monitoring\V3\TimeInterval $interval + * Required. The `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * @type string $display_name + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * + * 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. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * + * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Snooze\Criteria|null + */ + public function getCriteria() + { + return $this->criteria; + } + + public function hasCriteria() + { + return isset($this->criteria); + } + + public function clearCriteria() + { + unset($this->criteria); + } + + /** + * Required. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * + * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Snooze\Criteria $var + * @return $this + */ + public function setCriteria($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze\Criteria::class); + $this->criteria = $var; + + return $this; + } + + /** + * Required. The `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * + * 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 `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * + * 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; + } + + /** + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php new file mode 100644 index 00000000000..13e62c6c185 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php @@ -0,0 +1,88 @@ +google.monitoring.v3.Snooze.Criteria + */ +class Criteria extends \Google\Protobuf\Internal\Message +{ + /** + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * + * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { + */ + private $policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $policies + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); + parent::__construct($data); + } + + /** + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * + * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicies() + { + return $this->policies; + } + + /** + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * + * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->policies = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Criteria::class, \Google\Cloud\Monitoring\V3\Snooze_Criteria::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php new file mode 100644 index 00000000000..cfeb31ba834 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php @@ -0,0 +1,91 @@ +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/TimeInterval.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php new file mode 100644 index 00000000000..1869cd41c8a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php @@ -0,0 +1,165 @@ +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..884802d3cdc --- /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 array<\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 array<\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..4c91cd6c80a --- /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 array<\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 array<\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 array<\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 array<\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..9aa86421aa7 --- /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 array<\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 array<\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/TimeSeriesDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php new file mode 100644 index 00000000000..ec714c4abc2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php @@ -0,0 +1,101 @@ +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 array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $label_descriptors + * Descriptors for the labels. + * @type array<\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 array<\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 array<\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/TimeSeriesRatio.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php new file mode 100644 index 00000000000..bbd4edb9bac --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php @@ -0,0 +1,180 @@ +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..2e02f8c2541 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php @@ -0,0 +1,239 @@ +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; + + /** + * @param \Google\Protobuf\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. + * @param \Google\Cloud\Monitoring\V3\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. + * + * @return \Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest + * + * @experimental + */ + public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self + { + return (new self()) + ->setUpdateMask($updateMask) + ->setAlertPolicy($alertPolicy); + } + + /** + * 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..1acaca5a69d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php @@ -0,0 +1,134 @@ +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; + + /** + * @param \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. + * + * @return \Google\Cloud\Monitoring\V3\UpdateGroupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\Group $group): self + { + return (new self()) + ->setGroup($group); + } + + /** + * 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..6528f4c7e50 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php @@ -0,0 +1,151 @@ +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; + + /** + * @param \Google\Protobuf\FieldMask $updateMask The fields to update. + * @param \Google\Cloud\Monitoring\V3\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`. + * + * @return \Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest + * + * @experimental + */ + public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self + { + return (new self()) + ->setUpdateMask($updateMask) + ->setNotificationChannel($notificationChannel); + } + + /** + * 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..c6521c3f2a3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php @@ -0,0 +1,139 @@ +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; + + /** + * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * + * @return \Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self + { + return (new self()) + ->setServiceLevelObjective($serviceLevelObjective); + } + + /** + * 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..c672ae081a8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php @@ -0,0 +1,139 @@ +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; + + /** + * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * + * @return \Google\Cloud\Monitoring\V3\UpdateServiceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\Service $service): self + { + return (new self()) + ->setService($service); + } + + /** + * 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/UpdateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php new file mode 100644 index 00000000000..d3091d8bda9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php @@ -0,0 +1,227 @@ +google.monitoring.v3.UpdateSnoozeRequest + */ +class UpdateSnoozeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `Snooze` to update. Must have the name field present. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snooze = null; + /** + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to update. Must have the name field present. + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to update. + * + * For each field listed in `update_mask`: + * + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * + * Fields not listed retain their existing value. + * + * The following are the field names that are accepted in `update_mask`: + * + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * @return \Google\Cloud\Monitoring\V3\UpdateSnoozeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\Snooze $snooze, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\Snooze $snooze + * Required. The `Snooze` to update. Must have the name field present. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `Snooze` to update. Must have the name field present. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Snooze|null + */ + public function getSnooze() + { + return $this->snooze; + } + + public function hasSnooze() + { + return isset($this->snooze); + } + + public function clearSnooze() + { + unset($this->snooze); + } + + /** + * Required. The `Snooze` to update. Must have the name field present. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Snooze $var + * @return $this + */ + public function setSnooze($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); + $this->snooze = $var; + + return $this; + } + + /** + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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..151f4486915 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php @@ -0,0 +1,192 @@ +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 corresponding 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; + + /** + * @param \Google\Cloud\Monitoring\V3\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 corresponding 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`. + * + * @return \Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self + { + return (new self()) + ->setUptimeCheckConfig($uptimeCheckConfig); + } + + /** + * 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 corresponding 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 corresponding 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 corresponding 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..10904aecc43 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php @@ -0,0 +1,711 @@ +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 Cloud Monitoring 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 type of checkers to use to execute the Uptime check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; + */ + protected $checker_type = 0; + /** + * 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; + /** + * User-supplied key/value data to be used for organizing and + * identifying the `UptimeCheckConfig` 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 = 20; + */ + private $user_labels; + 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 Cloud Monitoring 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` + * `servicedirectory_service` + * `cloud_run_revision` + * @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 array<\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 $checker_type + * The type of checkers to use to execute the Uptime check. + * @type array|\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 array<\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`. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * User-supplied key/value data to be used for organizing and + * identifying the `UptimeCheckConfig` 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. + * } + */ + 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 Cloud Monitoring 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 Cloud Monitoring 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` + * `servicedirectory_service` + * `cloud_run_revision` + * + * 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` + * `servicedirectory_service` + * `cloud_run_revision` + * + * 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 array<\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 type of checkers to use to execute the Uptime check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; + * @return int + */ + public function getCheckerType() + { + return $this->checker_type; + } + + /** + * The type of checkers to use to execute the Uptime check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; + * @param int $var + * @return $this + */ + public function setCheckerType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\CheckerType::class); + $this->checker_type = $var; + + 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 array|\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 array<\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; + } + + /** + * User-supplied key/value data to be used for organizing and + * identifying the `UptimeCheckConfig` 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 = 20; + * @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 `UptimeCheckConfig` 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 = 20; + * @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 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/CheckerType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php new file mode 100644 index 00000000000..e97a33453e2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php @@ -0,0 +1,69 @@ +google.monitoring.v3.UptimeCheckConfig.CheckerType + */ +class CheckerType +{ + /** + * The default checker type. Currently converted to `STATIC_IP_CHECKERS` + * on creation, the default conversion behavior may change in the future. + * + * Generated from protobuf enum CHECKER_TYPE_UNSPECIFIED = 0; + */ + const CHECKER_TYPE_UNSPECIFIED = 0; + /** + * `STATIC_IP_CHECKERS` are used for uptime checks that perform egress + * across the public internet. `STATIC_IP_CHECKERS` use the static IP + * addresses returned by `ListUptimeCheckIps`. + * + * Generated from protobuf enum STATIC_IP_CHECKERS = 1; + */ + const STATIC_IP_CHECKERS = 1; + /** + * `VPC_CHECKERS` are used for uptime checks that perform egress using + * Service Directory and private network access. When using `VPC_CHECKERS`, + * the monitored resource type must be `servicedirectory_service`. + * + * Generated from protobuf enum VPC_CHECKERS = 3; + */ + const VPC_CHECKERS = 3; + + private static $valueToName = [ + self::CHECKER_TYPE_UNSPECIFIED => 'CHECKER_TYPE_UNSPECIFIED', + self::STATIC_IP_CHECKERS => 'STATIC_IP_CHECKERS', + self::VPC_CHECKERS => 'VPC_CHECKERS', + ]; + + 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(CheckerType::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_CheckerType::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..6c5646dbef8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php @@ -0,0 +1,158 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher + */ +class ContentMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * String, regex or JSON 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; + protected $additional_matcher_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * String, regex or JSON 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. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $json_path_matcher + * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * String, regex or JSON 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, regex or JSON 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; + } + + /** + * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher|null + */ + public function getJsonPathMatcher() + { + return $this->readOneof(3); + } + + public function hasJsonPathMatcher() + { + return $this->hasOneof(3); + } + + /** + * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $var + * @return $this + */ + public function setJsonPathMatcher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAdditionalMatcherInfo() + { + return $this->whichOneof("additional_matcher_info"); + } + +} + +// 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..3dffeaa7586 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php @@ -0,0 +1,107 @@ +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 if 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; + /** + * Selects JSONPath matching. See `JsonPathMatcher` for details on when + * the match succeeds. JSONPath matching is only supported for HTTP/HTTPS + * checks. + * + * Generated from protobuf enum MATCHES_JSON_PATH = 5; + */ + const MATCHES_JSON_PATH = 5; + /** + * Selects JSONPath matching. See `JsonPathMatcher` for details on when + * the match succeeds. Succeeds when output does _NOT_ match as specified. + * JSONPath is only supported for HTTP/HTTPS checks. + * + * Generated from protobuf enum NOT_MATCHES_JSON_PATH = 6; + */ + const NOT_MATCHES_JSON_PATH = 6; + + 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', + self::MATCHES_JSON_PATH => 'MATCHES_JSON_PATH', + self::NOT_MATCHES_JSON_PATH => 'NOT_MATCHES_JSON_PATH', + ]; + + 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/ContentMatcher/JsonPathMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php new file mode 100644 index 00000000000..04e6f363bfa --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php @@ -0,0 +1,114 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher + */ +class JsonPathMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * + * Generated from protobuf field string json_path = 1; + */ + protected $json_path = ''; + /** + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; + */ + protected $json_matcher = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $json_path + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * @type int $json_matcher + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * + * Generated from protobuf field string json_path = 1; + * @return string + */ + public function getJsonPath() + { + return $this->json_path; + } + + /** + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * + * Generated from protobuf field string json_path = 1; + * @param string $var + * @return $this + */ + public function setJsonPath($var) + { + GPBUtil::checkString($var, True); + $this->json_path = $var; + + return $this; + } + + /** + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; + * @return int + */ + public function getJsonMatcher() + { + return $this->json_matcher; + } + + /** + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; + * @param int $var + * @return $this + */ + public function setJsonMatcher($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher\JsonPathMatcherOption::class); + $this->json_matcher = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(JsonPathMatcher::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php new file mode 100644 index 00000000000..965725688ee --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php @@ -0,0 +1,68 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption + */ +class JsonPathMatcherOption +{ + /** + * No JSONPath matcher type specified (not valid). + * + * Generated from protobuf enum JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; + */ + const JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; + /** + * Selects 'exact string' matching. The match succeeds if the content at + * the `json_path` within the output is exactly the same as the + * `content` string. + * + * Generated from protobuf enum EXACT_MATCH = 1; + */ + const EXACT_MATCH = 1; + /** + * Selects regular-expression matching. The match succeeds if the + * content at the `json_path` within the output matches the regular + * expression specified in the `content` string. + * + * Generated from protobuf enum REGEX_MATCH = 2; + */ + const REGEX_MATCH = 2; + + private static $valueToName = [ + self::JSON_PATH_MATCHER_OPTION_UNSPECIFIED => 'JSON_PATH_MATCHER_OPTION_UNSPECIFIED', + self::EXACT_MATCH => 'EXACT_MATCH', + self::REGEX_MATCH => 'REGEX_MATCH', + ]; + + 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(JsonPathMatcherOption::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption::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..e158f367c01 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php @@ -0,0 +1,678 @@ +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; + /** + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * + * Generated from protobuf field string custom_content_type = 13; + */ + protected $custom_content_type = ''; + /** + * 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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * + * Generated from protobuf field bytes body = 10; + */ + protected $body = ''; + /** + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; + */ + private $accepted_response_status_codes; + /** + * Contains information needed to add pings to an HTTP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; + */ + protected $ping_config = null; + + /** + * 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 string $custom_content_type + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * @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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * @type array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $accepted_response_status_codes + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config + * Contains information needed to add pings to an HTTP check. + * } + */ + 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; + } + + /** + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * + * Generated from protobuf field string custom_content_type = 13; + * @return string + */ + public function getCustomContentType() + { + return $this->custom_content_type; + } + + /** + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * + * Generated from protobuf field string custom_content_type = 13; + * @param string $var + * @return $this + */ + public function setCustomContentType($var) + { + GPBUtil::checkString($var, True); + $this->custom_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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * + * 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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * + * 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; + } + + /** + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAcceptedResponseStatusCodes() + { + return $this->accepted_response_status_codes; + } + + /** + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; + * @param array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAcceptedResponseStatusCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode::class); + $this->accepted_response_status_codes = $arr; + + return $this; + } + + /** + * Contains information needed to add pings to an HTTP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null + */ + public function getPingConfig() + { + return $this->ping_config; + } + + public function hasPingConfig() + { + return isset($this->ping_config); + } + + public function clearPingConfig() + { + unset($this->ping_config); + } + + /** + * Contains information needed to add pings to an HTTP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var + * @return $this + */ + public function setPingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); + $this->ping_config = $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..7eeb5f3ad04 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php @@ -0,0 +1,67 @@ +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; + /** + * `body` is in `custom_content_type` form. Equivalent to setting the + * `Content-Type` to the contents of `custom_content_type` in the HTTP + * request. + * + * Generated from protobuf enum USER_PROVIDED = 2; + */ + const USER_PROVIDED = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::URL_ENCODED => 'URL_ENCODED', + self::USER_PROVIDED => 'USER_PROVIDED', + ]; + + 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/HttpCheck/ResponseStatusCode.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php new file mode 100644 index 00000000000..61fe31c3dab --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php @@ -0,0 +1,112 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode + */ +class ResponseStatusCode extends \Google\Protobuf\Internal\Message +{ + protected $status_code; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $status_value + * A status code to accept. + * @type int $status_class + * A class of status codes to accept. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * A status code to accept. + * + * Generated from protobuf field int32 status_value = 1; + * @return int + */ + public function getStatusValue() + { + return $this->readOneof(1); + } + + public function hasStatusValue() + { + return $this->hasOneof(1); + } + + /** + * A status code to accept. + * + * Generated from protobuf field int32 status_value = 1; + * @param int $var + * @return $this + */ + public function setStatusValue($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A class of status codes to accept. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; + * @return int + */ + public function getStatusClass() + { + return $this->readOneof(2); + } + + public function hasStatusClass() + { + return $this->hasOneof(2); + } + + /** + * A class of status codes to accept. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; + * @param int $var + * @return $this + */ + public function setStatusClass($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode\StatusClass::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getStatusCode() + { + return $this->whichOneof("status_code"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResponseStatusCode::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php new file mode 100644 index 00000000000..ec9ccc03c04 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php @@ -0,0 +1,92 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass + */ +class StatusClass +{ + /** + * Default value that matches no status codes. + * + * Generated from protobuf enum STATUS_CLASS_UNSPECIFIED = 0; + */ + const STATUS_CLASS_UNSPECIFIED = 0; + /** + * The class of status codes between 100 and 199. + * + * Generated from protobuf enum STATUS_CLASS_1XX = 100; + */ + const STATUS_CLASS_1XX = 100; + /** + * The class of status codes between 200 and 299. + * + * Generated from protobuf enum STATUS_CLASS_2XX = 200; + */ + const STATUS_CLASS_2XX = 200; + /** + * The class of status codes between 300 and 399. + * + * Generated from protobuf enum STATUS_CLASS_3XX = 300; + */ + const STATUS_CLASS_3XX = 300; + /** + * The class of status codes between 400 and 499. + * + * Generated from protobuf enum STATUS_CLASS_4XX = 400; + */ + const STATUS_CLASS_4XX = 400; + /** + * The class of status codes between 500 and 599. + * + * Generated from protobuf enum STATUS_CLASS_5XX = 500; + */ + const STATUS_CLASS_5XX = 500; + /** + * The class of all status codes. + * + * Generated from protobuf enum STATUS_CLASS_ANY = 1000; + */ + const STATUS_CLASS_ANY = 1000; + + private static $valueToName = [ + self::STATUS_CLASS_UNSPECIFIED => 'STATUS_CLASS_UNSPECIFIED', + self::STATUS_CLASS_1XX => 'STATUS_CLASS_1XX', + self::STATUS_CLASS_2XX => 'STATUS_CLASS_2XX', + self::STATUS_CLASS_3XX => 'STATUS_CLASS_3XX', + self::STATUS_CLASS_4XX => 'STATUS_CLASS_4XX', + self::STATUS_CLASS_5XX => 'STATUS_CLASS_5XX', + self::STATUS_CLASS_ANY => 'STATUS_CLASS_ANY', + ]; + + 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(StatusClass::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php new file mode 100644 index 00000000000..ae85d7f1047 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php @@ -0,0 +1,72 @@ +google.monitoring.v3.UptimeCheckConfig.PingConfig + */ +class PingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * + * Generated from protobuf field int32 pings_count = 1; + */ + protected $pings_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $pings_count + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * + * Generated from protobuf field int32 pings_count = 1; + * @return int + */ + public function getPingsCount() + { + return $this->pings_count; + } + + /** + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * + * Generated from protobuf field int32 pings_count = 1; + * @param int $var + * @return $this + */ + public function setPingsCount($var) + { + GPBUtil::checkInt32($var); + $this->pings_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PingConfig::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_PingConfig::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..09c0668c3b3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php @@ -0,0 +1,122 @@ +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; + /** + * Contains information needed to add pings to a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; + */ + protected $ping_config = null; + + /** + * 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. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config + * Contains information needed to add pings to a TCP check. + * } + */ + 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; + } + + /** + * Contains information needed to add pings to a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null + */ + public function getPingConfig() + { + return $this->ping_config; + } + + public function hasPingConfig() + { + return isset($this->ping_config); + } + + public function clearPingConfig() + { + unset($this->ping_config); + } + + /** + * Contains information needed to add pings to a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var + * @return $this + */ + public function setPingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); + $this->ping_config = $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/UptimeCheckIp.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php new file mode 100644 index 00000000000..8eb3b2a696b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php @@ -0,0 +1,160 @@ +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..8524b68cf0f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php @@ -0,0 +1,102 @@ +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; + /** + * Allows checks to run from locations within the western United States of + * America + * + * Generated from protobuf enum USA_OREGON = 5; + */ + const USA_OREGON = 5; + /** + * Allows checks to run from locations within the central United States of + * America + * + * Generated from protobuf enum USA_IOWA = 6; + */ + const USA_IOWA = 6; + /** + * Allows checks to run from locations within the eastern United States of + * America + * + * Generated from protobuf enum USA_VIRGINIA = 7; + */ + const USA_VIRGINIA = 7; + + private static $valueToName = [ + self::REGION_UNSPECIFIED => 'REGION_UNSPECIFIED', + self::USA => 'USA', + self::EUROPE => 'EUROPE', + self::SOUTH_AMERICA => 'SOUTH_AMERICA', + self::ASIA_PACIFIC => 'ASIA_PACIFIC', + self::USA_OREGON => 'USA_OREGON', + self::USA_IOWA => 'USA_IOWA', + self::USA_VIRGINIA => 'USA_VIRGINIA', + ]; + + 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/VerifyNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php new file mode 100644 index 00000000000..95410209d06 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php @@ -0,0 +1,147 @@ +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 = ''; + + /** + * @param string $name Required. The notification channel to verify. Please see + * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * @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). + * + * @return \Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name, string $code): self + { + return (new self()) + ->setName($name) + ->setCode($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/samples/V3/AlertPolicyServiceClient/create_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php new file mode 100644 index 00000000000..8da94f5c6a8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php @@ -0,0 +1,88 @@ +setName($name) + ->setAlertPolicy($alertPolicy); + + // Call the API and handle any network failures. + try { + /** @var AlertPolicy $response */ + $response = $alertPolicyServiceClient->createAlertPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_alert_policy_sample($name); +} +// [END monitoring_v3_generated_AlertPolicyService_CreateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php new file mode 100644 index 00000000000..20341bb9ced --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $alertPolicyServiceClient->deleteAlertPolicy($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + + delete_alert_policy_sample($formattedName); +} +// [END monitoring_v3_generated_AlertPolicyService_DeleteAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php new file mode 100644 index 00000000000..a6b8ef21ad6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AlertPolicy $response */ + $response = $alertPolicyServiceClient->getAlertPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + + get_alert_policy_sample($formattedName); +} +// [END monitoring_v3_generated_AlertPolicyService_GetAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php new file mode 100644 index 00000000000..dc60fddad14 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php @@ -0,0 +1,85 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alertPolicyServiceClient->listAlertPolicies($request); + + /** @var AlertPolicy $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_alert_policies_sample($name); +} +// [END monitoring_v3_generated_AlertPolicyService_ListAlertPolicies_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php new file mode 100644 index 00000000000..d4f9c5060ec --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php @@ -0,0 +1,66 @@ +setAlertPolicy($alertPolicy); + + // Call the API and handle any network failures. + try { + /** @var AlertPolicy $response */ + $response = $alertPolicyServiceClient->updateAlertPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_AlertPolicyService_UpdateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php new file mode 100644 index 00000000000..5662f185f72 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php @@ -0,0 +1,76 @@ +setName($name) + ->setGroup($group); + + // Call the API and handle any network failures. + try { + /** @var Group $response */ + $response = $groupServiceClient->createGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_group_sample($name); +} +// [END monitoring_v3_generated_GroupService_CreateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php new file mode 100644 index 00000000000..2b0b5d393b3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $groupServiceClient->deleteGroup($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); + + delete_group_sample($formattedName); +} +// [END monitoring_v3_generated_GroupService_DeleteGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php new file mode 100644 index 00000000000..59d00116484 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Group $response */ + $response = $groupServiceClient->getGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); + + get_group_sample($formattedName); +} +// [END monitoring_v3_generated_GroupService_GetGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php new file mode 100644 index 00000000000..810ef1fb51c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $groupServiceClient->listGroupMembers($request); + + /** @var MonitoredResource $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); + + list_group_members_sample($formattedName); +} +// [END monitoring_v3_generated_GroupService_ListGroupMembers_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php new file mode 100644 index 00000000000..073f54a6f17 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $groupServiceClient->listGroups($request); + + /** @var Group $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_groups_sample($name); +} +// [END monitoring_v3_generated_GroupService_ListGroups_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php new file mode 100644 index 00000000000..58d8ed1e52b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php @@ -0,0 +1,60 @@ +setGroup($group); + + // Call the API and handle any network failures. + try { + /** @var Group $response */ + $response = $groupServiceClient->updateGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_GroupService_UpdateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php new file mode 100644 index 00000000000..c54f10ba5a8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php @@ -0,0 +1,81 @@ +setName($name) + ->setMetricDescriptor($metricDescriptor); + + // Call the API and handle any network failures. + try { + /** @var MetricDescriptor $response */ + $response = $metricServiceClient->createMetricDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_metric_descriptor_sample($name); +} +// [END monitoring_v3_generated_MetricService_CreateMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php new file mode 100644 index 00000000000..3676da8a884 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php @@ -0,0 +1,84 @@ +setName($formattedName) + ->setTimeSeries($timeSeries); + + // Call the API and handle any network failures. + try { + $metricServiceClient->createServiceTimeSeries($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::projectName('[PROJECT]'); + + create_service_time_series_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_CreateServiceTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php new file mode 100644 index 00000000000..943e3d74156 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php @@ -0,0 +1,82 @@ +setName($formattedName) + ->setTimeSeries($timeSeries); + + // Call the API and handle any network failures. + try { + $metricServiceClient->createTimeSeries($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::projectName('[PROJECT]'); + + create_time_series_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_CreateTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php new file mode 100644 index 00000000000..5be71ec658a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $metricServiceClient->deleteMetricDescriptor($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + + delete_metric_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_DeleteMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php new file mode 100644 index 00000000000..f1733d7ebcf --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var MetricDescriptor $response */ + $response = $metricServiceClient->getMetricDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + + get_metric_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_GetMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php new file mode 100644 index 00000000000..b80928f31d4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var MonitoredResourceDescriptor $response */ + $response = $metricServiceClient->getMonitoredResourceDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::monitoredResourceDescriptorName( + '[PROJECT]', + '[MONITORED_RESOURCE_DESCRIPTOR]' + ); + + get_monitored_resource_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_GetMonitoredResourceDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php new file mode 100644 index 00000000000..2a60d376cdf --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $metricServiceClient->listMetricDescriptors($request); + + /** @var MetricDescriptor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_metric_descriptors_sample($name); +} +// [END monitoring_v3_generated_MetricService_ListMetricDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php new file mode 100644 index 00000000000..8594af87cfc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $metricServiceClient->listMonitoredResourceDescriptors($request); + + /** @var MonitoredResourceDescriptor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_monitored_resource_descriptors_sample($name); +} +// [END monitoring_v3_generated_MetricService_ListMonitoredResourceDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php new file mode 100644 index 00000000000..2d408169cc2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php @@ -0,0 +1,99 @@ +setName($formattedName) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $metricServiceClient->listTimeSeries($request); + + /** @var TimeSeries $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::workspaceName('[PROJECT]'); + $filter = '[FILTER]'; + $view = TimeSeriesView::FULL; + + list_time_series_sample($formattedName, $filter, $view); +} +// [END monitoring_v3_generated_MetricService_ListTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php new file mode 100644 index 00000000000..4e2647ee023 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php @@ -0,0 +1,87 @@ +setName($name) + ->setNotificationChannel($notificationChannel); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->createNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_notification_channel_sample($name); +} +// [END monitoring_v3_generated_NotificationChannelService_CreateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php new file mode 100644 index 00000000000..1af1aacc41e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $notificationChannelServiceClient->deleteNotificationChannel($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + delete_notification_channel_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_DeleteNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php new file mode 100644 index 00000000000..a1efeebeec4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->getNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + get_notification_channel_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php new file mode 100644 index 00000000000..3f4bc0a7731 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannelDescriptor $response */ + $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelDescriptorName( + '[PROJECT]', + '[CHANNEL_DESCRIPTOR]' + ); + + get_notification_channel_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php new file mode 100644 index 00000000000..a63472001e2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php @@ -0,0 +1,96 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var GetNotificationChannelVerificationCodeResponse $response */ + $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + get_notification_channel_verification_code_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php new file mode 100644 index 00000000000..0382fad734f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php @@ -0,0 +1,86 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $notificationChannelServiceClient->listNotificationChannelDescriptors($request); + + /** @var NotificationChannelDescriptor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_notification_channel_descriptors_sample($name); +} +// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannelDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php new file mode 100644 index 00000000000..4a236f89c3a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php @@ -0,0 +1,88 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $notificationChannelServiceClient->listNotificationChannels($request); + + /** @var NotificationChannel $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_notification_channels_sample($name); +} +// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannels_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php new file mode 100644 index 00000000000..b8810b7a301 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $notificationChannelServiceClient->sendNotificationChannelVerificationCode($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + send_notification_channel_verification_code_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_SendNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php new file mode 100644 index 00000000000..ad79286eff6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php @@ -0,0 +1,65 @@ +setNotificationChannel($notificationChannel); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->updateNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_NotificationChannelService_UpdateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php new file mode 100644 index 00000000000..7603415aff5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php @@ -0,0 +1,85 @@ +setName($formattedName) + ->setCode($code); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->verifyNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + $code = '[CODE]'; + + verify_notification_channel_sample($formattedName, $code); +} +// [END monitoring_v3_generated_NotificationChannelService_VerifyNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php new file mode 100644 index 00000000000..c9e9a6166ae --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php @@ -0,0 +1,84 @@ +setName($name) + ->setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $queryServiceClient->queryTimeSeries($request); + + /** @var TimeSeriesData $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $query = '[QUERY]'; + + query_time_series_sample($name, $query); +} +// [END monitoring_v3_generated_QueryService_QueryTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php new file mode 100644 index 00000000000..f1cd6dae994 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php @@ -0,0 +1,76 @@ +setParent($parent) + ->setService($service); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $serviceMonitoringServiceClient->createService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + create_service_sample($parent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_CreateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php new file mode 100644 index 00000000000..2559795e52e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php @@ -0,0 +1,75 @@ +setParent($formattedParent) + ->setServiceLevelObjective($serviceLevelObjective); + + // Call the API and handle any network failures. + try { + /** @var ServiceLevelObjective $response */ + $response = $serviceMonitoringServiceClient->createServiceLevelObjective($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + create_service_level_objective_sample($formattedParent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php new file mode 100644 index 00000000000..dd319f9e610 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $serviceMonitoringServiceClient->deleteService($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + delete_service_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_DeleteService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php new file mode 100644 index 00000000000..ca3c8187246 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $serviceMonitoringServiceClient->deleteServiceLevelObjective($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + + delete_service_level_objective_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_DeleteServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php new file mode 100644 index 00000000000..cb12b2fcac7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $serviceMonitoringServiceClient->getService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + get_service_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_GetService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php new file mode 100644 index 00000000000..7bc8c814262 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ServiceLevelObjective $response */ + $response = $serviceMonitoringServiceClient->getServiceLevelObjective($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + + get_service_level_objective_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_GetServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php new file mode 100644 index 00000000000..4476bfaaafd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $serviceMonitoringServiceClient->listServiceLevelObjectives($request); + + /** @var ServiceLevelObjective $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + list_service_level_objectives_sample($formattedParent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_ListServiceLevelObjectives_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php new file mode 100644 index 00000000000..f1495ce77ad --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php @@ -0,0 +1,80 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $serviceMonitoringServiceClient->listServices($request); + + /** @var Service $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_services_sample($parent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_ListServices_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php new file mode 100644 index 00000000000..1a9fbecdfd9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php @@ -0,0 +1,59 @@ +setService($service); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $serviceMonitoringServiceClient->updateService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_ServiceMonitoringService_UpdateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php new file mode 100644 index 00000000000..30611bd57c1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php @@ -0,0 +1,59 @@ +setServiceLevelObjective($serviceLevelObjective); + + // Call the API and handle any network failures. + try { + /** @var ServiceLevelObjective $response */ + $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_ServiceMonitoringService_UpdateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php new file mode 100644 index 00000000000..f16d2759dbb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php @@ -0,0 +1,99 @@ +setName($snoozeName) + ->setCriteria($snoozeCriteria) + ->setInterval($snoozeInterval) + ->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + + // Call the API and handle any network failures. + try { + /** @var Snooze $response */ + $response = $snoozeServiceClient->createSnooze($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); + $snoozeName = '[NAME]'; + $snoozeDisplayName = '[DISPLAY_NAME]'; + + create_snooze_sample($formattedParent, $snoozeName, $snoozeDisplayName); +} +// [END monitoring_v3_generated_SnoozeService_CreateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php new file mode 100644 index 00000000000..cf467e5c3c3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Snooze $response */ + $response = $snoozeServiceClient->getSnooze($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SnoozeServiceClient::snoozeName('[PROJECT]', '[SNOOZE]'); + + get_snooze_sample($formattedName); +} +// [END monitoring_v3_generated_SnoozeService_GetSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php new file mode 100644 index 00000000000..f0fb94d6601 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $snoozeServiceClient->listSnoozes($request); + + /** @var Snooze $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); + + list_snoozes_sample($formattedParent); +} +// [END monitoring_v3_generated_SnoozeService_ListSnoozes_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php new file mode 100644 index 00000000000..2fa14b61a73 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php @@ -0,0 +1,90 @@ +setName($snoozeName) + ->setCriteria($snoozeCriteria) + ->setInterval($snoozeInterval) + ->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateSnoozeRequest()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Snooze $response */ + $response = $snoozeServiceClient->updateSnooze($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $snoozeName = '[NAME]'; + $snoozeDisplayName = '[DISPLAY_NAME]'; + + update_snooze_sample($snoozeName, $snoozeDisplayName); +} +// [END monitoring_v3_generated_SnoozeService_UpdateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php new file mode 100644 index 00000000000..6ad37bedcda --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php @@ -0,0 +1,76 @@ +setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + + // Call the API and handle any network failures. + try { + /** @var UptimeCheckConfig $response */ + $response = $uptimeCheckServiceClient->createUptimeCheckConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + create_uptime_check_config_sample($parent); +} +// [END monitoring_v3_generated_UptimeCheckService_CreateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php new file mode 100644 index 00000000000..d33f28aec3e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $uptimeCheckServiceClient->deleteUptimeCheckConfig($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( + '[PROJECT]', + '[UPTIME_CHECK_CONFIG]' + ); + + delete_uptime_check_config_sample($formattedName); +} +// [END monitoring_v3_generated_UptimeCheckService_DeleteUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php new file mode 100644 index 00000000000..a3dbc0e2c41 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var UptimeCheckConfig $response */ + $response = $uptimeCheckServiceClient->getUptimeCheckConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( + '[PROJECT]', + '[UPTIME_CHECK_CONFIG]' + ); + + get_uptime_check_config_sample($formattedName); +} +// [END monitoring_v3_generated_UptimeCheckService_GetUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php new file mode 100644 index 00000000000..7a681db4527 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php @@ -0,0 +1,80 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $uptimeCheckServiceClient->listUptimeCheckConfigs($request); + + /** @var UptimeCheckConfig $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_uptime_check_configs_sample($parent); +} +// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckConfigs_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php new file mode 100644 index 00000000000..9d96322e41f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php @@ -0,0 +1,62 @@ +listUptimeCheckIps($request); + + /** @var UptimeCheckIp $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckIps_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php new file mode 100644 index 00000000000..cdef12857a2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php @@ -0,0 +1,62 @@ +setUptimeCheckConfig($uptimeCheckConfig); + + // Call the API and handle any network failures. + try { + /** @var UptimeCheckConfig $response */ + $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_UptimeCheckService_UpdateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php new file mode 100644 index 00000000000..66d3410ff0c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php @@ -0,0 +1,34 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('alertPolicy')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted alert_policy_condition resource. + */ + public static function alertPolicyConditionName(string $project, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('alertPolicyCondition')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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(string $folder, string $alertPolicy): string + { + return self::getPathTemplate('folderAlertPolicy')->render([ + 'folder' => $folder, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_alert_policy_condition resource. + * + * @param string $folder + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted folder_alert_policy_condition resource. + */ + public static function folderAlertPolicyConditionName(string $folder, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('folderAlertPolicyCondition')->render([ + 'folder' => $folder, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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(string $organization, string $alertPolicy): string + { + return self::getPathTemplate('organizationAlertPolicy')->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_alert_policy_condition resource. + * + * @param string $organization + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted organization_alert_policy_condition resource. + */ + public static function organizationAlertPolicyConditionName(string $organization, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('organizationAlertPolicyCondition')->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('projectAlertPolicy')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted project_alert_policy_condition resource. + */ + public static function projectAlertPolicyConditionName(string $project, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('projectAlertPolicyCondition')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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} + * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * + * 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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new alerting policy. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * The async variant is {@see AlertPolicyServiceClient::createAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/create_alert_policy.php + * + * @param CreateAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AlertPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAlertPolicy(CreateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy + { + return $this->startApiCall('CreateAlertPolicy', $request, $callOptions)->wait(); + } + + /** + * Deletes an alerting policy. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * The async variant is {@see AlertPolicyServiceClient::deleteAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/delete_alert_policy.php + * + * @param DeleteAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAlertPolicy(DeleteAlertPolicyRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAlertPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets a single alerting policy. + * + * The async variant is {@see AlertPolicyServiceClient::getAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/get_alert_policy.php + * + * @param GetAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AlertPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAlertPolicy(GetAlertPolicyRequest $request, array $callOptions = []): AlertPolicy + { + return $this->startApiCall('GetAlertPolicy', $request, $callOptions)->wait(); + } + + /** + * Lists the existing alerting policies for the workspace. + * + * The async variant is {@see AlertPolicyServiceClient::listAlertPoliciesAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/list_alert_policies.php + * + * @param ListAlertPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAlertPolicies(ListAlertPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAlertPolicies', $request, $callOptions); + } + + /** + * 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * The async variant is {@see AlertPolicyServiceClient::updateAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/update_alert_policy.php + * + * @param UpdateAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AlertPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAlertPolicy(UpdateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy + { + return $this->startApiCall('UpdateAlertPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php new file mode 100644 index 00000000000..2f50d564b82 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php @@ -0,0 +1,444 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $group): string + { + return self::getPathTemplate('folderGroup')->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(string $project, string $group): string + { + return self::getPathTemplate('group')->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(string $organization, string $group): string + { + return self::getPathTemplate('organizationGroup')->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(string $project, string $group): string + { + return self::getPathTemplate('projectGroup')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new group. + * + * The async variant is {@see GroupServiceClient::createGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/create_group.php + * + * @param CreateGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Group + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGroup(CreateGroupRequest $request, array $callOptions = []): Group + { + return $this->startApiCall('CreateGroup', $request, $callOptions)->wait(); + } + + /** + * Deletes an existing group. + * + * The async variant is {@see GroupServiceClient::deleteGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/delete_group.php + * + * @param DeleteGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGroup(DeleteGroupRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteGroup', $request, $callOptions)->wait(); + } + + /** + * Gets a single group. + * + * The async variant is {@see GroupServiceClient::getGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/get_group.php + * + * @param GetGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Group + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGroup(GetGroupRequest $request, array $callOptions = []): Group + { + return $this->startApiCall('GetGroup', $request, $callOptions)->wait(); + } + + /** + * Lists the monitored resources that are members of a group. + * + * The async variant is {@see GroupServiceClient::listGroupMembersAsync()} . + * + * @example samples/V3/GroupServiceClient/list_group_members.php + * + * @param ListGroupMembersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGroupMembers(ListGroupMembersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGroupMembers', $request, $callOptions); + } + + /** + * Lists the existing groups. + * + * The async variant is {@see GroupServiceClient::listGroupsAsync()} . + * + * @example samples/V3/GroupServiceClient/list_groups.php + * + * @param ListGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGroups(ListGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGroups', $request, $callOptions); + } + + /** + * Updates an existing group. + * You can change any group attributes except `name`. + * + * The async variant is {@see GroupServiceClient::updateGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/update_group.php + * + * @param UpdateGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Group + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGroup(UpdateGroupRequest $request, array $callOptions = []): Group + { + return $this->startApiCall('UpdateGroup', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php new file mode 100644 index 00000000000..84d12bcedab --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php @@ -0,0 +1,675 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder): string + { + return self::getPathTemplate('folder')->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(string $folder, string $metricDescriptor): string + { + return self::getPathTemplate('folderMetricDescriptor')->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(string $folder, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('folderMonitoredResourceDescriptor')->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(string $project, string $metricDescriptor): string + { + return self::getPathTemplate('metricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('monitoredResourceDescriptor')->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(string $organization): string + { + return self::getPathTemplate('organization')->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(string $organization, string $metricDescriptor): string + { + return self::getPathTemplate('organizationMetricDescriptor')->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(string $organization, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('organizationMonitoredResourceDescriptor')->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(string $project): string + { + return self::getPathTemplate('project')->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(string $project, string $metricDescriptor): string + { + return self::getPathTemplate('projectMetricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('projectMonitoredResourceDescriptor')->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(string $project): string + { + return self::getPathTemplate('workspace')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new metric descriptor. + * The creation is executed asynchronously. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * The metric descriptor is updated if it already exists, + * except that metric labels are never removed. + * + * The async variant is {@see MetricServiceClient::createMetricDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/create_metric_descriptor.php + * + * @param CreateMetricDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MetricDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function createMetricDescriptor(CreateMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor + { + return $this->startApiCall('CreateMetricDescriptor', $request, $callOptions)->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. + * + * The async variant is {@see MetricServiceClient::createServiceTimeSeriesAsync()} + * . + * + * @example samples/V3/MetricServiceClient/create_service_time_series.php + * + * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function createServiceTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void + { + $this->startApiCall('CreateServiceTimeSeries', $request, $callOptions)->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. + * This method does not support + * [resource locations constraint of an organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + * + * The async variant is {@see MetricServiceClient::createTimeSeriesAsync()} . + * + * @example samples/V3/MetricServiceClient/create_time_series.php + * + * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void + { + $this->startApiCall('CreateTimeSeries', $request, $callOptions)->wait(); + } + + /** + * Deletes a metric descriptor. Only user-created + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + * deleted. + * + * The async variant is {@see MetricServiceClient::deleteMetricDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/delete_metric_descriptor.php + * + * @param DeleteMetricDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteMetricDescriptor(DeleteMetricDescriptorRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteMetricDescriptor', $request, $callOptions)->wait(); + } + + /** + * Gets a single metric descriptor. + * + * The async variant is {@see MetricServiceClient::getMetricDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/get_metric_descriptor.php + * + * @param GetMetricDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MetricDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMetricDescriptor(GetMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor + { + return $this->startApiCall('GetMetricDescriptor', $request, $callOptions)->wait(); + } + + /** + * Gets a single monitored resource descriptor. + * + * The async variant is + * {@see MetricServiceClient::getMonitoredResourceDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php + * + * @param GetMonitoredResourceDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MonitoredResourceDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest $request, array $callOptions = []): MonitoredResourceDescriptor + { + return $this->startApiCall('GetMonitoredResourceDescriptor', $request, $callOptions)->wait(); + } + + /** + * Lists metric descriptors that match a filter. + * + * The async variant is {@see MetricServiceClient::listMetricDescriptorsAsync()} . + * + * @example samples/V3/MetricServiceClient/list_metric_descriptors.php + * + * @param ListMetricDescriptorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMetricDescriptors(ListMetricDescriptorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMetricDescriptors', $request, $callOptions); + } + + /** + * Lists monitored resource descriptors that match a filter. + * + * The async variant is + * {@see MetricServiceClient::listMonitoredResourceDescriptorsAsync()} . + * + * @example samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php + * + * @param ListMonitoredResourceDescriptorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMonitoredResourceDescriptors', $request, $callOptions); + } + + /** + * Lists time series that match a filter. + * + * The async variant is {@see MetricServiceClient::listTimeSeriesAsync()} . + * + * @example samples/V3/MetricServiceClient/list_time_series.php + * + * @param ListTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTimeSeries(ListTimeSeriesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTimeSeries', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php new file mode 100644 index 00000000000..20f4631ad33 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php @@ -0,0 +1,679 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $channelDescriptor): string + { + return self::getPathTemplate('folderChannelDescriptor')->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(string $folder, string $notificationChannel): string + { + return self::getPathTemplate('folderNotificationChannel')->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(string $project, string $notificationChannel): string + { + return self::getPathTemplate('notificationChannel')->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(string $project, string $channelDescriptor): string + { + return self::getPathTemplate('notificationChannelDescriptor')->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(string $organization, string $channelDescriptor): string + { + return self::getPathTemplate('organizationChannelDescriptor')->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(string $organization, string $notificationChannel): string + { + return self::getPathTemplate('organizationNotificationChannel')->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(string $project, string $channelDescriptor): string + { + return self::getPathTemplate('projectChannelDescriptor')->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(string $project, string $notificationChannel): string + { + return self::getPathTemplate('projectNotificationChannel')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new notification channel, representing a single notification + * endpoint such as an email address, SMS number, or PagerDuty service. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * The async variant is + * {@see NotificationChannelServiceClient::createNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/create_notification_channel.php + * + * @param CreateNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function createNotificationChannel(CreateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('CreateNotificationChannel', $request, $callOptions)->wait(); + } + + /** + * Deletes a notification channel. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * The async variant is + * {@see NotificationChannelServiceClient::deleteNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/delete_notification_channel.php + * + * @param DeleteNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteNotificationChannel(DeleteNotificationChannelRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteNotificationChannel', $request, $callOptions)->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. + * + * The async variant is + * {@see NotificationChannelServiceClient::getNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/get_notification_channel.php + * + * @param GetNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNotificationChannel(GetNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('GetNotificationChannel', $request, $callOptions)->wait(); + } + + /** + * Gets a single channel descriptor. The descriptor indicates which fields + * are expected / permitted for a notification channel of the given type. + * + * The async variant is + * {@see NotificationChannelServiceClient::getNotificationChannelDescriptorAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php + * + * @param GetNotificationChannelDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannelDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNotificationChannelDescriptor(GetNotificationChannelDescriptorRequest $request, array $callOptions = []): NotificationChannelDescriptor + { + return $this->startApiCall('GetNotificationChannelDescriptor', $request, $callOptions)->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. + * + * The async variant is + * {@see NotificationChannelServiceClient::getNotificationChannelVerificationCodeAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php + * + * @param GetNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GetNotificationChannelVerificationCodeResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNotificationChannelVerificationCode(GetNotificationChannelVerificationCodeRequest $request, array $callOptions = []): GetNotificationChannelVerificationCodeResponse + { + return $this->startApiCall('GetNotificationChannelVerificationCode', $request, $callOptions)->wait(); + } + + /** + * Lists the descriptors for supported channel types. The use of descriptors + * makes it possible for new channel types to be dynamically added. + * + * The async variant is + * {@see NotificationChannelServiceClient::listNotificationChannelDescriptorsAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php + * + * @param ListNotificationChannelDescriptorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNotificationChannelDescriptors(ListNotificationChannelDescriptorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNotificationChannelDescriptors', $request, $callOptions); + } + + /** + * Lists the notification channels that have been created for the project. + * To list the types of notification channels that are supported, use + * the `ListNotificationChannelDescriptors` method. + * + * The async variant is + * {@see NotificationChannelServiceClient::listNotificationChannelsAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/list_notification_channels.php + * + * @param ListNotificationChannelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNotificationChannels(ListNotificationChannelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNotificationChannels', $request, $callOptions); + } + + /** + * Causes a verification code to be delivered to the channel. The code + * can then be supplied in `VerifyNotificationChannel` to verify the channel. + * + * The async variant is + * {@see NotificationChannelServiceClient::sendNotificationChannelVerificationCodeAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php + * + * @param SendNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function sendNotificationChannelVerificationCode(SendNotificationChannelVerificationCodeRequest $request, array $callOptions = []): void + { + $this->startApiCall('SendNotificationChannelVerificationCode', $request, $callOptions)->wait(); + } + + /** + * Updates a notification channel. Fields not specified in the field mask + * remain unchanged. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * The async variant is + * {@see NotificationChannelServiceClient::updateNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/update_notification_channel.php + * + * @param UpdateNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateNotificationChannel(UpdateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('UpdateNotificationChannel', $request, $callOptions)->wait(); + } + + /** + * Verifies a `NotificationChannel` by proving receipt of the code + * delivered to the channel as a result of calling + * `SendNotificationChannelVerificationCode`. + * + * The async variant is + * {@see NotificationChannelServiceClient::verifyNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/verify_notification_channel.php + * + * @param VerifyNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function verifyNotificationChannel(VerifyNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('VerifyNotificationChannel', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php new file mode 100644 index 00000000000..81a5eab5b18 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php @@ -0,0 +1,193 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Queries time series using Monitoring Query Language. + * + * The async variant is {@see QueryServiceClient::queryTimeSeriesAsync()} . + * + * @example samples/V3/QueryServiceClient/query_time_series.php + * + * @param QueryTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function queryTimeSeries(QueryTimeSeriesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('QueryTimeSeries', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php new file mode 100644 index 00000000000..ec9bb443cf7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php @@ -0,0 +1,635 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $service): string + { + return self::getPathTemplate('folderService')->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(string $folder, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('folderServiceServiceLevelObjective')->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(string $organization, string $service): string + { + return self::getPathTemplate('organizationService')->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(string $organization, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('organizationServiceServiceLevelObjective')->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(string $project, string $service): string + { + return self::getPathTemplate('projectService')->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(string $project, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('projectServiceServiceLevelObjective')->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(string $project, string $service): string + { + return self::getPathTemplate('service')->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(string $project, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('serviceLevelObjective')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Create a `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::createServiceAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/create_service.php + * + * @param CreateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function createService(CreateServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('CreateService', $request, $callOptions)->wait(); + } + + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::createServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php + * + * @param CreateServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ServiceLevelObjective + * + * @throws ApiException Thrown if the API call fails. + */ + public function createServiceLevelObjective(CreateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective + { + return $this->startApiCall('CreateServiceLevelObjective', $request, $callOptions)->wait(); + } + + /** + * Soft delete this `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::deleteServiceAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/delete_service.php + * + * @param DeleteServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteService(DeleteServiceRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteService', $request, $callOptions)->wait(); + } + + /** + * Delete the given `ServiceLevelObjective`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::deleteServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php + * + * @param DeleteServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteServiceLevelObjective', $request, $callOptions)->wait(); + } + + /** + * Get the named `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::getServiceAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/get_service.php + * + * @param GetServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function getService(GetServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('GetService', $request, $callOptions)->wait(); + } + + /** + * Get a `ServiceLevelObjective` by name. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::getServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php + * + * @param GetServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ServiceLevelObjective + * + * @throws ApiException Thrown if the API call fails. + */ + public function getServiceLevelObjective(GetServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective + { + return $this->startApiCall('GetServiceLevelObjective', $request, $callOptions)->wait(); + } + + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::listServiceLevelObjectivesAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php + * + * @param ListServiceLevelObjectivesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServiceLevelObjectives(ListServiceLevelObjectivesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServiceLevelObjectives', $request, $callOptions); + } + + /** + * List `Service`s for this Metrics Scope. + * + * The async variant is {@see ServiceMonitoringServiceClient::listServicesAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/list_services.php + * + * @param ListServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServices', $request, $callOptions); + } + + /** + * Update this `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::updateServiceAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/update_service.php + * + * @param UpdateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateService(UpdateServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); + } + + /** + * Update the given `ServiceLevelObjective`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::updateServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php + * + * @param UpdateServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ServiceLevelObjective + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective + { + return $this->startApiCall('UpdateServiceLevelObjective', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php new file mode 100644 index 00000000000..e41cf63ae34 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php @@ -0,0 +1,434 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snooze_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('alertPolicy')->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(string $folder, string $alertPolicy): string + { + return self::getPathTemplate('folderAlertPolicy')->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(string $organization, string $alertPolicy): string + { + return self::getPathTemplate('organizationAlertPolicy')->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * 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(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('projectAlertPolicy')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a snooze + * resource. + * + * @param string $project + * @param string $snooze + * + * @return string The formatted snooze resource. + */ + public static function snoozeName(string $project, string $snooze): string + { + return self::getPathTemplate('snooze')->render([ + 'project' => $project, + 'snooze' => $snooze, + ]); + } + + /** + * 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(string $project): string + { + return self::getPathTemplate('workspace')->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 + * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - project: projects/{project} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - snooze: projects/{project}/snoozes/{snooze} + * - 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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a `Snooze` that will prevent alerts, which match the provided + * criteria, from being opened. The `Snooze` applies for a specific time + * interval. + * + * The async variant is {@see SnoozeServiceClient::createSnoozeAsync()} . + * + * @example samples/V3/SnoozeServiceClient/create_snooze.php + * + * @param CreateSnoozeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snooze + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSnooze(CreateSnoozeRequest $request, array $callOptions = []): Snooze + { + return $this->startApiCall('CreateSnooze', $request, $callOptions)->wait(); + } + + /** + * Retrieves a `Snooze` by `name`. + * + * The async variant is {@see SnoozeServiceClient::getSnoozeAsync()} . + * + * @example samples/V3/SnoozeServiceClient/get_snooze.php + * + * @param GetSnoozeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snooze + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSnooze(GetSnoozeRequest $request, array $callOptions = []): Snooze + { + return $this->startApiCall('GetSnooze', $request, $callOptions)->wait(); + } + + /** + * Lists the `Snooze`s associated with a project. Can optionally pass in + * `filter`, which specifies predicates to match `Snooze`s. + * + * The async variant is {@see SnoozeServiceClient::listSnoozesAsync()} . + * + * @example samples/V3/SnoozeServiceClient/list_snoozes.php + * + * @param ListSnoozesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSnoozes(ListSnoozesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSnoozes', $request, $callOptions); + } + + /** + * Updates a `Snooze`, identified by its `name`, with the parameters in the + * given `Snooze` object. + * + * The async variant is {@see SnoozeServiceClient::updateSnoozeAsync()} . + * + * @example samples/V3/SnoozeServiceClient/update_snooze.php + * + * @param UpdateSnoozeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snooze + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSnooze(UpdateSnoozeRequest $request, array $callOptions = []): Snooze + { + return $this->startApiCall('UpdateSnooze', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php new file mode 100644 index 00000000000..f80c8f32665 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php @@ -0,0 +1,451 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $uptimeCheckConfig): string + { + return self::getPathTemplate('folderUptimeCheckConfig')->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(string $organization, string $uptimeCheckConfig): string + { + return self::getPathTemplate('organizationUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string + { + return self::getPathTemplate('projectUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string + { + return self::getPathTemplate('uptimeCheckConfig')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new Uptime check configuration. + * + * The async variant is + * {@see UptimeCheckServiceClient::createUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php + * + * @param CreateUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UptimeCheckConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function createUptimeCheckConfig(CreateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig + { + return $this->startApiCall('CreateUptimeCheckConfig', $request, $callOptions)->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. + * + * The async variant is + * {@see UptimeCheckServiceClient::deleteUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php + * + * @param DeleteUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteUptimeCheckConfig', $request, $callOptions)->wait(); + } + + /** + * Gets a single Uptime check configuration. + * + * The async variant is + * {@see UptimeCheckServiceClient::getUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php + * + * @param GetUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UptimeCheckConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getUptimeCheckConfig(GetUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig + { + return $this->startApiCall('GetUptimeCheckConfig', $request, $callOptions)->wait(); + } + + /** + * Lists the existing valid Uptime check configurations for the project + * (leaving out any invalid configurations). + * + * The async variant is + * {@see UptimeCheckServiceClient::listUptimeCheckConfigsAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php + * + * @param ListUptimeCheckConfigsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listUptimeCheckConfigs(ListUptimeCheckConfigsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUptimeCheckConfigs', $request, $callOptions); + } + + /** + * Returns the list of IP addresses that checkers run from + * + * The async variant is {@see UptimeCheckServiceClient::listUptimeCheckIpsAsync()} + * . + * + * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php + * + * @param ListUptimeCheckIpsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listUptimeCheckIps(ListUptimeCheckIpsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUptimeCheckIps', $request, $callOptions); + } + + /** + * 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. + * + * The async variant is + * {@see UptimeCheckServiceClient::updateUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php + * + * @param UpdateUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UptimeCheckConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateUptimeCheckConfig(UpdateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig + { + return $this->startApiCall('UpdateUptimeCheckConfig', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php new file mode 100644 index 00000000000..b21dfc9d265 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php @@ -0,0 +1,806 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\AlertPolicyServiceClient}. + */ +class AlertPolicyServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.AlertPolicyService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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 $alertPolicyConditionNameTemplate; + + private static $folderAlertPolicyNameTemplate; + + private static $folderAlertPolicyConditionNameTemplate; + + private static $organizationAlertPolicyNameTemplate; + + private static $organizationAlertPolicyConditionNameTemplate; + + private static $projectAlertPolicyNameTemplate; + + private static $projectAlertPolicyConditionNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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 getAlertPolicyConditionNameTemplate() + { + if (self::$alertPolicyConditionNameTemplate == null) { + self::$alertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$alertPolicyConditionNameTemplate; + } + + private static function getFolderAlertPolicyNameTemplate() + { + if (self::$folderAlertPolicyNameTemplate == null) { + self::$folderAlertPolicyNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}'); + } + + return self::$folderAlertPolicyNameTemplate; + } + + private static function getFolderAlertPolicyConditionNameTemplate() + { + if (self::$folderAlertPolicyConditionNameTemplate == null) { + self::$folderAlertPolicyConditionNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$folderAlertPolicyConditionNameTemplate; + } + + private static function getOrganizationAlertPolicyNameTemplate() + { + if (self::$organizationAlertPolicyNameTemplate == null) { + self::$organizationAlertPolicyNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}'); + } + + return self::$organizationAlertPolicyNameTemplate; + } + + private static function getOrganizationAlertPolicyConditionNameTemplate() + { + if (self::$organizationAlertPolicyConditionNameTemplate == null) { + self::$organizationAlertPolicyConditionNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$organizationAlertPolicyConditionNameTemplate; + } + + private static function getProjectAlertPolicyNameTemplate() + { + if (self::$projectAlertPolicyNameTemplate == null) { + self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); + } + + return self::$projectAlertPolicyNameTemplate; + } + + private static function getProjectAlertPolicyConditionNameTemplate() + { + if (self::$projectAlertPolicyConditionNameTemplate == null) { + self::$projectAlertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$projectAlertPolicyConditionNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'alertPolicy' => self::getAlertPolicyNameTemplate(), + 'alertPolicyCondition' => self::getAlertPolicyConditionNameTemplate(), + 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), + 'folderAlertPolicyCondition' => self::getFolderAlertPolicyConditionNameTemplate(), + 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), + 'organizationAlertPolicyCondition' => self::getOrganizationAlertPolicyConditionNameTemplate(), + 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), + 'projectAlertPolicyCondition' => self::getProjectAlertPolicyConditionNameTemplate(), + ]; + } + + 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 + * alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted alert_policy_condition resource. + */ + public static function alertPolicyConditionName($project, $alertPolicy, $condition) + { + return self::getAlertPolicyConditionNameTemplate()->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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 + * folder_alert_policy_condition resource. + * + * @param string $folder + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted folder_alert_policy_condition resource. + */ + public static function folderAlertPolicyConditionName($folder, $alertPolicy, $condition) + { + return self::getFolderAlertPolicyConditionNameTemplate()->render([ + 'folder' => $folder, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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 + * organization_alert_policy_condition resource. + * + * @param string $organization + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted organization_alert_policy_condition resource. + */ + public static function organizationAlertPolicyConditionName($organization, $alertPolicy, $condition) + { + return self::getOrganizationAlertPolicyConditionNameTemplate()->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted project_alert_policy_condition resource. + */ + public static function projectAlertPolicyConditionName($project, $alertPolicy, $condition) + { + return self::getProjectAlertPolicyConditionNameTemplate()->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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} + * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * + * 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * 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 Metrics Scope, 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..04306c6bc04 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php @@ -0,0 +1,752 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\GroupServiceClient}. + */ +class GroupServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.GroupService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..ca515984779 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php @@ -0,0 +1,1178 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\MetricServiceClient}. + */ +class MetricServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.MetricService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * The metric descriptor is updated if it already exists, + * except that metric labels are never removed. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * This method does not support + * [resource locations constraint of an organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..0661a3c04e3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php @@ -0,0 +1,1075 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient}. + */ +class NotificationChannelServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.NotificationChannelService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * To list the types of notification channels that are supported, use + * the `ListNotificationChannelDescriptors` method. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..b083925f4ba --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php @@ -0,0 +1,256 @@ +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(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\QueryServiceClient}. + */ +class QueryServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.QueryService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..c7cc9a8589b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php @@ -0,0 +1,1044 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\ServiceMonitoringServiceClient}. + */ +class ServiceMonitoringServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.ServiceMonitoringService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 Metrics Scope. 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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-zA-Z0-9-_:.]+$` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 Metrics Scope. 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 Metrics Scope. + * + * 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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * @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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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/SnoozeServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php new file mode 100644 index 00000000000..08c130e17a0 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php @@ -0,0 +1,680 @@ +workspaceName('[PROJECT]'); + * $snooze = new Snooze(); + * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); + * } finally { + * $snoozeServiceClient->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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\SnoozeServiceClient}. + */ +class SnoozeServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.SnoozeService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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 $projectNameTemplate; + + private static $projectAlertPolicyNameTemplate; + + private static $snoozeNameTemplate; + + private static $workspaceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snooze_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 getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectAlertPolicyNameTemplate() + { + if (self::$projectAlertPolicyNameTemplate == null) { + self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); + } + + return self::$projectAlertPolicyNameTemplate; + } + + private static function getSnoozeNameTemplate() + { + if (self::$snoozeNameTemplate == null) { + self::$snoozeNameTemplate = new PathTemplate('projects/{project}/snoozes/{snooze}'); + } + + return self::$snoozeNameTemplate; + } + + 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 = [ + 'alertPolicy' => self::getAlertPolicyNameTemplate(), + 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), + 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), + 'snooze' => self::getSnoozeNameTemplate(), + 'workspace' => self::getWorkspaceNameTemplate(), + ]; + } + + 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 + * 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_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, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a snooze + * resource. + * + * @param string $project + * @param string $snooze + * + * @return string The formatted snooze resource. + */ + public static function snoozeName($project, $snooze) + { + return self::getSnoozeNameTemplate()->render([ + 'project' => $project, + 'snooze' => $snooze, + ]); + } + + /** + * 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 + * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - project: projects/{project} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - snooze: projects/{project}/snoozes/{snooze} + * - 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 $apiEndpoint + * 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 + * $apiEndpoint 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 `Snooze` that will prevent alerts, which match the provided + * criteria, from being opened. The `Snooze` applies for a specific time + * interval. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); + * $snooze = new Snooze(); + * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Snooze + * + * @throws ApiException if the remote call fails + */ + public function createSnooze($parent, $snooze, array $optionalArgs = []) + { + $request = new CreateSnoozeRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setSnooze($snooze); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateSnooze', Snooze::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a `Snooze` by `name`. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $formattedName = $snoozeServiceClient->snoozeName('[PROJECT]', '[SNOOZE]'); + * $response = $snoozeServiceClient->getSnooze($formattedName); + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Snooze + * + * @throws ApiException if the remote call fails + */ + public function getSnooze($name, array $optionalArgs = []) + { + $request = new GetSnoozeRequest(); + $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('GetSnooze', Snooze::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the `Snooze`s associated with a project. Can optionally pass in + * `filter`, which specifies predicates to match `Snooze`s. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * + * * `interval.start_time` + * * `interval.end_time` + * + * For example: + * + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * @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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listSnoozes($parent, array $optionalArgs = []) + { + $request = new ListSnoozesRequest(); + $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('ListSnoozes', $optionalArgs, ListSnoozesResponse::class, $request); + } + + /** + * Updates a `Snooze`, identified by its `name`, with the parameters in the + * given `Snooze` object. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $snooze = new Snooze(); + * $updateMask = new FieldMask(); + * $response = $snoozeServiceClient->updateSnooze($snooze, $updateMask); + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param Snooze $snooze Required. The `Snooze` to update. Must have the name field present. + * @param FieldMask $updateMask Required. The fields to update. + * + * For each field listed in `update_mask`: + * + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * + * Fields not listed retain their existing value. + * + * The following are the field names that are accepted in `update_mask`: + * + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Snooze + * + * @throws ApiException if the remote call fails + */ + public function updateSnooze($snooze, $updateMask, array $optionalArgs = []) + { + $request = new UpdateSnoozeRequest(); + $requestParamHeaders = []; + $request->setSnooze($snooze); + $request->setUpdateMask($updateMask); + $requestParamHeaders['snooze.name'] = $snooze->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateSnooze', Snooze::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..5cdb98a3e21 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php @@ -0,0 +1,692 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\UptimeCheckServiceClient}. + */ +class UptimeCheckServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.UptimeCheckService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 string $filter + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * @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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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['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('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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 corresponding 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..c8b5d43074e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php @@ -0,0 +1,34 @@ + [ + 'google.monitoring.v3.AlertPolicyService' => [ + 'CreateAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAlertPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAlertPolicies', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListAlertPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', + 'headerParams' => [ + [ + 'keyName' => 'alert_policy.name', + 'fieldAccessors' => [ + 'getAlertPolicy', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'alertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', + 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', + 'folderAlertPolicyCondition' => 'folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}', + 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', + 'organizationAlertPolicyCondition' => 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}', + 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'projectAlertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', + ], + ], + ], +]; 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..dffb1c026b4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php @@ -0,0 +1,67 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..ff6efe326c8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php @@ -0,0 +1,103 @@ + [ + 'google.monitoring.v3.GroupService' => [ + 'CreateGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Group', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Group', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGroupMembers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMembers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupMembersResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGroups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGroup', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Group', + 'headerParams' => [ + [ + 'keyName' => 'group.name', + 'fieldAccessors' => [ + 'getGroup', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'folderGroup' => 'folders/{folder}/groups/{group}', + 'group' => 'projects/{project}/groups/{group}', + 'organizationGroup' => 'organizations/{organization}/groups/{group}', + 'projectGroup' => 'projects/{project}/groups/{group}', + ], + ], + ], +]; 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..2d4763692de --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php @@ -0,0 +1,78 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..537f2edc969 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php @@ -0,0 +1,154 @@ + [ + 'google.monitoring.v3.MetricService' => [ + 'CreateMetricDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\MetricDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateServiceTimeSeries' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateTimeSeries' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMetricDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMetricDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\MetricDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMonitoredResourceDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\MonitoredResourceDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListMetricDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMetricDescriptors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListMetricDescriptorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListMonitoredResourceDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResourceDescriptors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTimeSeries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTimeSeries', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListTimeSeriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..741468a73ec --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php @@ -0,0 +1,136 @@ + [ + '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', + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..212e17ef746 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php @@ -0,0 +1,155 @@ + [ + 'google.monitoring.v3.NotificationChannelService' => [ + 'CreateNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannelDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannelDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannelVerificationCode' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationChannelDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getChannelDescriptors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationChannels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNotificationChannels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SendNotificationChannelVerificationCode' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'notification_channel.name', + 'fieldAccessors' => [ + 'getNotificationChannel', + 'getName', + ], + ], + ], + ], + 'VerifyNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..3c782d2b3a6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php @@ -0,0 +1,125 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..a3c68187c23 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php @@ -0,0 +1,28 @@ + [ + 'google.monitoring.v3.QueryService' => [ + 'QueryTimeSeries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTimeSeriesData', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\QueryTimeSeriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; 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..f258f2c5638 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php @@ -0,0 +1,21 @@ + [ + 'google.monitoring.v3.QueryService' => [ + 'QueryTimeSeries' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries:query', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..ab57f32e711 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php @@ -0,0 +1,156 @@ + [ + 'google.monitoring.v3.ServiceMonitoringService' => [ + 'CreateService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Service', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Service', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListServiceLevelObjectives' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServiceLevelObjectives', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServices', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListServicesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Service', + 'headerParams' => [ + [ + 'keyName' => 'service.name', + 'fieldAccessors' => [ + 'getService', + 'getName', + ], + ], + ], + ], + 'UpdateServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', + 'headerParams' => [ + [ + 'keyName' => 'service_level_objective.name', + 'fieldAccessors' => [ + 'getServiceLevelObjective', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..ddefc86e0a7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php @@ -0,0 +1,125 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json new file mode 100644 index 00000000000..0acb65e12bd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.monitoring.v3.SnoozeService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_9_codes": [ + "UNAVAILABLE" + ], + "no_retry_7_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_9_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_7_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": { + "CreateSnooze": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_7_codes", + "retry_params_name": "no_retry_7_params" + }, + "GetSnooze": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_9_codes", + "retry_params_name": "retry_policy_9_params" + }, + "ListSnoozes": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_9_codes", + "retry_params_name": "retry_policy_9_params" + }, + "UpdateSnooze": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_7_codes", + "retry_params_name": "no_retry_7_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php new file mode 100644 index 00000000000..a476bb04670 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php @@ -0,0 +1,74 @@ + [ + 'google.monitoring.v3.SnoozeService' => [ + 'CreateSnooze' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetSnooze' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSnoozes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSnoozes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListSnoozesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSnooze' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', + 'headerParams' => [ + [ + 'keyName' => 'snooze.name', + 'fieldAccessors' => [ + 'getSnooze', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', + 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', + 'project' => 'projects/{project}', + 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'snooze' => 'projects/{project}/snoozes/{snooze}', + 'workspace' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php new file mode 100644 index 00000000000..de2890fcd30 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php @@ -0,0 +1,59 @@ + [ + 'google.monitoring.v3.SnoozeService' => [ + 'CreateSnooze' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', + 'body' => 'snooze', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetSnooze' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/snoozes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSnoozes' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSnooze' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{snooze.name=projects/*/snoozes/*}', + 'body' => 'snooze', + 'placeholders' => [ + 'snooze.name' => [ + 'getters' => [ + 'getSnooze', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..f69c027e8c7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php @@ -0,0 +1,95 @@ + [ + 'google.monitoring.v3.UptimeCheckService' => [ + 'CreateUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListUptimeCheckConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUptimeCheckConfigs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListUptimeCheckIps' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUptimeCheckIps', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckIpsResponse', + ], + 'UpdateUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', + 'headerParams' => [ + [ + 'keyName' => 'uptime_check_config.name', + 'fieldAccessors' => [ + 'getUptimeCheckConfig', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..48eea72dceb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php @@ -0,0 +1,71 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..9811f18bd6f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php @@ -0,0 +1,380 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createAlertPolicy($name, $alertPolicy); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + try { + $gapicClient->deleteAlertPolicy($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + try { + $gapicClient->getAlertPolicy($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listAlertPolicies($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateAlertPolicy($alertPolicy); + // If the $gapicClient 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/Client/AlertPolicyServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php new file mode 100644 index 00000000000..498d9a5be07 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php @@ -0,0 +1,442 @@ +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(); + $gapicClient = $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(); + $request = (new CreateAlertPolicyRequest()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + $response = $gapicClient->createAlertPolicy($request); + $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(); + $gapicClient = $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(); + $request = (new CreateAlertPolicyRequest()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + try { + $gapicClient->createAlertPolicy($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new DeleteAlertPolicyRequest()) + ->setName($formattedName); + $gapicClient->deleteAlertPolicy($request); + $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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new DeleteAlertPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteAlertPolicy($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new GetAlertPolicyRequest()) + ->setName($formattedName); + $response = $gapicClient->getAlertPolicy($request); + $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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new GetAlertPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->getAlertPolicy($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListAlertPoliciesRequest()) + ->setName($name); + $response = $gapicClient->listAlertPolicies($request); + $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(); + $gapicClient = $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'; + $request = (new ListAlertPoliciesRequest()) + ->setName($name); + try { + $gapicClient->listAlertPolicies($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateAlertPolicyRequest()) + ->setAlertPolicy($alertPolicy); + $response = $gapicClient->updateAlertPolicy($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateAlertPolicyRequest()) + ->setAlertPolicy($alertPolicy); + try { + $gapicClient->updateAlertPolicy($request); + // If the $gapicClient 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 createAlertPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateAlertPolicyRequest()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + $response = $gapicClient->createAlertPolicyAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php new file mode 100644 index 00000000000..5e7c3024f3a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php @@ -0,0 +1,541 @@ +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(); + $gapicClient = $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(); + $request = (new CreateGroupRequest()) + ->setName($name) + ->setGroup($group); + $response = $gapicClient->createGroup($request); + $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(); + $gapicClient = $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(); + $request = (new CreateGroupRequest()) + ->setName($name) + ->setGroup($group); + try { + $gapicClient->createGroup($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new DeleteGroupRequest()) + ->setName($formattedName); + $gapicClient->deleteGroup($request); + $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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new DeleteGroupRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteGroup($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new GetGroupRequest()) + ->setName($formattedName); + $response = $gapicClient->getGroup($request); + $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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new GetGroupRequest()) + ->setName($formattedName); + try { + $gapicClient->getGroup($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new ListGroupMembersRequest()) + ->setName($formattedName); + $response = $gapicClient->listGroupMembers($request); + $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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new ListGroupMembersRequest()) + ->setName($formattedName); + try { + $gapicClient->listGroupMembers($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListGroupsRequest()) + ->setName($name); + $response = $gapicClient->listGroups($request); + $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(); + $gapicClient = $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'; + $request = (new ListGroupsRequest()) + ->setName($name); + try { + $gapicClient->listGroups($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateGroupRequest()) + ->setGroup($group); + $response = $gapicClient->updateGroup($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateGroupRequest()) + ->setGroup($group); + try { + $gapicClient->updateGroup($request); + // If the $gapicClient 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 createGroupAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateGroupRequest()) + ->setName($name) + ->setGroup($group); + $response = $gapicClient->createGroupAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php new file mode 100644 index 00000000000..8a38d03c86b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php @@ -0,0 +1,769 @@ +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(); + $gapicClient = $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(); + $request = (new CreateMetricDescriptorRequest()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + $response = $gapicClient->createMetricDescriptor($request); + $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(); + $gapicClient = $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(); + $request = (new CreateMetricDescriptorRequest()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + try { + $gapicClient->createMetricDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + $gapicClient->createServiceTimeSeries($request); + $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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + try { + $gapicClient->createServiceTimeSeries($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + $gapicClient->createTimeSeries($request); + $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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + try { + $gapicClient->createTimeSeries($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new DeleteMetricDescriptorRequest()) + ->setName($formattedName); + $gapicClient->deleteMetricDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new DeleteMetricDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteMetricDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new GetMetricDescriptorRequest()) + ->setName($formattedName); + $response = $gapicClient->getMetricDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new GetMetricDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->getMetricDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $request = (new GetMonitoredResourceDescriptorRequest()) + ->setName($formattedName); + $response = $gapicClient->getMonitoredResourceDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $request = (new GetMonitoredResourceDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->getMonitoredResourceDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListMetricDescriptorsRequest()) + ->setName($name); + $response = $gapicClient->listMetricDescriptors($request); + $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(); + $gapicClient = $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'; + $request = (new ListMetricDescriptorsRequest()) + ->setName($name); + try { + $gapicClient->listMetricDescriptors($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListMonitoredResourceDescriptorsRequest()) + ->setName($name); + $response = $gapicClient->listMonitoredResourceDescriptors($request); + $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(); + $gapicClient = $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'; + $request = (new ListMonitoredResourceDescriptorsRequest()) + ->setName($name); + try { + $gapicClient->listMonitoredResourceDescriptors($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $request = (new ListTimeSeriesRequest()) + ->setName($formattedName) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + $response = $gapicClient->listTimeSeries($request); + $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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $request = (new ListTimeSeriesRequest()) + ->setName($formattedName) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + try { + $gapicClient->listTimeSeries($request); + // If the $gapicClient 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 createMetricDescriptorAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateMetricDescriptorRequest()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + $response = $gapicClient->createMetricDescriptorAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php new file mode 100644 index 00000000000..7a0e8fd53b0 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php @@ -0,0 +1,809 @@ +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(); + $gapicClient = $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(); + $request = (new CreateNotificationChannelRequest()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + $response = $gapicClient->createNotificationChannel($request); + $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(); + $gapicClient = $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(); + $request = (new CreateNotificationChannelRequest()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + try { + $gapicClient->createNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new DeleteNotificationChannelRequest()) + ->setName($formattedName); + $gapicClient->deleteNotificationChannel($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new DeleteNotificationChannelRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelRequest()) + ->setName($formattedName); + $response = $gapicClient->getNotificationChannel($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelRequest()) + ->setName($formattedName); + try { + $gapicClient->getNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $request = (new GetNotificationChannelDescriptorRequest()) + ->setName($formattedName); + $response = $gapicClient->getNotificationChannelDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $request = (new GetNotificationChannelDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->getNotificationChannelDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $code = 'code3059181'; + $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); + $expectedResponse->setCode($code); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + $response = $gapicClient->getNotificationChannelVerificationCode($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + try { + $gapicClient->getNotificationChannelVerificationCode($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelDescriptorsRequest()) + ->setName($name); + $response = $gapicClient->listNotificationChannelDescriptors($request); + $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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelDescriptorsRequest()) + ->setName($name); + try { + $gapicClient->listNotificationChannelDescriptors($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelsRequest()) + ->setName($name); + $response = $gapicClient->listNotificationChannels($request); + $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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelsRequest()) + ->setName($name); + try { + $gapicClient->listNotificationChannels($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new SendNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + $gapicClient->sendNotificationChannelVerificationCode($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new SendNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + try { + $gapicClient->sendNotificationChannelVerificationCode($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateNotificationChannelRequest()) + ->setNotificationChannel($notificationChannel); + $response = $gapicClient->updateNotificationChannel($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateNotificationChannelRequest()) + ->setNotificationChannel($notificationChannel); + try { + $gapicClient->updateNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + $request = (new VerifyNotificationChannelRequest()) + ->setName($formattedName) + ->setCode($code); + $response = $gapicClient->verifyNotificationChannel($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + $request = (new VerifyNotificationChannelRequest()) + ->setName($formattedName) + ->setCode($code); + try { + $gapicClient->verifyNotificationChannel($request); + // If the $gapicClient 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 createNotificationChannelAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateNotificationChannelRequest()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + $response = $gapicClient->createNotificationChannelAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php new file mode 100644 index 00000000000..cd32140b2e9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php @@ -0,0 +1,182 @@ +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(); + $gapicClient = $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'; + $request = (new QueryTimeSeriesRequest()) + ->setName($name) + ->setQuery($query); + $response = $gapicClient->queryTimeSeries($request); + $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(); + $gapicClient = $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'; + $request = (new QueryTimeSeriesRequest()) + ->setName($name) + ->setQuery($query); + try { + $gapicClient->queryTimeSeries($request); + // If the $gapicClient 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 queryTimeSeriesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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'; + $request = (new QueryTimeSeriesRequest()) + ->setName($name) + ->setQuery($query); + $response = $gapicClient->queryTimeSeriesAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php new file mode 100644 index 00000000000..d679066683c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php @@ -0,0 +1,790 @@ +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(); + $gapicClient = $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(); + $request = (new CreateServiceRequest()) + ->setParent($parent) + ->setService($service); + $response = $gapicClient->createService($request); + $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(); + $gapicClient = $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(); + $request = (new CreateServiceRequest()) + ->setParent($parent) + ->setService($service); + try { + $gapicClient->createService($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $request = (new CreateServiceLevelObjectiveRequest()) + ->setParent($formattedParent) + ->setServiceLevelObjective($serviceLevelObjective); + $response = $gapicClient->createServiceLevelObjective($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $request = (new CreateServiceLevelObjectiveRequest()) + ->setParent($formattedParent) + ->setServiceLevelObjective($serviceLevelObjective); + try { + $gapicClient->createServiceLevelObjective($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + $gapicClient->deleteService($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteService($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new DeleteServiceLevelObjectiveRequest()) + ->setName($formattedName); + $gapicClient->deleteServiceLevelObjective($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new DeleteServiceLevelObjectiveRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteServiceLevelObjective($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->getService($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->getService($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new GetServiceLevelObjectiveRequest()) + ->setName($formattedName); + $response = $gapicClient->getServiceLevelObjective($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new GetServiceLevelObjectiveRequest()) + ->setName($formattedName); + try { + $gapicClient->getServiceLevelObjective($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new ListServiceLevelObjectivesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listServiceLevelObjectives($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new ListServiceLevelObjectivesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listServiceLevelObjectives($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListServicesRequest()) + ->setParent($parent); + $response = $gapicClient->listServices($request); + $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(); + $gapicClient = $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'; + $request = (new ListServicesRequest()) + ->setParent($parent); + try { + $gapicClient->listServices($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateServiceRequest()) + ->setService($service); + $response = $gapicClient->updateService($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateServiceRequest()) + ->setService($service); + try { + $gapicClient->updateService($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateServiceLevelObjectiveRequest()) + ->setServiceLevelObjective($serviceLevelObjective); + $response = $gapicClient->updateServiceLevelObjective($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateServiceLevelObjectiveRequest()) + ->setServiceLevelObjective($serviceLevelObjective); + try { + $gapicClient->updateServiceLevelObjective($request); + // If the $gapicClient 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 createServiceAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateServiceRequest()) + ->setParent($parent) + ->setService($service); + $response = $gapicClient->createServiceAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php new file mode 100644 index 00000000000..5eb2436b612 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php @@ -0,0 +1,426 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnoozeServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnoozeServiceClient($options); + } + + /** @test */ + public function createSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + $response = $gapicClient->createSnooze($request); + $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.SnoozeService/CreateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + try { + $gapicClient->createSnooze($request); + // If the $gapicClient 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 getSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + $request = (new GetSnoozeRequest()) + ->setName($formattedName); + $response = $gapicClient->getSnooze($request); + $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.SnoozeService/GetSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + $request = (new GetSnoozeRequest()) + ->setName($formattedName); + try { + $gapicClient->getSnooze($request); + // If the $gapicClient 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 listSnoozesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $snoozesElement = new Snooze(); + $snoozes = [ + $snoozesElement, + ]; + $expectedResponse = new ListSnoozesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSnoozes($snoozes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $request = (new ListSnoozesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSnoozes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSnoozesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $request = (new ListSnoozesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSnoozes($request); + // If the $gapicClient 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 updateSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateSnoozeRequest()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateSnooze($request); + $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.SnoozeService/UpdateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateSnoozeRequest()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateSnooze($request); + // If the $gapicClient 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 createSnoozeAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + $response = $gapicClient->createSnoozeAsync($request)->wait(); + $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.SnoozeService/CreateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php new file mode 100644 index 00000000000..8b1fc5ae653 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php @@ -0,0 +1,517 @@ +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(); + $gapicClient = $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(); + $request = (new CreateUptimeCheckConfigRequest()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + $response = $gapicClient->createUptimeCheckConfig($request); + $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(); + $gapicClient = $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(); + $request = (new CreateUptimeCheckConfigRequest()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + try { + $gapicClient->createUptimeCheckConfig($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new DeleteUptimeCheckConfigRequest()) + ->setName($formattedName); + $gapicClient->deleteUptimeCheckConfig($request); + $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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new DeleteUptimeCheckConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteUptimeCheckConfig($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new GetUptimeCheckConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getUptimeCheckConfig($request); + $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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new GetUptimeCheckConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getUptimeCheckConfig($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListUptimeCheckConfigsRequest()) + ->setParent($parent); + $response = $gapicClient->listUptimeCheckConfigs($request); + $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(); + $gapicClient = $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'; + $request = (new ListUptimeCheckConfigsRequest()) + ->setParent($parent); + try { + $gapicClient->listUptimeCheckConfigs($request); + // If the $gapicClient 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(); + $gapicClient = $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); + $request = new ListUptimeCheckIpsRequest(); + $response = $gapicClient->listUptimeCheckIps($request); + $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(); + $gapicClient = $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); + $request = new ListUptimeCheckIpsRequest(); + try { + $gapicClient->listUptimeCheckIps($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateUptimeCheckConfigRequest()) + ->setUptimeCheckConfig($uptimeCheckConfig); + $response = $gapicClient->updateUptimeCheckConfig($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateUptimeCheckConfigRequest()) + ->setUptimeCheckConfig($uptimeCheckConfig); + try { + $gapicClient->updateUptimeCheckConfig($request); + // If the $gapicClient 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 createUptimeCheckConfigAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateUptimeCheckConfigRequest()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + $response = $gapicClient->createUptimeCheckConfigAsync($request)->wait(); + $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()); + } +} 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..6ac70404aed --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php @@ -0,0 +1,468 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createGroup($name, $group); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + try { + $gapicClient->deleteGroup($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + try { + $gapicClient->getGroup($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + try { + $gapicClient->listGroupMembers($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listGroups($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateGroup($group); + // If the $gapicClient 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..443a3f9faf1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php @@ -0,0 +1,672 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createMetricDescriptor($name, $metricDescriptor); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + try { + $gapicClient->createServiceTimeSeries($formattedName, $timeSeries); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + try { + $gapicClient->createTimeSeries($formattedName, $timeSeries); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + try { + $gapicClient->deleteMetricDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + try { + $gapicClient->getMetricDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + try { + $gapicClient->getMonitoredResourceDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listMetricDescriptors($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listMonitoredResourceDescriptors($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + try { + $gapicClient->listTimeSeries($formattedName, $filter, $interval, $view); + // If the $gapicClient 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..9b115e17697 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php @@ -0,0 +1,716 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createNotificationChannel($name, $notificationChannel); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->deleteNotificationChannel($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->getNotificationChannel($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + try { + $gapicClient->getNotificationChannelDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $code = 'code3059181'; + $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); + $expectedResponse->setCode($code); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->getNotificationChannelVerificationCode($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listNotificationChannelDescriptors($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listNotificationChannels($name); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->sendNotificationChannelVerificationCode($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateNotificationChannel($notificationChannel); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + try { + $gapicClient->verifyNotificationChannel($formattedName, $code); + // If the $gapicClient 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..c64caa89013 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php @@ -0,0 +1,134 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->queryTimeSeries($name, $query); + // If the $gapicClient 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..7651f7245bc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php @@ -0,0 +1,701 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createService($parent, $service); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + try { + $gapicClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + try { + $gapicClient->deleteService($formattedName); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + try { + $gapicClient->deleteServiceLevelObjective($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + try { + $gapicClient->getService($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + try { + $gapicClient->getServiceLevelObjective($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + try { + $gapicClient->listServiceLevelObjectives($formattedParent); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listServices($parent); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateService($service); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateServiceLevelObjective($serviceLevelObjective); + // If the $gapicClient 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/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php new file mode 100644 index 00000000000..653db774900 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php @@ -0,0 +1,359 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnoozeServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnoozeServiceClient($options); + } + + /** @test */ + public function createSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $response = $gapicClient->createSnooze($formattedParent, $snooze); + $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.SnoozeService/CreateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + try { + $gapicClient->createSnooze($formattedParent, $snooze); + // If the $gapicClient 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 getSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + $response = $gapicClient->getSnooze($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.SnoozeService/GetSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + try { + $gapicClient->getSnooze($formattedName); + // If the $gapicClient 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 listSnoozesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $snoozesElement = new Snooze(); + $snoozes = [ + $snoozesElement, + ]; + $expectedResponse = new ListSnoozesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSnoozes($snoozes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $response = $gapicClient->listSnoozes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSnoozesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + try { + $gapicClient->listSnoozes($formattedParent); + // If the $gapicClient 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 updateSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $response = $gapicClient->updateSnooze($snooze, $updateMask); + $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.SnoozeService/UpdateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + try { + $gapicClient->updateSnooze($snooze, $updateMask); + // If the $gapicClient 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..40d14acd439 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php @@ -0,0 +1,450 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createUptimeCheckConfig($parent, $uptimeCheckConfig); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + try { + $gapicClient->deleteUptimeCheckConfig($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + try { + $gapicClient->getUptimeCheckConfig($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listUptimeCheckConfigs($parent); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listUptimeCheckIps(); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateUptimeCheckConfig($uptimeCheckConfig); + // If the $gapicClient 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()); + } +} From 7d13dd4535d6d7441654a1d50bb29918c399f964 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 12 Apr 2024 21:04:34 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Monitoring/metadata/V3/QueryService.php | 4 +- .../V3/GroupServiceClient/create_group.php | 5 +- .../V3/GroupServiceClient/list_groups.php | 5 +- .../create_metric_descriptor.php | 10 +- .../create_service_time_series.php | 5 +- .../create_time_series.php | 8 +- .../delete_metric_descriptor.php | 3 +- .../get_metric_descriptor.php | 5 +- .../get_monitored_resource_descriptor.php | 2 +- .../list_metric_descriptors.php | 7 +- .../list_monitored_resource_descriptors.php | 7 +- .../MetricServiceClient/list_time_series.php | 14 +- .../QueryServiceClient/query_time_series.php | 7 +- .../create_service.php | 5 +- .../delete_service_level_objective.php | 3 +- .../get_service_level_objective.php | 3 +- .../list_service_level_objectives.php | 2 +- .../list_services.php | 8 +- .../AlertPolicy/Condition/MetricThreshold.php | 12 +- .../src/V3/AlertPolicy/Documentation.php | 4 +- .../src/V3/Client/MetricServiceClient.php | 18 +- .../src/V3/Client/QueryServiceClient.php | 4 +- .../Client/ServiceMonitoringServiceClient.php | 8 +- Monitoring/src/V3/CreateGroupRequest.php | 45 +- .../src/V3/CreateMetricDescriptorRequest.php | 45 +- .../V3/CreateServiceLevelObjectiveRequest.php | 8 +- Monitoring/src/V3/CreateServiceRequest.php | 25 +- Monitoring/src/V3/CreateTimeSeriesRequest.php | 25 +- .../src/V3/DeleteMetricDescriptorRequest.php | 15 +- .../V3/DeleteServiceLevelObjectiveRequest.php | 15 +- .../src/V3/Gapic/GroupServiceGapicClient.php | 19 +- .../src/V3/Gapic/MetricServiceGapicClient.php | 71 +- .../src/V3/Gapic/QueryServiceGapicClient.php | 9 +- .../ServiceMonitoringServiceGapicClient.php | 66 +- .../src/V3/GetMetricDescriptorRequest.php | 15 +- .../V3/GetServiceLevelObjectiveRequest.php | 15 +- Monitoring/src/V3/ListGroupsRequest.php | 25 +- .../src/V3/ListMetricDescriptorsRequest.php | 41 +- ...istMonitoredResourceDescriptorsRequest.php | 25 +- .../V3/ListServiceLevelObjectivesRequest.php | 10 +- Monitoring/src/V3/ListServicesRequest.php | 162 ++- Monitoring/src/V3/ListTimeSeriesRequest.php | 90 +- .../ListTimeSeriesRequest/TimeSeriesView.php | 2 +- Monitoring/src/V3/QueryTimeSeriesRequest.php | 20 +- Monitoring/src/V3/ServiceTier.php | 12 +- Monitoring/src/V3/TimeInterval.php | 61 +- Monitoring/src/V3/UpdateGroupRequest.php | 25 +- .../Google/Monitoring/V3/Alert.php | Bin 5915 -> 0 bytes .../Google/Monitoring/V3/AlertService.php | 64 - .../Google/Monitoring/V3/Common.php | Bin 2532 -> 0 bytes .../Google/Monitoring/V3/DroppedLabels.php | 33 - .../Google/Monitoring/V3/Group.php | 37 - .../Google/Monitoring/V3/GroupService.php | Bin 3723 -> 0 bytes .../Google/Monitoring/V3/Metric.php | Bin 2648 -> 0 bytes .../Google/Monitoring/V3/MetricService.php | Bin 7118 -> 0 bytes .../Google/Monitoring/V3/MutationRecord.php | 32 - .../Google/Monitoring/V3/Notification.php | Bin 2855 -> 0 bytes .../Monitoring/V3/NotificationService.php | 97 -- .../Google/Monitoring/V3/QueryService.php | 32 - .../Google/Monitoring/V3/Service.php | Bin 4653 -> 0 bytes .../Google/Monitoring/V3/ServiceService.php | 95 -- .../Google/Monitoring/V3/Snooze.php | 39 - .../Google/Monitoring/V3/SnoozeService.php | 56 - .../Google/Monitoring/V3/SpanContext.php | 29 - .../Google/Monitoring/V3/Uptime.php | Bin 5190 -> 0 bytes .../Google/Monitoring/V3/UptimeService.php | 72 - .../Cloud/Monitoring/V3/Aggregation.php | 389 ------ .../Monitoring/V3/Aggregation/Aligner.php | 269 ---- .../Monitoring/V3/Aggregation/Reducer.php | 191 --- .../Cloud/Monitoring/V3/AlertPolicy.php | 805 ----------- .../V3/AlertPolicy/AlertStrategy.php | 167 --- .../NotificationChannelStrategy.php | 139 -- .../AlertStrategy/NotificationRateLimit.php | 81 -- .../Monitoring/V3/AlertPolicy/Condition.php | 373 ------ .../Condition/EvaluationMissingData.php | 76 -- .../V3/AlertPolicy/Condition/LogMatch.php | 151 --- .../AlertPolicy/Condition/MetricAbsence.php | 304 ----- .../AlertPolicy/Condition/MetricThreshold.php | 635 --------- .../MetricThreshold/ForecastOptions.php | 101 -- .../MonitoringQueryLanguageCondition.php | 257 ---- .../PrometheusQueryLanguageCondition.php | 433 ------ .../V3/AlertPolicy/Condition/Trigger.php | 118 -- .../V3/AlertPolicy/ConditionCombinerType.php | 81 -- .../V3/AlertPolicy/Documentation.php | 207 --- .../Monitoring/V3/AlertPolicy/Severity.php | 75 -- .../Google/Cloud/Monitoring/V3/BasicSli.php | 269 ---- .../V3/BasicSli/AvailabilityCriteria.php | 36 - .../V3/BasicSli/LatencyCriteria.php | 84 -- .../Cloud/Monitoring/V3/ComparisonType.php | 90 -- .../V3/CreateAlertPolicyRequest.php | 188 --- .../Monitoring/V3/CreateGroupRequest.php | 181 --- .../V3/CreateMetricDescriptorRequest.php | 151 --- .../V3/CreateNotificationChannelRequest.php | 163 --- .../V3/CreateServiceLevelObjectiveRequest.php | 185 --- .../Monitoring/V3/CreateServiceRequest.php | 180 --- .../Monitoring/V3/CreateSnoozeRequest.php | 149 --- .../Monitoring/V3/CreateTimeSeriesError.php | 135 -- .../Monitoring/V3/CreateTimeSeriesRequest.php | 159 --- .../Monitoring/V3/CreateTimeSeriesSummary.php | 135 -- .../V3/CreateTimeSeriesSummary/Error.php | 114 -- .../V3/CreateUptimeCheckConfigRequest.php | 142 -- .../V3/DeleteAlertPolicyRequest.php | 93 -- .../Monitoring/V3/DeleteGroupRequest.php | 130 -- .../V3/DeleteMetricDescriptorRequest.php | 103 -- .../V3/DeleteNotificationChannelRequest.php | 138 -- .../V3/DeleteServiceLevelObjectiveRequest.php | 92 -- .../Monitoring/V3/DeleteServiceRequest.php | 87 -- .../V3/DeleteUptimeCheckConfigRequest.php | 87 -- .../Cloud/Monitoring/V3/DistributionCut.php | 127 -- .../Cloud/Monitoring/V3/DroppedLabels.php | 80 -- .../Monitoring/V3/GetAlertPolicyRequest.php | 87 -- .../Cloud/Monitoring/V3/GetGroupRequest.php | 87 -- .../V3/GetMetricDescriptorRequest.php | 103 -- .../GetMonitoredResourceDescriptorRequest.php | 98 -- ...etNotificationChannelDescriptorRequest.php | 87 -- .../V3/GetNotificationChannelRequest.php | 87 -- ...ficationChannelVerificationCodeRequest.php | 167 --- ...icationChannelVerificationCodeResponse.php | 131 -- .../V3/GetServiceLevelObjectiveRequest.php | 138 -- .../Cloud/Monitoring/V3/GetServiceRequest.php | 87 -- .../Cloud/Monitoring/V3/GetSnoozeRequest.php | 88 -- .../V3/GetUptimeCheckConfigRequest.php | 87 -- .../src/Google/Cloud/Monitoring/V3/Group.php | 257 ---- .../Cloud/Monitoring/V3/GroupResourceType.php | 66 - .../Cloud/Monitoring/V3/InternalChecker.php | 271 ---- .../Monitoring/V3/InternalChecker/State.php | 74 -- .../Google/Cloud/Monitoring/V3/LabelValue.php | 141 -- .../V3/ListAlertPoliciesRequest.php | 294 ---- .../V3/ListAlertPoliciesResponse.php | 147 -- .../Monitoring/V3/ListGroupMembersRequest.php | 277 ---- .../V3/ListGroupMembersResponse.php | 143 -- .../Cloud/Monitoring/V3/ListGroupsRequest.php | 316 ----- .../Monitoring/V3/ListGroupsResponse.php | 109 -- .../V3/ListMetricDescriptorsRequest.php | 238 ---- .../V3/ListMetricDescriptorsResponse.php | 113 -- ...istMonitoredResourceDescriptorsRequest.php | 222 ---- ...stMonitoredResourceDescriptorsResponse.php | 113 -- ...tNotificationChannelDescriptorsRequest.php | 206 --- ...NotificationChannelDescriptorsResponse.php | 117 -- .../V3/ListNotificationChannelsRequest.php | 307 ----- .../V3/ListNotificationChannelsResponse.php | 151 --- .../V3/ListServiceLevelObjectivesRequest.php | 257 ---- .../V3/ListServiceLevelObjectivesResponse.php | 109 -- .../Monitoring/V3/ListServicesRequest.php | 275 ---- .../Monitoring/V3/ListServicesResponse.php | 109 -- .../Monitoring/V3/ListSnoozesRequest.php | 252 ---- .../Monitoring/V3/ListSnoozesResponse.php | 106 -- .../Monitoring/V3/ListTimeSeriesRequest.php | 501 ------- .../ListTimeSeriesRequest/TimeSeriesView.php | 59 - .../Monitoring/V3/ListTimeSeriesResponse.php | 201 --- .../V3/ListUptimeCheckConfigsRequest.php | 230 ---- .../V3/ListUptimeCheckConfigsResponse.php | 155 --- .../V3/ListUptimeCheckIpsRequest.php | 129 -- .../V3/ListUptimeCheckIpsResponse.php | 125 -- .../Cloud/Monitoring/V3/MutationRecord.php | 111 -- .../Monitoring/V3/NotificationChannel.php | 594 --------- .../VerificationStatus.php | 76 -- .../V3/NotificationChannelDescriptor.php | 326 ----- .../src/Google/Cloud/Monitoring/V3/Point.php | 153 --- .../Google/Cloud/Monitoring/V3/QueryError.php | 115 -- .../Cloud/Monitoring/V3/QueryErrorList.php | 105 -- .../Monitoring/V3/QueryTimeSeriesRequest.php | 197 --- .../Monitoring/V3/QueryTimeSeriesResponse.php | 195 --- .../src/Google/Cloud/Monitoring/V3/Range.php | 101 -- .../Cloud/Monitoring/V3/RequestBasedSli.php | 121 -- ...ficationChannelVerificationCodeRequest.php | 81 -- .../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 - .../Cloud/Monitoring/V3/ServiceTier.php | 74 -- .../src/Google/Cloud/Monitoring/V3/Snooze.php | 224 ---- .../Cloud/Monitoring/V3/Snooze/Criteria.php | 88 -- .../Cloud/Monitoring/V3/SpanContext.php | 91 -- .../Cloud/Monitoring/V3/TextLocator.php | 303 ----- .../Monitoring/V3/TextLocator/Position.php | 108 -- .../Cloud/Monitoring/V3/TimeInterval.php | 165 --- .../Google/Cloud/Monitoring/V3/TimeSeries.php | 404 ------ .../Cloud/Monitoring/V3/TimeSeriesData.php | 114 -- .../V3/TimeSeriesData/PointData.php | 116 -- .../Monitoring/V3/TimeSeriesDescriptor.php | 101 -- .../TimeSeriesDescriptor/ValueDescriptor.php | 184 --- .../Cloud/Monitoring/V3/TimeSeriesRatio.php | 180 --- .../Google/Cloud/Monitoring/V3/TypedValue.php | 213 --- .../V3/UpdateAlertPolicyRequest.php | 239 ---- .../Monitoring/V3/UpdateGroupRequest.php | 134 -- .../V3/UpdateNotificationChannelRequest.php | 151 --- .../V3/UpdateServiceLevelObjectiveRequest.php | 139 -- .../Monitoring/V3/UpdateServiceRequest.php | 139 -- .../Monitoring/V3/UpdateSnoozeRequest.php | 227 ---- .../V3/UpdateUptimeCheckConfigRequest.php | 192 --- .../Cloud/Monitoring/V3/UptimeCheckConfig.php | 711 ---------- .../V3/UptimeCheckConfig/CheckerType.php | 69 - .../V3/UptimeCheckConfig/ContentMatcher.php | 158 --- .../ContentMatcher/ContentMatcherOption.php | 107 -- .../ContentMatcher/JsonPathMatcher.php | 114 -- .../JsonPathMatcher/JsonPathMatcherOption.php | 68 - .../V3/UptimeCheckConfig/HttpCheck.php | 678 ---------- .../HttpCheck/BasicAuthentication.php | 107 -- .../HttpCheck/ContentType.php | 67 - .../HttpCheck/RequestMethod.php | 64 - .../HttpCheck/ResponseStatusCode.php | 112 -- .../ResponseStatusCode/StatusClass.php | 92 -- .../V3/UptimeCheckConfig/PingConfig.php | 72 - .../V3/UptimeCheckConfig/ResourceGroup.php | 113 -- .../V3/UptimeCheckConfig/TcpCheck.php | 122 -- .../Cloud/Monitoring/V3/UptimeCheckIp.php | 160 --- .../Cloud/Monitoring/V3/UptimeCheckRegion.php | 102 -- .../V3/VerifyNotificationChannelRequest.php | 147 -- .../Cloud/Monitoring/V3/WindowsBasedSli.php | 236 ---- .../V3/WindowsBasedSli/MetricRange.php | 125 -- .../WindowsBasedSli/PerformanceThreshold.php | 146 -- .../create_alert_policy.php | 88 -- .../delete_alert_policy.php | 77 -- .../get_alert_policy.php | 73 - .../list_alert_policies.php | 85 -- .../update_alert_policy.php | 66 - .../V3/GroupServiceClient/create_group.php | 76 -- .../V3/GroupServiceClient/delete_group.php | 71 - .../V3/GroupServiceClient/get_group.php | 73 - .../GroupServiceClient/list_group_members.php | 78 -- .../V3/GroupServiceClient/list_groups.php | 79 -- .../V3/GroupServiceClient/update_group.php | 60 - .../create_metric_descriptor.php | 81 -- .../create_service_time_series.php | 84 -- .../create_time_series.php | 82 -- .../delete_metric_descriptor.php | 77 -- .../get_metric_descriptor.php | 77 -- .../get_monitored_resource_descriptor.php | 79 -- .../list_metric_descriptors.php | 79 -- .../list_monitored_resource_descriptors.php | 79 -- .../MetricServiceClient/list_time_series.php | 99 -- .../create_notification_channel.php | 87 -- .../delete_notification_channel.php | 79 -- .../get_notification_channel.php | 80 -- .../get_notification_channel_descriptor.php | 77 -- ...notification_channel_verification_code.php | 96 -- .../list_notification_channel_descriptors.php | 86 -- .../list_notification_channels.php | 88 -- ...notification_channel_verification_code.php | 73 - .../update_notification_channel.php | 65 - .../verify_notification_channel.php | 85 -- .../QueryServiceClient/query_time_series.php | 84 -- .../create_service.php | 76 -- .../create_service_level_objective.php | 75 -- .../delete_service.php | 71 - .../delete_service_level_objective.php | 76 -- .../get_service.php | 73 - .../get_service_level_objective.php | 78 -- .../list_service_level_objectives.php | 80 -- .../list_services.php | 80 -- .../update_service.php | 59 - .../update_service_level_objective.php | 59 - .../V3/SnoozeServiceClient/create_snooze.php | 99 -- .../V3/SnoozeServiceClient/get_snooze.php | 73 - .../V3/SnoozeServiceClient/list_snoozes.php | 81 -- .../V3/SnoozeServiceClient/update_snooze.php | 90 -- .../create_uptime_check_config.php | 76 -- .../delete_uptime_check_config.php | 76 -- .../get_uptime_check_config.php | 76 -- .../list_uptime_check_configs.php | 80 -- .../list_uptime_check_ips.php | 62 - .../update_uptime_check_config.php | 62 - .../v3/src/V3/AlertPolicyServiceClient.php | 34 - .../V3/Client/AlertPolicyServiceClient.php | 507 ------- .../v3/src/V3/Client/GroupServiceClient.php | 444 ------- .../v3/src/V3/Client/MetricServiceClient.php | 675 ---------- .../NotificationChannelServiceClient.php | 679 ---------- .../v3/src/V3/Client/QueryServiceClient.php | 193 --- .../Client/ServiceMonitoringServiceClient.php | 635 --------- .../v3/src/V3/Client/SnoozeServiceClient.php | 434 ------ .../V3/Client/UptimeCheckServiceClient.php | 451 ------- .../Gapic/AlertPolicyServiceGapicClient.php | 806 ----------- .../src/V3/Gapic/GroupServiceGapicClient.php | 752 ----------- .../src/V3/Gapic/MetricServiceGapicClient.php | 1178 ----------------- .../NotificationChannelServiceGapicClient.php | 1075 --------------- .../src/V3/Gapic/QueryServiceGapicClient.php | 256 ---- .../ServiceMonitoringServiceGapicClient.php | 1044 --------------- .../src/V3/Gapic/SnoozeServiceGapicClient.php | 680 ---------- .../Gapic/UptimeCheckServiceGapicClient.php | 692 ---------- .../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/SnoozeServiceClient.php | 34 - .../v3/src/V3/UptimeCheckServiceClient.php | 34 - .../Monitoring/v3/src/V3/gapic_metadata.json | 336 ----- .../alert_policy_service_client_config.json | 69 - ...alert_policy_service_descriptor_config.php | 87 -- ...lert_policy_service_rest_client_config.php | 67 - .../group_service_client_config.json | 86 -- .../group_service_descriptor_config.php | 103 -- .../group_service_rest_client_config.php | 78 -- .../metric_service_client_config.json | 101 -- .../metric_service_descriptor_config.php | 154 --- .../metric_service_rest_client_config.php | 136 -- ...ication_channel_service_client_config.json | 94 -- ...tion_channel_service_descriptor_config.php | 155 --- ...ion_channel_service_rest_client_config.php | 125 -- .../query_service_client_config.json | 27 - .../query_service_descriptor_config.php | 28 - .../query_service_rest_client_config.php | 21 - ...vice_monitoring_service_client_config.json | 94 -- ...e_monitoring_service_descriptor_config.php | 156 --- ..._monitoring_service_rest_client_config.php | 125 -- .../snooze_service_client_config.json | 64 - .../snooze_service_descriptor_config.php | 74 -- .../snooze_service_rest_client_config.php | 59 - .../uptime_check_service_client_config.json | 74 -- ...uptime_check_service_descriptor_config.php | 95 -- ...ptime_check_service_rest_client_config.php | 71 - .../Unit/V3/AlertPolicyServiceClientTest.php | 380 ------ .../Client/AlertPolicyServiceClientTest.php | 442 ------- .../Unit/V3/Client/GroupServiceClientTest.php | 541 -------- .../V3/Client/MetricServiceClientTest.php | 769 ----------- .../NotificationChannelServiceClientTest.php | 809 ----------- .../Unit/V3/Client/QueryServiceClientTest.php | 182 --- .../ServiceMonitoringServiceClientTest.php | 790 ----------- .../V3/Client/SnoozeServiceClientTest.php | 426 ------ .../Client/UptimeCheckServiceClientTest.php | 517 -------- .../tests/Unit/V3/GroupServiceClientTest.php | 468 ------- .../tests/Unit/V3/MetricServiceClientTest.php | 672 ---------- .../NotificationChannelServiceClientTest.php | 716 ---------- .../tests/Unit/V3/QueryServiceClientTest.php | 134 -- .../V3/ServiceMonitoringServiceClientTest.php | 701 ---------- .../tests/Unit/V3/SnoozeServiceClientTest.php | 359 ----- .../Unit/V3/UptimeCheckServiceClientTest.php | 450 ------- 335 files changed, 566 insertions(+), 53155 deletions(-) delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Alert.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/UptimeService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/AlertPolicyServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/MetricServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/NotificationChannelServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/QueryServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/ServiceMonitoringServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/SnoozeServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/UptimeCheckServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/gapic_metadata.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php diff --git a/Monitoring/metadata/V3/QueryService.php b/Monitoring/metadata/V3/QueryService.php index 9c53d1193e1..fb4ffd3bc28 100644 --- a/Monitoring/metadata/V3/QueryService.php +++ b/Monitoring/metadata/V3/QueryService.php @@ -15,12 +15,12 @@ public static function initOnce() { return; } \GPBMetadata\Google\Api\Annotations::initOnce(); - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); \GPBMetadata\Google\Api\Client::initOnce(); + \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); $pool->internalAddGeneratedFile( ' ¼ -(google/monitoring/v3/query_service.protogoogle.monitoring.v3)google/monitoring/v3/metric_service.protogoogle/api/client.proto2Þ +(google/monitoring/v3/query_service.protogoogle.monitoring.v3google/api/client.proto)google/monitoring/v3/metric_service.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.v3BQueryServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' diff --git a/Monitoring/samples/V3/GroupServiceClient/create_group.php b/Monitoring/samples/V3/GroupServiceClient/create_group.php index 4953ccecd48..8a1a90022d2 100644 --- a/Monitoring/samples/V3/GroupServiceClient/create_group.php +++ b/Monitoring/samples/V3/GroupServiceClient/create_group.php @@ -31,8 +31,9 @@ /** * Creates a new group. * - * @param string $name The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the group. The format is: + * @param string $name 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] */ diff --git a/Monitoring/samples/V3/GroupServiceClient/list_groups.php b/Monitoring/samples/V3/GroupServiceClient/list_groups.php index a3163d527f7..9824913c190 100644 --- a/Monitoring/samples/V3/GroupServiceClient/list_groups.php +++ b/Monitoring/samples/V3/GroupServiceClient/list_groups.php @@ -32,8 +32,9 @@ /** * Lists the existing groups. * - * @param string $name The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose groups are to be listed. The format is: + * @param string $name 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] */ diff --git a/Monitoring/samples/V3/MetricServiceClient/create_metric_descriptor.php b/Monitoring/samples/V3/MetricServiceClient/create_metric_descriptor.php index eb3f9be5c9a..6bd13a39d0f 100644 --- a/Monitoring/samples/V3/MetricServiceClient/create_metric_descriptor.php +++ b/Monitoring/samples/V3/MetricServiceClient/create_metric_descriptor.php @@ -30,13 +30,15 @@ /** * Creates a new metric descriptor. - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. + * The creation is executed asynchronously. * User-created metric descriptors define * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * The metric descriptor is updated if it already exists, + * except that metric labels are never removed. * - * @param string $name The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @param string $name 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] */ diff --git a/Monitoring/samples/V3/MetricServiceClient/create_service_time_series.php b/Monitoring/samples/V3/MetricServiceClient/create_service_time_series.php index db344b7c17e..598599ca295 100644 --- a/Monitoring/samples/V3/MetricServiceClient/create_service_time_series.php +++ b/Monitoring/samples/V3/MetricServiceClient/create_service_time_series.php @@ -39,8 +39,9 @@ * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] * instead. * - * @param string $formattedName The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @param string $formattedName 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] * Please see {@see MetricServiceClient::projectName()} for help formatting this field. diff --git a/Monitoring/samples/V3/MetricServiceClient/create_time_series.php b/Monitoring/samples/V3/MetricServiceClient/create_time_series.php index 530044e80e9..419488c9c12 100644 --- a/Monitoring/samples/V3/MetricServiceClient/create_time_series.php +++ b/Monitoring/samples/V3/MetricServiceClient/create_time_series.php @@ -33,9 +33,13 @@ * 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 method does not support + * [resource locations constraint of an organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). * - * @param string $formattedName The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @param string $formattedName 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] * Please see {@see MetricServiceClient::projectName()} for help formatting this field. diff --git a/Monitoring/samples/V3/MetricServiceClient/delete_metric_descriptor.php b/Monitoring/samples/V3/MetricServiceClient/delete_metric_descriptor.php index 30db5fe24e7..538faf02b3b 100644 --- a/Monitoring/samples/V3/MetricServiceClient/delete_metric_descriptor.php +++ b/Monitoring/samples/V3/MetricServiceClient/delete_metric_descriptor.php @@ -32,7 +32,8 @@ * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be * deleted. * - * @param string $formattedName The metric descriptor on which to execute the request. The format is: + * @param string $formattedName The metric descriptor on which to execute the request. The format + * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * diff --git a/Monitoring/samples/V3/MetricServiceClient/get_metric_descriptor.php b/Monitoring/samples/V3/MetricServiceClient/get_metric_descriptor.php index ffc75671b31..4913db2b07b 100644 --- a/Monitoring/samples/V3/MetricServiceClient/get_metric_descriptor.php +++ b/Monitoring/samples/V3/MetricServiceClient/get_metric_descriptor.php @@ -29,9 +29,10 @@ use Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest; /** - * Gets a single metric descriptor. This method does not require a Workspace. + * Gets a single metric descriptor. * - * @param string $formattedName The metric descriptor on which to execute the request. The format is: + * @param string $formattedName The metric descriptor on which to execute the request. The format + * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * diff --git a/Monitoring/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php b/Monitoring/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php index d4a3b1b36b6..05b69a6ca05 100644 --- a/Monitoring/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php +++ b/Monitoring/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php @@ -29,7 +29,7 @@ use Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest; /** - * Gets a single monitored resource descriptor. This method does not require a Workspace. + * Gets a single monitored resource descriptor. * * @param string $formattedName The monitored resource descriptor to get. The format is: * diff --git a/Monitoring/samples/V3/MetricServiceClient/list_metric_descriptors.php b/Monitoring/samples/V3/MetricServiceClient/list_metric_descriptors.php index 26d849faaa2..476bec0cbdc 100644 --- a/Monitoring/samples/V3/MetricServiceClient/list_metric_descriptors.php +++ b/Monitoring/samples/V3/MetricServiceClient/list_metric_descriptors.php @@ -30,10 +30,11 @@ use Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest; /** - * Lists metric descriptors that match a filter. This method does not require a Workspace. + * Lists metric descriptors that match a filter. * - * @param string $name The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @param string $name 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] */ diff --git a/Monitoring/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php b/Monitoring/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php index a36f8135a3c..f4e75cb9811 100644 --- a/Monitoring/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php +++ b/Monitoring/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php @@ -30,10 +30,11 @@ use Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsRequest; /** - * Lists monitored resource descriptors that match a filter. This method does not require a Workspace. + * Lists monitored resource descriptors that match a filter. * - * @param string $name The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @param string $name 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] */ diff --git a/Monitoring/samples/V3/MetricServiceClient/list_time_series.php b/Monitoring/samples/V3/MetricServiceClient/list_time_series.php index 5e2f4c21d74..83960d35fa4 100644 --- a/Monitoring/samples/V3/MetricServiceClient/list_time_series.php +++ b/Monitoring/samples/V3/MetricServiceClient/list_time_series.php @@ -32,19 +32,21 @@ use Google\Cloud\Monitoring\V3\TimeSeries; /** - * Lists time series that match a filter. This method does not require a Workspace. + * Lists time series that match a filter. * - * @param string $formattedName The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * @param string $formattedName 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] * Please see {@see MetricServiceClient::workspaceName()} for help formatting this field. - * @param string $filter 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: + * @param string $filter 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" diff --git a/Monitoring/samples/V3/QueryServiceClient/query_time_series.php b/Monitoring/samples/V3/QueryServiceClient/query_time_series.php index e3db84e1685..3f8272a75e9 100644 --- a/Monitoring/samples/V3/QueryServiceClient/query_time_series.php +++ b/Monitoring/samples/V3/QueryServiceClient/query_time_series.php @@ -30,10 +30,11 @@ use Google\Cloud\Monitoring\V3\TimeSeriesData; /** - * Queries time series using Monitoring Query Language. This method does not require a Workspace. + * Queries time series using Monitoring Query Language. * - * @param string $name The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @param string $name 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 The query in the [Monitoring Query diff --git a/Monitoring/samples/V3/ServiceMonitoringServiceClient/create_service.php b/Monitoring/samples/V3/ServiceMonitoringServiceClient/create_service.php index 92d46e77dc1..8add387c880 100644 --- a/Monitoring/samples/V3/ServiceMonitoringServiceClient/create_service.php +++ b/Monitoring/samples/V3/ServiceMonitoringServiceClient/create_service.php @@ -31,8 +31,9 @@ /** * Create a `Service`. * - * @param string $parent Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: + * @param string $parent Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: * * projects/[PROJECT_ID_OR_NUMBER] */ diff --git a/Monitoring/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php b/Monitoring/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php index 764eb5e72d0..739ce6177f4 100644 --- a/Monitoring/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php +++ b/Monitoring/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php @@ -30,7 +30,8 @@ /** * Delete the given `ServiceLevelObjective`. * - * @param string $formattedName Resource name of the `ServiceLevelObjective` to delete. The format is: + * @param string $formattedName Resource name of the `ServiceLevelObjective` to delete. The + * format is: * * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. diff --git a/Monitoring/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php b/Monitoring/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php index eceb135a053..e2ec5ada72c 100644 --- a/Monitoring/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php +++ b/Monitoring/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php @@ -31,7 +31,8 @@ /** * Get a `ServiceLevelObjective` by name. * - * @param string $formattedName Resource name of the `ServiceLevelObjective` to get. The format is: + * @param string $formattedName Resource name of the `ServiceLevelObjective` to get. The format + * is: * * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. diff --git a/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php b/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php index 493891218a9..7ae396e0621 100644 --- a/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php +++ b/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php @@ -33,7 +33,7 @@ * List the `ServiceLevelObjective`s for the given `Service`. * * @param string $formattedParent Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: + * project or a Monitoring Metrics Scope. The formats are: * * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- diff --git a/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_services.php b/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_services.php index 71537bd274b..3fdc2d33321 100644 --- a/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_services.php +++ b/Monitoring/samples/V3/ServiceMonitoringServiceClient/list_services.php @@ -30,11 +30,11 @@ use Google\Cloud\Monitoring\V3\Service; /** - * List `Service`s for this workspace. + * List `Service`s for this Metrics Scope. * - * @param string $parent 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: + * @param string $parent Resource name of the parent containing the listed services, + * either a [project](https://cloud.google.com/monitoring/api/v3#project_name) + * or a Monitoring Metrics Scope. The formats are: * * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] diff --git a/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php b/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php index 4669c0e483c..24a90b27ade 100644 --- a/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php +++ b/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php @@ -127,7 +127,8 @@ class MetricThreshold extends \Google\Protobuf\Internal\Message private $trigger = null; /** * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. * * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; */ @@ -214,7 +215,8 @@ class MetricThreshold extends \Google\Protobuf\Internal\Message * are specified. * @type int $evaluation_missing_data * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. * } */ public function __construct($data = NULL) { @@ -598,7 +600,8 @@ public function setTrigger($var) /** * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. * * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; * @return int @@ -610,7 +613,8 @@ public function getEvaluationMissingData() /** * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. * * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; * @param int $var diff --git a/Monitoring/src/V3/AlertPolicy/Documentation.php b/Monitoring/src/V3/AlertPolicy/Documentation.php index b76d3a9d11f..f5ee62c1c8e 100644 --- a/Monitoring/src/V3/AlertPolicy/Documentation.php +++ b/Monitoring/src/V3/AlertPolicy/Documentation.php @@ -9,8 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A content string and a MIME type that describes the content string's - * format. + * Documentation that is included in the notifications and incidents + * pertaining to this policy. * * Generated from protobuf message google.monitoring.v3.AlertPolicy.Documentation */ diff --git a/Monitoring/src/V3/Client/MetricServiceClient.php b/Monitoring/src/V3/Client/MetricServiceClient.php index 545fc28600b..768b64becf4 100644 --- a/Monitoring/src/V3/Client/MetricServiceClient.php +++ b/Monitoring/src/V3/Client/MetricServiceClient.php @@ -423,10 +423,11 @@ public function __call($method, $args) /** * Creates a new metric descriptor. - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. + * The creation is executed asynchronously. * User-created metric descriptors define * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * The metric descriptor is updated if it already exists, + * except that metric labels are never removed. * * The async variant is {@see MetricServiceClient::createMetricDescriptorAsync()} . * @@ -489,6 +490,9 @@ public function createServiceTimeSeries(CreateTimeSeriesRequest $request, array * 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 method does not support + * [resource locations constraint of an organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). * * The async variant is {@see MetricServiceClient::createTimeSeriesAsync()} . * @@ -538,7 +542,7 @@ public function deleteMetricDescriptor(DeleteMetricDescriptorRequest $request, a } /** - * Gets a single metric descriptor. This method does not require a Workspace. + * Gets a single metric descriptor. * * The async variant is {@see MetricServiceClient::getMetricDescriptorAsync()} . * @@ -564,7 +568,7 @@ public function getMetricDescriptor(GetMetricDescriptorRequest $request, array $ } /** - * Gets a single monitored resource descriptor. This method does not require a Workspace. + * Gets a single monitored resource descriptor. * * The async variant is * {@see MetricServiceClient::getMonitoredResourceDescriptorAsync()} . @@ -591,7 +595,7 @@ public function getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorReq } /** - * Lists metric descriptors that match a filter. This method does not require a Workspace. + * Lists metric descriptors that match a filter. * * The async variant is {@see MetricServiceClient::listMetricDescriptorsAsync()} . * @@ -617,7 +621,7 @@ public function listMetricDescriptors(ListMetricDescriptorsRequest $request, arr } /** - * Lists monitored resource descriptors that match a filter. This method does not require a Workspace. + * Lists monitored resource descriptors that match a filter. * * The async variant is * {@see MetricServiceClient::listMonitoredResourceDescriptorsAsync()} . @@ -644,7 +648,7 @@ public function listMonitoredResourceDescriptors(ListMonitoredResourceDescriptor } /** - * Lists time series that match a filter. This method does not require a Workspace. + * Lists time series that match a filter. * * The async variant is {@see MetricServiceClient::listTimeSeriesAsync()} . * diff --git a/Monitoring/src/V3/Client/QueryServiceClient.php b/Monitoring/src/V3/Client/QueryServiceClient.php index eaf902d1ac7..747ac729701 100644 --- a/Monitoring/src/V3/Client/QueryServiceClient.php +++ b/Monitoring/src/V3/Client/QueryServiceClient.php @@ -36,7 +36,7 @@ use GuzzleHttp\Promise\PromiseInterface; /** - * Service Description: The QueryService API is used to manage time series data in Stackdriver + * Service Description: The QueryService API is used to manage time series data in Cloud * Monitoring. Time series data is a collection of data points that describes * the time-varying values of a metric. * @@ -166,7 +166,7 @@ public function __call($method, $args) } /** - * Queries time series using Monitoring Query Language. This method does not require a Workspace. + * Queries time series using Monitoring Query Language. * * The async variant is {@see QueryServiceClient::queryTimeSeriesAsync()} . * diff --git a/Monitoring/src/V3/Client/ServiceMonitoringServiceClient.php b/Monitoring/src/V3/Client/ServiceMonitoringServiceClient.php index 67cafe33953..d45da317e3a 100644 --- a/Monitoring/src/V3/Client/ServiceMonitoringServiceClient.php +++ b/Monitoring/src/V3/Client/ServiceMonitoringServiceClient.php @@ -49,9 +49,9 @@ /** * Service Description: The Cloud Monitoring Service-Oriented Monitoring API has endpoints for - * managing and querying aspects of a workspace's services. These include the - * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy - * of categorized Health Metrics. + * managing and querying aspects of a Metrics Scope's services. These include + * the `Service`'s monitored resources, its Service-Level Objectives, and a + * taxonomy of categorized Health Metrics. * * This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. @@ -553,7 +553,7 @@ public function listServiceLevelObjectives(ListServiceLevelObjectivesRequest $re } /** - * List `Service`s for this workspace. + * List `Service`s for this Metrics Scope. * * The async variant is {@see ServiceMonitoringServiceClient::listServicesAsync()} * . diff --git a/Monitoring/src/V3/CreateGroupRequest.php b/Monitoring/src/V3/CreateGroupRequest.php index 5ddfdf2983b..da3b15c245e 100644 --- a/Monitoring/src/V3/CreateGroupRequest.php +++ b/Monitoring/src/V3/CreateGroupRequest.php @@ -16,16 +16,17 @@ 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: + * 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) = { */ private $name = ''; /** - * Required. A group definition. It is an error to define the `name` field because - * the system assigns the 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]; */ @@ -38,12 +39,13 @@ class CreateGroupRequest extends \Google\Protobuf\Internal\Message private $validate_only = false; /** - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the group. The format is: + * @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 \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. + * @param \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. * * @return \Google\Cloud\Monitoring\V3\CreateGroupRequest * @@ -63,12 +65,13 @@ public static function build(string $name, \Google\Cloud\Monitoring\V3\Group $gr * 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: + * 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. + * 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. * } @@ -79,8 +82,9 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the group. The format is: + * 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) = { @@ -92,8 +96,9 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the group. The format is: + * 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) = { @@ -109,8 +114,8 @@ public function setName($var) } /** - * Required. A group definition. It is an error to define the `name` field because - * the system assigns the 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]; * @return \Google\Cloud\Monitoring\V3\Group|null @@ -131,8 +136,8 @@ public function clearGroup() } /** - * Required. A group definition. It is an error to define the `name` field because - * the system assigns the 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]; * @param \Google\Cloud\Monitoring\V3\Group $var diff --git a/Monitoring/src/V3/CreateMetricDescriptorRequest.php b/Monitoring/src/V3/CreateMetricDescriptorRequest.php index 050fa446956..7fc72af2e7d 100644 --- a/Monitoring/src/V3/CreateMetricDescriptorRequest.php +++ b/Monitoring/src/V3/CreateMetricDescriptorRequest.php @@ -16,8 +16,9 @@ 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: + * 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] * @@ -25,20 +26,21 @@ class CreateMetricDescriptorRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * 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]; */ private $metric_descriptor = null; /** - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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 \Google\Api\MetricDescriptor $metricDescriptor Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * descriptor. + * @param \Google\Api\MetricDescriptor $metricDescriptor Required. The new [custom + * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. * * @return \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest * @@ -58,13 +60,14 @@ public static function build(string $name, \Google\Api\MetricDescriptor $metricD * 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: + * 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. + * Required. The new [custom + * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. * } */ public function __construct($data = NULL) { @@ -73,8 +76,9 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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] * @@ -87,8 +91,9 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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] * @@ -105,8 +110,8 @@ public function setName($var) } /** - * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * 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]; * @return \Google\Api\MetricDescriptor|null @@ -127,8 +132,8 @@ public function clearMetricDescriptor() } /** - * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * 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 diff --git a/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php b/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php index da1d61558c4..5a1e46c5693 100644 --- a/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php +++ b/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php @@ -25,7 +25,7 @@ class CreateServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Messa /** * Optional. The ServiceLevelObjective id to use for this * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` + * match the pattern `^[a-zA-Z0-9-_:.]+$` * * Generated from protobuf field string service_level_objective_id = 3; */ @@ -71,7 +71,7 @@ public static function build(string $parent, \Google\Cloud\Monitoring\V3\Service * @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\-]+` + * match the pattern `^[a-zA-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 @@ -114,7 +114,7 @@ public function setParent($var) /** * Optional. The ServiceLevelObjective id to use for this * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` + * match the pattern `^[a-zA-Z0-9-_:.]+$` * * Generated from protobuf field string service_level_objective_id = 3; * @return string @@ -127,7 +127,7 @@ public function getServiceLevelObjectiveId() /** * Optional. The ServiceLevelObjective id to use for this * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` + * match the pattern `^[a-zA-Z0-9-_:.]+$` * * Generated from protobuf field string service_level_objective_id = 3; * @param string $var diff --git a/Monitoring/src/V3/CreateServiceRequest.php b/Monitoring/src/V3/CreateServiceRequest.php index 97d782da716..de39b2357f3 100644 --- a/Monitoring/src/V3/CreateServiceRequest.php +++ b/Monitoring/src/V3/CreateServiceRequest.php @@ -16,8 +16,9 @@ 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: + * Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: * projects/[PROJECT_ID_OR_NUMBER] * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -38,8 +39,9 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message private $service = null; /** - * @param string $parent Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: + * @param string $parent Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to create. @@ -62,8 +64,9 @@ public static function build(string $parent, \Google\Cloud\Monitoring\V3\Service * 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: + * Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. 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 @@ -78,8 +81,9 @@ public function __construct($data = NULL) { } /** - * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: + * Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: * projects/[PROJECT_ID_OR_NUMBER] * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -91,8 +95,9 @@ public function getParent() } /** - * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: + * Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: * projects/[PROJECT_ID_OR_NUMBER] * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { diff --git a/Monitoring/src/V3/CreateTimeSeriesRequest.php b/Monitoring/src/V3/CreateTimeSeriesRequest.php index 1da2e80f2aa..783056dd8aa 100644 --- a/Monitoring/src/V3/CreateTimeSeriesRequest.php +++ b/Monitoring/src/V3/CreateTimeSeriesRequest.php @@ -16,8 +16,9 @@ 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: + * 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) = { @@ -36,8 +37,9 @@ class CreateTimeSeriesRequest extends \Google\Protobuf\Internal\Message private $time_series; /** - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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] * Please see {@see MetricServiceClient::projectName()} for help formatting this field. @@ -67,8 +69,9 @@ public static function build(string $name, array $timeSeries): self * 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: + * 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 array<\Google\Cloud\Monitoring\V3\TimeSeries>|\Google\Protobuf\Internal\RepeatedField $time_series * Required. The new data to be added to a list of time series. @@ -85,8 +88,9 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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) = { @@ -98,8 +102,9 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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) = { diff --git a/Monitoring/src/V3/DeleteMetricDescriptorRequest.php b/Monitoring/src/V3/DeleteMetricDescriptorRequest.php index e77fea1c80a..3073c5261b9 100644 --- a/Monitoring/src/V3/DeleteMetricDescriptorRequest.php +++ b/Monitoring/src/V3/DeleteMetricDescriptorRequest.php @@ -16,7 +16,8 @@ class DeleteMetricDescriptorRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. @@ -26,7 +27,8 @@ class DeleteMetricDescriptorRequest extends \Google\Protobuf\Internal\Message private $name = ''; /** - * @param string $name Required. The metric descriptor on which to execute the request. The format is: + * @param string $name Required. The metric descriptor on which to execute the request. The format + * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * @@ -51,7 +53,8 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. @@ -63,7 +66,8 @@ public function __construct($data = NULL) { } /** - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. @@ -77,7 +81,8 @@ public function getName() } /** - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. diff --git a/Monitoring/src/V3/DeleteServiceLevelObjectiveRequest.php b/Monitoring/src/V3/DeleteServiceLevelObjectiveRequest.php index 42450ed2b8c..8f402e11081 100644 --- a/Monitoring/src/V3/DeleteServiceLevelObjectiveRequest.php +++ b/Monitoring/src/V3/DeleteServiceLevelObjectiveRequest.php @@ -16,7 +16,8 @@ class DeleteServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * 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) = { @@ -24,7 +25,8 @@ class DeleteServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Messa private $name = ''; /** - * @param string $name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * @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] * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. @@ -46,7 +48,8 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * Required. Resource name of the `ServiceLevelObjective` to delete. The + * format is: * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] * } */ @@ -56,7 +59,8 @@ public function __construct($data = NULL) { } /** - * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * 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) = { @@ -68,7 +72,8 @@ public function getName() } /** - * Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * 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) = { diff --git a/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php b/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php index b5c257d69f4..3cef0b7effc 100644 --- a/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php @@ -376,12 +376,13 @@ public function __construct(array $options = []) * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the group. The format is: + * @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 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. * @@ -619,8 +620,9 @@ public function listGroupMembers($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose groups are to be listed. The format is: + * @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 { @@ -715,8 +717,9 @@ public function listGroups($name, array $optionalArgs = []) * } * ``` * - * @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 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. * diff --git a/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php b/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php index 47049fc615d..00bf3199265 100644 --- a/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php @@ -593,10 +593,11 @@ public function __construct(array $options = []) /** * Creates a new metric descriptor. - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. + * The creation is executed asynchronously. * User-created metric descriptors define * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * The metric descriptor is updated if it already exists, + * except that metric labels are never removed. * * Sample code: * ``` @@ -610,12 +611,13 @@ public function __construct(array $options = []) * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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 MetricDescriptor $metricDescriptor Required. The new [custom + * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. * @param array $optionalArgs { * Optional. * @@ -664,8 +666,9 @@ public function createMetricDescriptor($name, $metricDescriptor, array $optional * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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. @@ -703,6 +706,9 @@ public function createServiceTimeSeries($name, $timeSeries, array $optionalArgs * 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 method does not support + * [resource locations constraint of an organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). * * Sample code: * ``` @@ -716,8 +722,9 @@ public function createServiceTimeSeries($name, $timeSeries, array $optionalArgs * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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. @@ -766,7 +773,8 @@ public function createTimeSeries($name, $timeSeries, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The metric descriptor on which to execute the request. The format is: + * @param string $name Required. The metric descriptor on which to execute the request. The format + * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * @@ -795,7 +803,7 @@ public function deleteMetricDescriptor($name, array $optionalArgs = []) } /** - * Gets a single metric descriptor. This method does not require a Workspace. + * Gets a single metric descriptor. * * Sample code: * ``` @@ -808,7 +816,8 @@ public function deleteMetricDescriptor($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The metric descriptor on which to execute the request. The format is: + * @param string $name Required. The metric descriptor on which to execute the request. The format + * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * @@ -839,7 +848,7 @@ public function getMetricDescriptor($name, array $optionalArgs = []) } /** - * Gets a single monitored resource descriptor. This method does not require a Workspace. + * Gets a single monitored resource descriptor. * * Sample code: * ``` @@ -883,7 +892,7 @@ public function getMonitoredResourceDescriptor($name, array $optionalArgs = []) } /** - * Lists metric descriptors that match a filter. This method does not require a Workspace. + * Lists metric descriptors that match a filter. * * Sample code: * ``` @@ -908,8 +917,9 @@ public function getMonitoredResourceDescriptor($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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 { @@ -967,7 +977,7 @@ public function listMetricDescriptors($name, array $optionalArgs = []) } /** - * Lists monitored resource descriptors that match a filter. This method does not require a Workspace. + * Lists monitored resource descriptors that match a filter. * * Sample code: * ``` @@ -992,8 +1002,9 @@ public function listMetricDescriptors($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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 { @@ -1049,7 +1060,7 @@ public function listMonitoredResourceDescriptors($name, array $optionalArgs = [] } /** - * Lists time series that match a filter. This method does not require a Workspace. + * Lists time series that match a filter. * * Sample code: * ``` @@ -1077,22 +1088,24 @@ public function listMonitoredResourceDescriptors($name, array $optionalArgs = [] * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * @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: + * @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 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 { diff --git a/Monitoring/src/V3/Gapic/QueryServiceGapicClient.php b/Monitoring/src/V3/Gapic/QueryServiceGapicClient.php index 225861575f4..cd386575a62 100644 --- a/Monitoring/src/V3/Gapic/QueryServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/QueryServiceGapicClient.php @@ -36,7 +36,7 @@ use Google\Cloud\Monitoring\V3\QueryTimeSeriesResponse; /** - * Service Description: The QueryService API is used to manage time series data in Stackdriver + * Service Description: The QueryService API is used to manage time series data in Cloud * Monitoring. Time series data is a collection of data points that describes * the time-varying values of a metric. * @@ -178,7 +178,7 @@ public function __construct(array $options = []) } /** - * Queries time series using Monitoring Query Language. This method does not require a Workspace. + * Queries time series using Monitoring Query Language. * * Sample code: * ``` @@ -204,8 +204,9 @@ public function __construct(array $options = []) * } * ``` * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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 diff --git a/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php b/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php index d837f556bc8..cbcf467f943 100644 --- a/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php @@ -53,9 +53,9 @@ /** * Service Description: The Cloud Monitoring Service-Oriented Monitoring API has endpoints for - * managing and querying aspects of a workspace's services. These include the - * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy - * of categorized Health Metrics. + * managing and querying aspects of a Metrics Scope's services. These include + * the `Service`'s monitored resources, its Service-Level Objectives, and a + * taxonomy of categorized Health Metrics. * * This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -502,8 +502,9 @@ public function __construct(array $options = []) * } * ``` * - * @param string $parent Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: + * @param string $parent Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param Service $service Required. The `Service` to create. @@ -566,7 +567,7 @@ public function createService($parent, $service, array $optionalArgs = []) * @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\-]+` + * match the pattern `^[a-zA-Z0-9-_:.]+$` * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -646,7 +647,8 @@ public function deleteService($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + * @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 { @@ -726,7 +728,8 @@ public function getService($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * @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 { @@ -790,7 +793,7 @@ public function getServiceLevelObjective($name, array $optionalArgs = []) * ``` * * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: + * project or a Monitoring Metrics Scope. The formats are: * * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- @@ -852,7 +855,7 @@ public function listServiceLevelObjectives($parent, array $optionalArgs = []) } /** - * List `Service`s for this workspace. + * List `Service`s for this Metrics Scope. * * Sample code: * ``` @@ -877,9 +880,9 @@ public function listServiceLevelObjectives($parent, array $optionalArgs = []) * } * ``` * - * @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: + * @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 Metrics Scope. The formats are: * * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] @@ -887,25 +890,24 @@ public function listServiceLevelObjectives($parent, 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). + * A filter specifying what `Service`s to return. The filter supports + * filtering on a particular service-identifier type or one of its attributes. + * + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service * @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 diff --git a/Monitoring/src/V3/GetMetricDescriptorRequest.php b/Monitoring/src/V3/GetMetricDescriptorRequest.php index c4113dd41da..d079c76ee2c 100644 --- a/Monitoring/src/V3/GetMetricDescriptorRequest.php +++ b/Monitoring/src/V3/GetMetricDescriptorRequest.php @@ -16,7 +16,8 @@ class GetMetricDescriptorRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. @@ -26,7 +27,8 @@ class GetMetricDescriptorRequest extends \Google\Protobuf\Internal\Message private $name = ''; /** - * @param string $name Required. The metric descriptor on which to execute the request. The format is: + * @param string $name Required. The metric descriptor on which to execute the request. The format + * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * @@ -51,7 +53,8 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. @@ -63,7 +66,8 @@ public function __construct($data = NULL) { } /** - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. @@ -77,7 +81,8 @@ public function getName() } /** - * Required. The metric descriptor on which to execute the request. The format is: + * 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"`. diff --git a/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php b/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php index ac5f7784e21..aec4619ddfa 100644 --- a/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php +++ b/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php @@ -16,7 +16,8 @@ class GetServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * 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) = { @@ -33,7 +34,8 @@ class GetServiceLevelObjectiveRequest extends \Google\Protobuf\Internal\Message private $view = 0; /** - * @param string $name Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * @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] * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. @@ -55,7 +57,8 @@ public static function build(string $name): self * Optional. Data for populating the Message object. * * @type string $name - * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * 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 @@ -70,7 +73,8 @@ public function __construct($data = NULL) { } /** - * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * 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) = { @@ -82,7 +86,8 @@ public function getName() } /** - * Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * 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) = { diff --git a/Monitoring/src/V3/ListGroupsRequest.php b/Monitoring/src/V3/ListGroupsRequest.php index ec98c867f53..0e3a7bd47bd 100644 --- a/Monitoring/src/V3/ListGroupsRequest.php +++ b/Monitoring/src/V3/ListGroupsRequest.php @@ -16,8 +16,9 @@ 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: + * 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) = { @@ -40,8 +41,9 @@ class ListGroupsRequest extends \Google\Protobuf\Internal\Message protected $filter; /** - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose groups are to be listed. The format is: + * @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] * @@ -62,8 +64,9 @@ public static function build(string $name): self * 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: + * 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: @@ -97,8 +100,9 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose groups are to be listed. The format is: + * 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) = { @@ -110,8 +114,9 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose groups are to be listed. The format is: + * 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) = { diff --git a/Monitoring/src/V3/ListMetricDescriptorsRequest.php b/Monitoring/src/V3/ListMetricDescriptorsRequest.php index 12386c8e854..50cd5a45751 100644 --- a/Monitoring/src/V3/ListMetricDescriptorsRequest.php +++ b/Monitoring/src/V3/ListMetricDescriptorsRequest.php @@ -16,8 +16,9 @@ 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: + * 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) = { @@ -36,7 +37,9 @@ class ListMetricDescriptorsRequest extends \Google\Protobuf\Internal\Message */ private $filter = ''; /** - * A positive number that is the maximum number of results to return. + * A positive number that is the maximum number of results to return. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. * * Generated from protobuf field int32 page_size = 3; */ @@ -51,8 +54,9 @@ class ListMetricDescriptorsRequest extends \Google\Protobuf\Internal\Message private $page_token = ''; /** - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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] * @@ -73,8 +77,9 @@ public static function build(string $name): self * 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: + * 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 @@ -85,7 +90,9 @@ public static function build(string $name): self * [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. + * A positive number that is the maximum number of results to return. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. * @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 @@ -98,8 +105,9 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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) = { @@ -111,8 +119,9 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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) = { @@ -166,7 +175,9 @@ public function setFilter($var) } /** - * A positive number that is the maximum number of results to return. + * A positive number that is the maximum number of results to return. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. * * Generated from protobuf field int32 page_size = 3; * @return int @@ -177,7 +188,9 @@ public function getPageSize() } /** - * A positive number that is the maximum number of results to return. + * A positive number that is the maximum number of results to return. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. * * Generated from protobuf field int32 page_size = 3; * @param int $var diff --git a/Monitoring/src/V3/ListMonitoredResourceDescriptorsRequest.php b/Monitoring/src/V3/ListMonitoredResourceDescriptorsRequest.php index 598c01dc32c..7df803eb2d8 100644 --- a/Monitoring/src/V3/ListMonitoredResourceDescriptorsRequest.php +++ b/Monitoring/src/V3/ListMonitoredResourceDescriptorsRequest.php @@ -16,8 +16,9 @@ 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: + * 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) = { @@ -49,8 +50,9 @@ class ListMonitoredResourceDescriptorsRequest extends \Google\Protobuf\Internal\ private $page_token = ''; /** - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * @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] * @@ -71,8 +73,9 @@ public static function build(string $name): self * 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: + * 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) @@ -94,8 +97,9 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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) = { @@ -107,8 +111,9 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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) = { diff --git a/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php b/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php index 9dbc95acf9f..5dd4cf9d214 100644 --- a/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php +++ b/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php @@ -17,7 +17,7 @@ class ListServiceLevelObjectivesRequest extends \Google\Protobuf\Internal\Messag { /** * Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: + * project or a Monitoring Metrics Scope. The formats are: * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- * @@ -57,7 +57,7 @@ class ListServiceLevelObjectivesRequest extends \Google\Protobuf\Internal\Messag /** * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: + * project or a Monitoring Metrics Scope. The formats are: * * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- @@ -81,7 +81,7 @@ public static function build(string $parent): self * * @type string $parent * Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: + * project or a Monitoring Metrics Scope. The formats are: * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- * @type string $filter @@ -107,7 +107,7 @@ public function __construct($data = NULL) { /** * Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: + * project or a Monitoring Metrics Scope. The formats are: * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- * @@ -121,7 +121,7 @@ public function getParent() /** * Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: + * project or a Monitoring Metrics Scope. The formats are: * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- * diff --git a/Monitoring/src/V3/ListServicesRequest.php b/Monitoring/src/V3/ListServicesRequest.php index a533582545c..89af6078374 100644 --- a/Monitoring/src/V3/ListServicesRequest.php +++ b/Monitoring/src/V3/ListServicesRequest.php @@ -16,9 +16,9 @@ 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: + * 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 Metrics Scope. The formats are: * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @@ -26,23 +26,22 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message */ private $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). + * A filter specifying what `Service`s to return. The filter supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service * * Generated from protobuf field string filter = 2; */ @@ -64,9 +63,9 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message private $page_token = ''; /** - * @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: + * @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 Metrics Scope. The formats are: * * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] @@ -88,29 +87,28 @@ public static function build(string $parent): self * 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: + * 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 Metrics Scope. 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). + * A filter specifying what `Service`s to return. The filter supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service * @type int $page_size * A non-negative number that is the maximum number of results to return. * When 0, use default page size. @@ -126,9 +124,9 @@ public function __construct($data = NULL) { } /** - * 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: + * 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 Metrics Scope. The formats are: * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @@ -141,9 +139,9 @@ public function getParent() } /** - * 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: + * 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 Metrics Scope. The formats are: * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @@ -160,23 +158,22 @@ public function setParent($var) } /** - * 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). + * A filter specifying what `Service`s to return. The filter supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service * * Generated from protobuf field string filter = 2; * @return string @@ -187,23 +184,22 @@ public function getFilter() } /** - * 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). + * A filter specifying what `Service`s to return. The filter supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service * * Generated from protobuf field string filter = 2; * @param string $var diff --git a/Monitoring/src/V3/ListTimeSeriesRequest.php b/Monitoring/src/V3/ListTimeSeriesRequest.php index 6bbd831a415..ca008690aa8 100644 --- a/Monitoring/src/V3/ListTimeSeriesRequest.php +++ b/Monitoring/src/V3/ListTimeSeriesRequest.php @@ -16,7 +16,8 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_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] @@ -26,10 +27,11 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message */ private $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: + * 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" * @@ -37,9 +39,9 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message */ private $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. + * 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]; */ @@ -93,23 +95,25 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message private $page_token = ''; /** - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), + * @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] * Please see {@see MetricServiceClient::workspaceName()} for help formatting this field. - * @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: + * @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 \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. + * @param \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. * @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} * @@ -133,22 +137,24 @@ public static function build(string $name, string $filter, \Google\Cloud\Monitor * Optional. Data for populating the Message object. * * @type string $name - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_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: + * 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. + * 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. @@ -180,7 +186,8 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_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] @@ -195,7 +202,8 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_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] @@ -214,10 +222,11 @@ public function setName($var) } /** - * 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: + * 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" * @@ -230,10 +239,11 @@ public function getFilter() } /** - * 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: + * 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" * @@ -250,9 +260,9 @@ public function setFilter($var) } /** - * 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. + * 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 @@ -273,9 +283,9 @@ public function clearInterval() } /** - * 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. + * 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 diff --git a/Monitoring/src/V3/ListTimeSeriesRequest/TimeSeriesView.php b/Monitoring/src/V3/ListTimeSeriesRequest/TimeSeriesView.php index 4055777eb6d..cd4d2c1bcc5 100644 --- a/Monitoring/src/V3/ListTimeSeriesRequest/TimeSeriesView.php +++ b/Monitoring/src/V3/ListTimeSeriesRequest/TimeSeriesView.php @@ -7,7 +7,7 @@ use UnexpectedValueException; /** - * Controls which fields are returned by `ListTimeSeries`. + * Controls which fields are returned by `ListTimeSeries*`. * * Protobuf type google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView */ diff --git a/Monitoring/src/V3/QueryTimeSeriesRequest.php b/Monitoring/src/V3/QueryTimeSeriesRequest.php index 9e1e3bcf747..1c2545b7a03 100644 --- a/Monitoring/src/V3/QueryTimeSeriesRequest.php +++ b/Monitoring/src/V3/QueryTimeSeriesRequest.php @@ -16,8 +16,9 @@ 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: + * 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]; @@ -53,8 +54,9 @@ class QueryTimeSeriesRequest extends \Google\Protobuf\Internal\Message * 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: + * 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 @@ -74,8 +76,9 @@ public function __construct($data = NULL) { } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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]; @@ -87,8 +90,9 @@ public function getName() } /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: + * 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]; diff --git a/Monitoring/src/V3/ServiceTier.php b/Monitoring/src/V3/ServiceTier.php index 928b55ace91..90668230848 100644 --- a/Monitoring/src/V3/ServiceTier.php +++ b/Monitoring/src/V3/ServiceTier.php @@ -8,7 +8,7 @@ /** * @deprecated - * The tier of service for a Workspace. Please see the + * The tier of service for a Metrics Scope. Please see the * [service tiers * documentation](https://cloud.google.com/monitoring/workspaces/tiers) for more * details. @@ -25,7 +25,7 @@ class ServiceTier */ const SERVICE_TIER_UNSPECIFIED = 0; /** - * The Stackdriver Basic tier, a free tier of service that provides basic + * The Cloud Monitoring 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 @@ -35,10 +35,10 @@ class ServiceTier */ 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 + * The Cloud Monitoring Premium tier, a higher, more expensive tier of service + * that provides access to all Cloud Monitoring features, lets you use Cloud + * Monitoring 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; diff --git a/Monitoring/src/V3/TimeInterval.php b/Monitoring/src/V3/TimeInterval.php index 532a64739b0..f22cbd83de1 100644 --- a/Monitoring/src/V3/TimeInterval.php +++ b/Monitoring/src/V3/TimeInterval.php @@ -9,30 +9,43 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. The end time must not be earlier than the start time. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be more than five minutes in the future. - * * For `GAUGE` metrics, the `startTime` value is technically optional; if - * no value is specified, the start time defaults to the value of the - * end time, and the interval represents a single point in time. If both - * start and end times are specified, they must be identical. Such an - * interval is valid only for `GAUGE` metrics, which are point-in-time - * measurements. The end time of a new interval must be at least a - * millisecond after the end time of the previous interval. - * * For `DELTA` metrics, the start time and end time must specify a - * non-zero interval, with subsequent points specifying contiguous and - * non-overlapping intervals. For `DELTA` metrics, the start time of - * the next interval must be at least a millisecond after the end time - * of the previous interval. - * * For `CUMULATIVE` metrics, the start time and end time must 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. The new start time must be at least a millisecond after the - * end time of the previous interval. - * * The start time of a new interval must be at least a millisecond after the - * end time of the previous interval because intervals are closed. If the - * start time of a new interval is the same as the end time of the previous - * interval, then data written at the new start time could overwrite data - * written at the previous end time. + * Describes a time interval: + * * Reads: A half-open time interval. It includes the end time but + * excludes the start time: `(startTime, endTime]`. The start time + * must be specified, must be earlier than the end time, and should be + * no older than the data retention period for the metric. + * * Writes: A closed time interval. It extends from the start time to the end + * time, + * and includes both: `[startTime, endTime]`. Valid time intervals + * depend on the + * [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) + * of the metric value. The end time must not be earlier than the start + * time, and the end time must not be more than 25 hours in the past or more + * than five minutes in the future. + * * For `GAUGE` metrics, the `startTime` value is technically optional; if + * no value is specified, the start time defaults to the value of the + * end time, and the interval represents a single point in time. If both + * start and end times are specified, they must be identical. Such an + * interval is valid only for `GAUGE` metrics, which are point-in-time + * measurements. The end time of a new interval must be at least a + * millisecond after the end time of the previous interval. + * * For `DELTA` metrics, the start time and end time must specify a + * non-zero interval, with subsequent points specifying contiguous and + * non-overlapping intervals. For `DELTA` metrics, the start time of + * the next interval must be at least a millisecond after the end time + * of the previous interval. + * * For `CUMULATIVE` metrics, the start time and end time must 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. The new start time must be at least a millisecond after the + * end time of the previous interval. + * * The start time of a new interval must be at least a millisecond after + * the + * end time of the previous interval because intervals are closed. If the + * start time of a new interval is the same as the end time of the + * previous interval, then data written at the new start time could + * overwrite data written at the previous end time. * * Generated from protobuf message google.monitoring.v3.TimeInterval */ diff --git a/Monitoring/src/V3/UpdateGroupRequest.php b/Monitoring/src/V3/UpdateGroupRequest.php index 0efe302c2d4..9a41bfe7239 100644 --- a/Monitoring/src/V3/UpdateGroupRequest.php +++ b/Monitoring/src/V3/UpdateGroupRequest.php @@ -16,8 +16,9 @@ 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. + * 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]; */ @@ -30,8 +31,9 @@ class UpdateGroupRequest extends \Google\Protobuf\Internal\Message private $validate_only = false; /** - * @param \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. + * @param \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. * * @return \Google\Cloud\Monitoring\V3\UpdateGroupRequest * @@ -50,8 +52,9 @@ public static function build(\Google\Cloud\Monitoring\V3\Group $group): self * 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. + * 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. * } @@ -62,8 +65,9 @@ public function __construct($data = NULL) { } /** - * Required. The new definition of the group. All fields of the existing group, - * excepting `name`, are replaced with the corresponding fields of 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]; * @return \Google\Cloud\Monitoring\V3\Group|null @@ -84,8 +88,9 @@ public function clearGroup() } /** - * Required. The new definition of the group. All fields of the existing group, - * excepting `name`, are replaced with the corresponding fields of 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 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 deleted file mode 100644 index 611022bae32b07a433dbc0ce39a6519f97b2cf48..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5915 zcmcgwO>-Mb8II)m>y^LKw(+c}q$W-vPIe=)^1|-Qge_T;9kI4#WZ7Z2R5djkwd8@( z%rGBb6qoPZse&6nfGYk0R}OI6+g>?v%AMlM+ubvxkt0P`iXxZD)BQgE@jlPfZ}(5X zurF+QBp*_fI;uz8a;qZxtjQ=5l8u6Z2A zHP3hV05n5&UAe&G;R`>2l%soDD25=qyYL3{af~_|XbZWHs>4kc! zTTVVdSk(YzTxgvJ`MPz~P-2=ztA`oB{g}hi$39D*W!9-?Iqln{L@6ox$WjD&kI+|+ zYTMLtZy#E>wdN^K*dG(aiSzttdO(vxyB)FO0JX9c<&kCe3Ho>scqrpiou%;Yi(~ToEDY@@!<6UXTmL;mHX4J_!19$)X6d?O?~pwSNw8O~*1_X^F#pI2ooG#*hjuU}jo6nyoa4Ygx&CIz>2YkB2t;HYFdzJT=vp zLEF+jzANbvDNJ2vAFb(JHGE1Q!@?!{B+k4q5#F1Gy)jW4L2_~*HciXZJG#a-rf3(c zX|fGl!IdtO7qF^1R5S_BNWifkhgd_T%?yj3h2Nl@l$s*^5LWnMqPQMAsJeY=lSkiz z44fFJK^Q5(f=e%{!}j8P2(glTHhTVXKAi>;`!oM6B+?aF9wyi-%p);8sM6sq!}D`Q9%7?6BY;j2t~2PI=m$c#+XI&HLOP@RJ;qcgA2=O z^KnzTy~#_7M$6z4?C4q}gm`&}oWa@vTWz^)L2UM^+~?B+7g)STIqc>Dwx@d91#K&a z)s;3l_9xR|A6eaFhJdhF@F)fw8K&|ZpE`XMyV>>CE|u2#AV<>-GB~w*xj+I)bK*l}Yj`EUDeDL%Uq68XT2cb!MNZrzNb$Cz0pPX+P+03&=sv3JDV7}?F=ObLV`j%HNO9(5qWs;Ye&!&+ ztO-c+8FTuctvb4EnbKXH|4MF*&7ms?{kSi0!D=K*1x?qd(kzB2(6AT6vy^*(D)&J+ zm; zPhexzcanmcU(E9(mp5%rEHo&9 znB>ib3~hy=>yKi}pTs&Aksy1p9uqFVU|?c+-7rZ+3DSc(&LX7YbbzA5}Z3GwTRxUk^$&CTGsl8xDR$7rfi$Bw$m9snFCveZfdJZpzeSB@hDv{aHBo9k}468S<&J)g=Z51{nB@Eqj zw_v?kJKnEU%QqxF4>N^o2~|4>$y$9aNghBNKPay%jhD)Cp;3Ivyr5n_t)112<+YjZ zpTk0UjUy6loR-ha^-ANb8?Z~TP{hxbV&Mp}7h$$suXFem%)ctss|bn`|9j$1;cp4} zL97}ZFL9EcQrYD5xMopy@ju@!KJt7jtr8R^u0ujo8Y!)P;FQHv!Lv>hUl&j@emm^R zoUCibUwqNv@X_}&7yD+n_6D0|xBi?=AMyv^Op!wkYKzSI?mxoDW|OxzEgy-|;yRA9gXwTYx61}{AB;H$N&$DBnW_eHXfO-wr0RIIC{HG)U 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 deleted file mode 100644 index 8dcca57c07d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php +++ /dev/null @@ -1,64 +0,0 @@ -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ÚAname‚Óä“%#/v3/{name=projects/*}/alertPolicies– -GetAlertPolicy+.google.monitoring.v3.GetAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"4ÚAname‚Óä“\'%/v3/{name=projects/*/alertPolicies/*}µ -CreateAlertPolicy..google.monitoring.v3.CreateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"MÚAname,alert_policy‚Óä“3"#/v3/{name=projects/*}/alertPolicies: alert_policy‘ -DeleteAlertPolicy..google.monitoring.v3.DeleteAlertPolicyRequest.google.protobuf.Empty"4ÚAname‚Óä“\'*%/v3/{name=projects/*/alertPolicies/*}Ë -UpdateAlertPolicy..google.monitoring.v3.UpdateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"cÚAupdate_mask,alert_policy‚Óä“B22/v3/{alert_policy.name=projects/*/alertPolicies/*}: 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.v3BAlertServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 2164fb3c8760677a8795493e23bb7537bf54f102..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2532 zcmbVO*>2lL6tyI;BQG@LB&yM6;s%Huq;z1_0YcX;XlX1HkSLX+g`f~XP~=D!)pUy6{qrsjG(!utQ9Cvqb!Ud7VdE4b-O_v?H)99rCxqe8 z4ab(LV?WRW_<3&nstLhN%`$(4%+K&dvwRAs4|OM@tp}!K$HA|6Q7apbJu}N z&v2GXKPnyyABlEAJzKLzE$Zu@=|W+BQ04h44Q7-@Nc}Jk8@V$lxSr(5^AD0d!+{sl zVswl>8ibyG8s{B3xSRbqT0oTGnxmHK2c9_&qnda=FDm!3$Z}R!D}-kMKU2ko9tPUA zyEtr2L2{JhN{AJ>d|RD zCu{>TaLcClHMIlPrJm^+F+vfg_xWW z1*9I^Mti#F_N%mSj&Ie8NiD;#t>8+1r>MP7 zi^$9}yM;Cqv@1#sDjbD(Of`4iC4$6k=CPZ-D@kFta{a+om)T|+w3&DtD6JM5GCO(H z*g{q0E5a~&iV1olbOwZ}0UwVN^9xyMDq>Gc^mlVXpU6!jDPo7HZ{ITPV!;XXXrbWb zHM6%+@cM*#%+}Ce5w&7FhYM$vkcJ!#R`{+rt*X;|kIDpPxNrOIViWeej!B7JU z1zB5xvAzdIlRXc06kzinL=r*^zR35?$~`T(MyoG1R2@+7#?+}|!kzvU)doZ!iqKd^ zB=WuVfaf{sxiAo$kRvcNhxcXD6``x;{c^2z{znPbVBc8yu$)(uMI!zJ_Deqqy5)pM zrV3U^Q>VDPz)K9<%gu2CbH}IoTjh>Fl=s{5;=(m!SNZzF4I6)E!qF&}j*8n2tT%s^ sKTC{xK9=)*ZqD<=#&|V;!y7MVpUYRt+ECasKDuGVn#m$?hwc#i8&pH#s{jB1 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 deleted file mode 100644 index f7e45d86002..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php +++ /dev/null @@ -1,33 +0,0 @@ -internalAddGeneratedFile( - ' -— -)google/monitoring/v3/dropped_labels.protogoogle.monitoring.v3"| - DroppedLabels= -label ( 2..google.monitoring.v3.DroppedLabels.LabelEntry, - -LabelEntry -key (  -value ( :8BÍ -com.google.monitoring.v3BDroppedLabelsProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 999b703bd1a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php +++ /dev/null @@ -1,37 +0,0 @@ -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 -GroupProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index a03455b22eaefbdb97cd6bc07b10a02c337b4ce1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3723 zcmb_fL2nyH6vj@IIuoE|)DqXF?Zi!q8-E@PSnn>o zV~0?M12+UhLcQ=4fd9Z9Rh;0K69-QG1Wvq}on5aTJGLcqakTT^oA15%y>DjTe%EVx z=nkn+hx!Jiby7PatVN0EyUaCRo76gu2K9;Qwmr+HzCy_EK6!utkUZFZe7Fp*f!py- zs*sLyN<8*DRCt^Z!Z7G5BJk&RYPMyPfEf&aR;-|E!OoUpTVFyN+oWOG0fhkP zZ5tiOWR~j??y&Eev~Z7vF}dxE=R(@sBm#86D*;u|A3Kctj$!M&G%$V3gDelgR8^al z#r5M~3isr;Je<`ag%G2vo&&i}nBSqv-3jq2>-f%=z|8}k#{cO<%B6Xht~rj&tKd3; zs`hf~g&5_yV_Vc=)A>BKs9i79meI9be>zv$T3UZXC26KYJH1yQm-HRC4dk30a=*7= z;N;FRYoKQj+8#R@?kdQ(@s1^_rPb>(lODpj72@7=Caj`wuc5-EbB3>mmI@>-CsOH_ za!blio-i6%T9!*aJX|3_Sm1;7 zzCc8z#SIxmNC`}3k@Dh(i}~NuXz@KOV4_#S6Z(0F1`OXvm$>3&FOyVZzO1kQrKSJX zmhtT#4kZi zjG3uo?4ql65FF~%4TmM7T$(D%BAWM%Cangbj@emooy8a-@rk*gQ71bm!e!80!?Ho= z@*g3bEM?$Tv($h-1wFkqx3k?i_fU7F<;%jADep{2O{d$e7n{+MwZ z+bX_IkAWQHAOl6S@XHYc1xx4gnqY3Xv*^&$;}DAHEeUaH=w}Zr_e%TVDX476DAX(cZ*Zof?Alu6AciSH+QRKTxa%%h^5;M~ut=i2oI zqW+Wo5AB;&i!m=yi^b#PV+kof=Zy|)!6nG;)HgiaU=7!Aua7hD?KOp|0!LK6{Cf&z z;d(K&Fy+OhYKYt8LF!{ofQuaX)uibrUs#X{%zAe-@y)Ak^&on+U(&gXcvvYrJkLnp z;CZGTm7Yh7x-M4rU;czDug=QK>d3cvf1Cuc_LQ7pZ)U!4W_IWPH^IvQZjeLjQEo-l zA)_-Ay`&`Ie&pM}OGfc{OgXXrX~0~{bwUn~$q&Z^^6=pCU>l*KA9I@;Wa9f1m$s+A z$0DCIZ_+;Pwx=}W%+{qh0MDAzFtBV&4*R_$8d;7NS>~YxnnyFBdD7hluw5$*30k28 z_!$U(f_UUIn}m@S;nz(T4jBexmdk#^%=gIHazl#Hw{6FIOVXtXh%0$oFQ9tcAK1zUAz~)-B zaU=gCB|YQ`Yt_Gv#bI$WFo-f~dQj^7$V9sXWl8ANa_a?BXjMB+eNjsKfK91vGqlv& zP{Oa6){7ECmO#z|>YNC>=HEpC;o&*ujD}hh*44x%F}2hI64q4%V2pCgD+zOb&MIY} zmR$P^%IH+iYJEfIb?cn~j3bS;`%qQc3|}$Nsjnfn)-iYHz;e8^=}MCP9_=*)K#DPp zkZ=96M1S&5u+(IL*4k&V9*8=G^%7Y_@jp&+bN!&JT5ZDR7>|W|8ADW>e-&XXlQc_B zy9-xcF?K^|b{K@H^PGF3vz*Nw?nk&PbD6`bw2Z}REefwoa+%x4Zw0vW#xt!7Yp>{; zEPmw;{X|FAI;-mUKTDS?DvDNV{!)ZmjuM{vsO6^8QdT&XaY?^RK_ykK2asrqUa)#L+7no5nFb`L&?aN_Xl!Mg#m$q=nD-pv;PIWAiO zBfL6>GQO-?`OziqL#U$XyLXbuqHJsU_!?}6coTY)N@!uu*Y3AUGrL|;cwl%aM7Ht>25t%*8*D$QSuP#xq9YOtSKD1~-h8?r2?ZY2BUKefzmuRdSon(yc~XsvYDU&H?@d|07jR diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php deleted file mode 100644 index 5cd56e066aeefad844fdcf1fcff8a8fcad56221e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7118 zcmb_hOLH7o6{clLk?s&hzK-Rw5|eh@j->H;CN+ZtZdt~yheg1O9ocazVT!3%&z(_| zneL_^Qe>4j>|jL|3t$BcR#YWB3X0+fP$`N9*`&0himbfKItz+(AN`!3k;cIrkNTc- z?m6Fi+^=un{+_ezpeynwv52etq$Teh$o?*o9oP14!|uvELAy;{*|2+#*(Gj8me(K1 zZ$Ee}Z>+!d_%f(^cHkOBl{>cG>5^*CwoKo4O{-Jgt5puK< z)%2Ps>}~2@^C<+fBDeLfN5DeAY&)DgBDK;@kajk0-%O6eWo=Li`RkEw^nYKHcD$nAG zI=mi8YnzBt8!5ukwNeGxShIUj(x-PhtvzbMQK>R{{U4LyY1XG}$)0FuaOm)EqvGrX9UQnjTEb;u&}}fiXht zk#B!Utl~HoQ+^?##gqN@92h$UZ=jb$tedT9K6*t-KC@V;H5P=w6>zvR%-0L(C5wFI zHxu44rxhPv+a$xV%R)y3i=ac#2c7b33BAfNU{#otsJp2|)mWm+xHKeD8B5Qb9T#01 z;F!qBcM;}Qo0E@MQ|ZWhG%yE0M)NcW8TktS<_+p{T5$f!r!Oy0lKZWJCu?0^y%$(0Q8K$7YWJ<1tAz6jV`bh*fr()!OU$ z>fl<7P2h9s8Ni~!x6l+j5cc#g>-j=W2@4}(bgy2ah8X<;Nv`@PD(Ib#OFE2qusKzz zUC!6mVnKWto%e`gTP@u^XeKQbAgEJWm_<{z+ahjr=b$)Ak-%GMe9t8N#TVeOnVOpK zL@uN(Fb?t)u)sr0jmIglnH`VQbXTRZfM#NVsXCrQ)Ngd6P}J>92$j# zslu58{w5j^;Kb&qjPe@^UEtjp?-cg7CQ6U@cAb^p4Rqb;+CeLv`#s%)Q^ghgL?;uF znx7EE$7(v%G3M2Yq4KtSiq2;}+n~Wg1!wT1MRc;!v7&@uN0a<~7Tuo%&??9&pXb2x zDCqT|fbm6i)(7g{Z8|nIQq!;l%ZDV=l6eK4^8&*lo|jsrhuH*PLzAiG)WhVY+b$ck z*tWuApTCPHI0#A<3EetB)#p$l=_7MPX`{J!0^%O@=liV4H#IoT+XABr;3nO8}WcC0Zn`?Jr!_|@3Aag9>$ zL&|PffI!pH;8jaU;mtw(q8I1Y!~c-bw}!JnyqxdlaIG-JQ}a`0JsAuz^1NV%#!@Yn zj__Y3e#U2Mj)!acVX$0fcvr{^<_AoV0XiZpZzcm-!i|NzNFXiQP4Vv~bS{Sl;y3a= z&k+q#AIi6sTS*6jQs?>C?;eBq?{MJe^GG}Zt9RGN1BGG&+tFl9%yo zv0&To0{3JSD;B}OmC$VVu*Ns?!^+BqC=5!>onvj5g-iDnM3F^#O*t`2RVv|6BK{%{ zjmHrP|1THs4|1`tRAT6o(>}&dHP{QE@C_WEKbAh#E+*nAat?uvd z3ydSSsR#Zp+%^F%z2S6qziqp{@=4=C{>6xn!&Wz?4XP#Yw=GYRhac6}kbelPPcLWvJZ^d;3aay}k0N&b=N I2pu8xKQr*R@&Et; 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 deleted file mode 100644 index cc7e45493f8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile( - ' -ò -*google/monitoring/v3/mutation_record.protogoogle.monitoring.v3"U -MutationRecord/ - mutate_time ( 2.google.protobuf.Timestamp - -mutated_by ( BÎ -com.google.monitoring.v3BMutationRecordProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 2c8d7ae84e61c4a16489fdfe927e4f0b27f488c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2855 zcmbVO-EQMV6vk<{-JNvX#a#&#RG4-vHQS|*NQ40Q2c>OVD$z7*(yTz1qKPv}2ON(z zwu7=&-h_+2;f4p`ArMc}N8kc+Ja!VNP1&%yif7Ju=J-3`H$Hpcy4NmxflsMJ1@UPM zH~ZMXrq~tS=N7kdGibM|z!vYi%%(!e`1k^sFKW1Sd{$crsK*0gQ3H24@7OfgJTB_sk!FwY#H3WwO{G4(9LTzJU}gc?SN`Xlv91XSHow}SnUy@mhn7APCkqUuUM08`w6c+=v z!bOKT?2YsS#3UczFXM5W+by6kcN6`2zbwl3#vhAlbqWc0^f0NFyXuI9a7P{UQXQp{ zI>J7u^Ir~Im1s$?piikF(vDYhe9>3SC>?lIG-9Pambt!}J=Yb0r559SKcLkf6{8Pb z=wUzbv?o$dd$Z@QCz8PB3^~+SXpuUkY15XLhIHwCW|(ehRs9gYIdx(ORNY4_mY`A= zvAwk=3ECWjCV85?Pt^nT?9T1rX-_3LGvPBkD4k>_jplx){rC!aiXQdC8a3&CBlWeC z`2wxnCGs7Rjn_z>!qE%#S-o_5c5-%9testy8`WB|c2#X$m8+G~5iFOEpM9V%BXm`c z!r)l}MLr%qrHp@++v48}+DY*9ZfmOtvl$v}g4dlq@gO|KvYqFELt`XT0=m1`*nD7`h!am2EblEvF0{+#{|30-&2`W zIrZsBGS&I`+gLCBIovc&xoajzLzoS3Q)>~}Fyy{rjNyh+FEkgVK?+-=ulDEBw3Qgn TLZ32g%3vlVqcLiL1_=ENc~HR9 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 deleted file mode 100644 index 8b1e14a465e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php +++ /dev/null @@ -1,97 +0,0 @@ -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/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ÚAname‚Óä“64/v3/{name=projects/*}/notificationChannelDescriptorsÝ - GetNotificationChannelDescriptor=.google.monitoring.v3.GetNotificationChannelDescriptorRequest3.google.monitoring.v3.NotificationChannelDescriptor"EÚAname‚Óä“86/v3/{name=projects/*/notificationChannelDescriptors/*}Ä -ListNotificationChannels5.google.monitoring.v3.ListNotificationChannelsRequest6.google.monitoring.v3.ListNotificationChannelsResponse"9ÚAname‚Óä“,*/v3/{name=projects/*}/notificationChannelsµ -GetNotificationChannel3.google.monitoring.v3.GetNotificationChannelRequest).google.monitoring.v3.NotificationChannel";ÚAname‚Óä“.,/v3/{name=projects/*/notificationChannels/*}ä -CreateNotificationChannel6.google.monitoring.v3.CreateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"dÚAname,notification_channel‚Óä“B"*/v3/{name=projects/*}/notificationChannels:notification_channelƒ -UpdateNotificationChannel6.google.monitoring.v3.UpdateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"‚ÚA update_mask,notification_channel‚Óä“Y2A/v3/{notification_channel.name=projects/*/notificationChannels/*}:notification_channel® -DeleteNotificationChannel6.google.monitoring.v3.DeleteNotificationChannelRequest.google.protobuf.Empty"AÚA -name,force‚Óä“.*,/v3/{name=projects/*/notificationChannels/*}Ü -\'SendNotificationChannelVerificationCodeD.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.google.protobuf.Empty"SÚAname‚Óä“F"A/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode:*‡ -&GetNotificationChannelVerificationCodeC.google.monitoring.v3.GetNotificationChannelVerificationCodeRequestD.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse"RÚAname‚Óä“E"@/v3/{name=projects/*/notificationChannels/*}:getVerificationCode:*Ê -VerifyNotificationChannel6.google.monitoring.v3.VerifyNotificationChannelRequest).google.monitoring.v3.NotificationChannel"JÚA name,code‚Óä“8"3/v3/{name=projects/*/notificationChannels/*}:verify:*©Ê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.v3BNotificationServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index fb4ffd3bc28..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile( - ' -¼ -(google/monitoring/v3/query_service.protogoogle.monitoring.v3google/api/client.proto)google/monitoring/v3/metric_service.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.v3BQueryServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 1627dee4f7a7b671b07fe8db70c22464a26abb42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4653 zcmbVQOLNm!6h?XbI1eKdFs98Y28NJ=T;dMXQ3y=zgy3mH+$4k!;~61K*UoKaN!7zN zFj@6Kbl>TsGhKDnpU|1I>rDSZxBQBpdnMVjG{sSw6R{^R?P0N7lAG$l5`11wc17 z&y)5-4e$;m{O1I9lj@S^Yd-#Wi+U=>5ccWvOI@*vH zLmL(4gpsR~?*=4!x+J;84_s@7+szalcmApkh}4=xYr7;0ywY{3iywsQ__Q8isxcJG zxuN?<4ylzjlURo4R*6e(V=$P<@&02PMQzP6Izf7h^jYk<#hknY|IS1H=d5cAU0LJus#ZN12Z&0_f5EQf&(Y4MgvX=MW*K= z)y?1>Ou1203~M%w;{%xK%afRf;qS;%6vZhRZEI#gvb@BVp)UpHSK-6jF9Iwi`b}8p znnOJqM`2+voJ!(tY(C!--S-ObqQ8#gnTL;}U>}PG+ihwVeao|lFOok80&X^J(;zO2 zhJOqc5|&Dn0MsCsPaBlD`JcvMF0yQkw28S>XSUHc`ABnPRhJUC;9ATMlc9068d#h- z@i=|b%b%TD4gADP3}GiWZO!C~62u}*yS8cKRuDDd>?p6#>#@qXiOcbD!g_v)U9Y!o z^R_#^d?QA&)-LzXCB#*GOL>x)@=A-)&#CyAp=cLh8iNtW{QMt7FcF(2PQw^ZzC+u<{bCr)IXN#T_!As4ZR{zy`Qg}S zB45Fz*48MFJZe(^huy_w={UNsdL+q2$d8hZ1(lktBepOuHxwZKP7~R#ZCSjAHMJ+xF z1pY(&fk#2e|17{vU*^!o49)>V^=%(_7QRGt=&7mOr!9gFnG$c8wSFF@4DOY_OX~q! z!Bsu*BlAyT&w4_-9Qe;JFYCMuY{W3}#^8VKRQuG;Ft};YZ9vsiU4Yp^9*d74 zjqNgy#M#8|s|o6`1z*&qdiI9nc7Ig&MD*Y`$7B{Lt6|el zOz#5DZM+6)FDITk^_6ZJIQ8F#a+~}DMCM-va`z1Rp!hz1S*!84wd5@cUXy$n`ZNS9 p3V*LCUAUqg6zgMru`1r_e0bjrZyyqu6{lWQaLMpa;TVnq{sWYrinternalAddGeneratedFile( - ' -ó -*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";ÚAparent,service‚Óä“$"/v3/{parent=*/*}/services:service~ - -GetService\'.google.monitoring.v3.GetServiceRequest.google.monitoring.v3.Service"(ÚAname‚Óä“/v3/{name=*/*/services/*}‘ - ListServices).google.monitoring.v3.ListServicesRequest*.google.monitoring.v3.ListServicesResponse"*ÚAparent‚Óä“/v3/{parent=*/*}/services˜ - UpdateService*.google.monitoring.v3.UpdateServiceRequest.google.monitoring.v3.Service"<ÚAservice‚Óä“,2!/v3/{service.name=*/*/services/*}:service} - DeleteService*.google.monitoring.v3.DeleteServiceRequest.google.protobuf.Empty"(ÚAname‚Óä“*/v3/{name=*/*/services/*}ú -CreateServiceLevelObjective8.google.monitoring.v3.CreateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"tÚAparent,service_level_objective‚Óä“M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:service_level_objectiveÁ -GetServiceLevelObjective5.google.monitoring.v3.GetServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"AÚAname‚Óä“42/v3/{name=*/*/services/*/serviceLevelObjectives/*}Ô -ListServiceLevelObjectives7.google.monitoring.v3.ListServiceLevelObjectivesRequest8.google.monitoring.v3.ListServiceLevelObjectivesResponse"CÚAparent‚Óä“42/v3/{parent=*/*/services/*}/serviceLevelObjectivesŒ -UpdateServiceLevelObjective8.google.monitoring.v3.UpdateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"…ÚAservice_level_objective‚Óä“e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:service_level_objective² -DeleteServiceLevelObjective8.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.google.protobuf.Empty"AÚAname‚Óä“4*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}©Ê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.v3BServiceMonitoringServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php deleted file mode 100644 index eeb8487aad2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php +++ /dev/null @@ -1,39 +0,0 @@ -internalAddGeneratedFile( - ' - -!google/monitoring/v3/snooze.protogoogle.monitoring.v3google/api/resource.proto!google/monitoring/v3/common.proto"Å -Snooze -name ( BàA< -criteria ( 2%.google.monitoring.v3.Snooze.CriteriaBàA9 -interval ( 2".google.monitoring.v3.TimeIntervalBàA - display_name ( BàAH -Criteria< -policies ( B*úA\' -%monitoring.googleapis.com/AlertPolicy:JêAG - monitoring.googleapis.com/Snooze#projects/{project}/snoozes/{snooze}BÆ -com.google.monitoring.v3B SnoozeProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/SnoozeService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php deleted file mode 100644 index c0b830a5319..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php +++ /dev/null @@ -1,56 +0,0 @@ -internalAddGeneratedFile( - ' -• -)google/monitoring/v3/snooze_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/snooze.proto google/protobuf/field_mask.proto"‚ -CreateSnoozeRequest8 -parent ( B(àAúA" monitoring.googleapis.com/Snooze1 -snooze ( 2.google.monitoring.v3.SnoozeBàA"” -ListSnoozesRequest8 -parent ( B(àAúA" monitoring.googleapis.com/Snooze -filter ( BàA - page_size (BàA - -page_token ( BàA"] -ListSnoozesResponse- -snoozes ( 2.google.monitoring.v3.Snooze -next_page_token ( "J -GetSnoozeRequest6 -name ( B(àAúA" - monitoring.googleapis.com/Snooze"~ -UpdateSnoozeRequest1 -snooze ( 2.google.monitoring.v3.SnoozeBàA4 - update_mask ( 2.google.protobuf.FieldMaskBàA2˜ - SnoozeService˜ - CreateSnooze).google.monitoring.v3.CreateSnoozeRequest.google.monitoring.v3.Snooze"?ÚA parent,snooze‚Óä“)"/v3/{parent=projects/*}/snoozes:snooze” - ListSnoozes(.google.monitoring.v3.ListSnoozesRequest).google.monitoring.v3.ListSnoozesResponse"0ÚAparent‚Óä“!/v3/{parent=projects/*}/snoozes - GetSnooze&.google.monitoring.v3.GetSnoozeRequest.google.monitoring.v3.Snooze".ÚAname‚Óä“!/v3/{name=projects/*/snoozes/*}¤ - UpdateSnooze).google.monitoring.v3.UpdateSnoozeRequest.google.monitoring.v3.Snooze"KÚAsnooze,update_mask‚Óä“02&/v3/{snooze.name=projects/*/snoozes/*}:snooze©Ê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.v3BSnoozeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index ed30a8928d9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php +++ /dev/null @@ -1,29 +0,0 @@ -internalAddGeneratedFile( - ' -· -\'google/monitoring/v3/span_context.protogoogle.monitoring.v3" - SpanContext - span_name ( BË -com.google.monitoring.v3BSpanContextProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 36ba869253e4af40d3ac4226633f0eec61f3f9e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5190 zcmb_gOLN=S6*ehRqz?6as~qdS0rKz zK=DvV_Gr^z&`tkDr^{};?PT&By6$wcXcz6aGd=eL;M=j3sWu|cz31HX_|D_rUw&o} zZ1|9`6O%ZqM|A$|iuVSDw;ju~G;7G8`RC`v;Wg{RHipD0@O(|;o080nwTAovSzXI_ zG*agKmen7U{R_)9Jj*f6{{CfY-?u&Ef)toE08_mnuB~c>ueU14#8Y+EQ+svB*gGCE z_D)I%0NPM>UB1f%z#HK4&-TxThQ_;|>fyhKhN~EOn4u1h*Qoh3{#+fp1X<_zp8KZe z8J5XY2FcXO-eW$HN%uaqEwuC*AF0x!#-riAhUpQdORP3tG{jow4r-mMwnag1H0zldmxg4!+icR0csZVp<$w1+Yy}z0%&c1GxzWFo zsRzJ?F`4i@vpQY8AL)+qDa^t3@D3-zMiddH?^wRgoRcno95GIXyD+C=Ap&uoGNZsc zz`*ltMWeyWCeVZF;?tW7J48-q{$Y$0Vb#Nc1#)O$(#4dE0vuLJ^ zyOE3tafK+CxF?XLCD!u2Y>J)t9eZ1l(Jag_(^D=~50!M>>?*&6O8z`L;9Z`>5L5o+ zfSqf=8nYD<>0Q|*yT!m)y0Nq%Ib>wz1jx8#h?r)8=wqF5vw+HN6nl@}DX&c^19uP7 ztSJOlJG+V6q$&tht_E9CVF`jmP2XUq|8TMJnM`3)jv(#3XzEZsBSSa4!}vd0%s&sh zF0vjmPSNz7tDFk!Q#j;kwo^dTqz=l&b66h%o%xs6iMKn1!8wviotk?9(85+6CgwJz zZTxZ-&GJo;osr1>a}`!c5awRe)cTE2T!aYm28ck4s*U1jH??vk3X_bn~uAvDi2LWqnto6{s zd!f3olmSt7iUFGIDJ&?-h_J$f`uz5%9R?CvY`G5RMVM(UZmZ0R&u%X@%r}-H@58p{ zyPkD{@e8t;$zDgIwp?x5#Oz%Ff6JJZB$w83fVPOAzduqRP-3OxldtxQ7AE8Xf{rC zRixNBG-3nQ16bw$76)#DYVW~XXg2!H51MiU`@mpCXVWJWvQcc^ROdV?YIyOfxA^A`7 zIr7ht{QIRj^2bR2&pcUZewq14va$~83B2SAur>wzG%UR$S7Gs5heY6Amf_|2FJk#J zEqRkw;XUAvMfp&w%@~}7rMf8N$dQ8Omei3m@jSw5G8xb%@|P`fhK~*~?IT5OR;3ya zFfncm*1H|Ct+d+GNrRH&Sa(xVt7S!qmK|Dd6SIh=dVfE}ev^QWP}!(cV*LxVHgr#~ z2g$GthdBG(b^H0kh8?!P$b z&QQ_gtD}QMQyo}iq-k?|z5kCMg&7S32jn%lyKsTqgNL7Yq^8mmk+@0J#URtT_!aY^j@j7kc zg*QSB>%h6EusJil;8ozeGrf!1Ix*Z~c|$i>zd$!E$Xcudw7fN{N~5KO`#R|E46L2B zs$BSQ~*-Z7+Bc>j!oQnT@A)G zIs@cQEOTR%8aDR{tT=2YW-0jgk#T}6oT0Ia4y|BX3THD8z_1kr2P)wPH`6D7h)v!6 zLS76c;&MKbu$*^00!9>IMeMevmY88+?nqtCLE%_zH>v`H83QhK8Um&!y@6IU%iIP4 zaw-yvm6`}(ypYoGhV)X%tkC`R>!i`HH<}G0lYH`P*qWPyx%;r&7V)fhRa^u=l!@sl z3(cyCDq@NVFFT5OR8fv3p{7)XBf8Sg#4CS|K^8H#uxwS*fh$||?Wh&|m7onRUyrs@ zWcID-u>oiBeFQANk6jigX!hB`7}xgMALF??dm1ZLnW*E@16kpu^i8zb>#^0|internalAddGeneratedFile( - ' -˜ -)google/monitoring/v3/uptime_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/uptime.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"› -ListUptimeCheckConfigsRequestC -parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfig -filter (  - 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";ÚAparent‚Óä“,*/v3/{parent=projects/*}/uptimeCheckConfigs­ -GetUptimeCheckConfig1.google.monitoring.v3.GetUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"9ÚAname‚Óä“,*/v3/{name=projects/*/uptimeCheckConfigs/*}Þ -CreateUptimeCheckConfig4.google.monitoring.v3.CreateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"dÚAparent,uptime_check_config‚Óä“A"*/v3/{parent=projects/*}/uptimeCheckConfigs:uptime_check_configë -UpdateUptimeCheckConfig4.google.monitoring.v3.UpdateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"qÚAuptime_check_config‚Óä“U2>/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}:uptime_check_config¢ -DeleteUptimeCheckConfig4.google.monitoring.v3.DeleteUptimeCheckConfigRequest.google.protobuf.Empty"9ÚAname‚Óä“,**/v3/{name=projects/*/uptimeCheckConfigs/*}“ -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.v3BUptimeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 7d97df10e8e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php +++ /dev/null @@ -1,389 +0,0 @@ -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 array|\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 array|\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 deleted file mode 100644 index 9f2767800da..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php +++ /dev/null @@ -1,269 +0,0 @@ -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 deleted file mode 100644 index c5d065c3b4e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php +++ /dev/null @@ -1,191 +0,0 @@ -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/AlertPolicy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php deleted file mode 100644 index 64b014d4429..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php +++ /dev/null @@ -1,805 +0,0 @@ -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 Cloud 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * - * 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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * - * 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`. - * If `condition_monitoring_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. This field is - * only set when the alert policy is invalid. An invalid 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; - /** - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $severity = 0; - - /** - * 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 Cloud 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * @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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * @type array<\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`. - * If `condition_monitoring_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. This field is - * only set when the alert policy is invalid. An invalid alert policy will not - * generate incidents. - * @type array|\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. - * @type int $severity - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * } - */ - 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 Cloud 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 Cloud 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * - * 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * - * 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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * - * 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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * - * 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`. - * If `condition_monitoring_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`. - * If `condition_monitoring_query_language` is present, it must be the only - * `condition`. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; - * @param array<\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. This field is - * only set when the alert policy is invalid. An invalid 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. This field is - * only set when the alert policy is invalid. An invalid 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 array|\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; - } - - /** - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSeverity() - { - return $this->severity; - } - - /** - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSeverity($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Severity::class); - $this->severity = $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 deleted file mode 100644 index d5a4cff1ce3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php +++ /dev/null @@ -1,167 +0,0 @@ -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; - /** - * Control how notifications will be sent out, on a per-channel basis. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; - */ - private $notification_channel_strategy; - - /** - * 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 - * @type array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $notification_channel_strategy - * Control how notifications will be sent out, on a per-channel basis. - * } - */ - 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; - } - - /** - * Control how notifications will be sent out, on a per-channel basis. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNotificationChannelStrategy() - { - return $this->notification_channel_strategy; - } - - /** - * Control how notifications will be sent out, on a per-channel basis. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; - * @param array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNotificationChannelStrategy($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy::class); - $this->notification_channel_strategy = $arr; - - 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/NotificationChannelStrategy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php deleted file mode 100644 index 3fb4be79589..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php +++ /dev/null @@ -1,139 +0,0 @@ -google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy - */ -class NotificationChannelStrategy extends \Google\Protobuf\Internal\Message -{ - /** - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channel_names = 1; - */ - private $notification_channel_names; - /** - * The frequency at which to send reminder notifications for open - * incidents. - * - * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; - */ - protected $renotify_interval = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $notification_channel_names - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @type \Google\Protobuf\Duration $renotify_interval - * The frequency at which to send reminder notifications for open - * incidents. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channel_names = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNotificationChannelNames() - { - return $this->notification_channel_names; - } - - /** - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channel_names = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNotificationChannelNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->notification_channel_names = $arr; - - return $this; - } - - /** - * The frequency at which to send reminder notifications for open - * incidents. - * - * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getRenotifyInterval() - { - return $this->renotify_interval; - } - - public function hasRenotifyInterval() - { - return isset($this->renotify_interval); - } - - public function clearRenotifyInterval() - { - unset($this->renotify_interval); - } - - /** - * The frequency at which to send reminder notifications for open - * incidents. - * - * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRenotifyInterval($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->renotify_interval = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NotificationChannelStrategy::class, \Google\Cloud\Monitoring\V3\AlertPolicy_AlertStrategy_NotificationChannelStrategy::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 deleted file mode 100644 index a487e3fd361..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100644 index c476fb7bd10..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php +++ /dev/null @@ -1,373 +0,0 @@ -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 Cloud 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. Cloud 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 Cloud 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. Cloud 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. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $condition_prometheus_query_language - * A condition that uses the Prometheus 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 Cloud 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. Cloud 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 Cloud 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. Cloud 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; - } - - /** - * A condition that uses the Prometheus query language to define alerts. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition|null - */ - public function getConditionPrometheusQueryLanguage() - { - return $this->readOneof(21); - } - - public function hasConditionPrometheusQueryLanguage() - { - return $this->hasOneof(21); - } - - /** - * A condition that uses the Prometheus query language to define alerts. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $var - * @return $this - */ - public function setConditionPrometheusQueryLanguage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition::class); - $this->writeOneof(21, $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/EvaluationMissingData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php deleted file mode 100644 index 6fc5a47b481..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php +++ /dev/null @@ -1,76 +0,0 @@ -google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - */ -class EvaluationMissingData -{ - /** - * An unspecified evaluation missing data option. Equivalent to - * EVALUATION_MISSING_DATA_NO_OP. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_UNSPECIFIED = 0; - */ - const EVALUATION_MISSING_DATA_UNSPECIFIED = 0; - /** - * If there is no data to evaluate the condition, then evaluate the - * condition as false. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_INACTIVE = 1; - */ - const EVALUATION_MISSING_DATA_INACTIVE = 1; - /** - * If there is no data to evaluate the condition, then evaluate the - * condition as true. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_ACTIVE = 2; - */ - const EVALUATION_MISSING_DATA_ACTIVE = 2; - /** - * Do not evaluate the condition to any value if there is no data. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_NO_OP = 3; - */ - const EVALUATION_MISSING_DATA_NO_OP = 3; - - private static $valueToName = [ - self::EVALUATION_MISSING_DATA_UNSPECIFIED => 'EVALUATION_MISSING_DATA_UNSPECIFIED', - self::EVALUATION_MISSING_DATA_INACTIVE => 'EVALUATION_MISSING_DATA_INACTIVE', - self::EVALUATION_MISSING_DATA_ACTIVE => 'EVALUATION_MISSING_DATA_ACTIVE', - self::EVALUATION_MISSING_DATA_NO_OP => 'EVALUATION_MISSING_DATA_NO_OP', - ]; - - 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(EvaluationMissingData::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_EvaluationMissingData::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 deleted file mode 100644 index cd52e655a01..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php +++ /dev/null @@ -1,151 +0,0 @@ -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 deleted file mode 100644 index fc6aad1dfc4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php +++ /dev/null @@ -1,304 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 74e9099f57f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php +++ /dev/null @@ -1,635 +0,0 @@ -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; - /** - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; - */ - protected $forecast_options = null; - /** - * 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; - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - */ - protected $evaluation_missing_data = 0; - - /** - * 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 array<\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 array<\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 \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $forecast_options - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * @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. - * @type int $evaluation_missing_data - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * } - */ - 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 array<\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 array<\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; - } - - /** - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions|null - */ - public function getForecastOptions() - { - return $this->forecast_options; - } - - public function hasForecastOptions() - { - return isset($this->forecast_options); - } - - public function clearForecastOptions() - { - unset($this->forecast_options); - } - - /** - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $var - * @return $this - */ - public function setForecastOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions::class); - $this->forecast_options = $var; - - 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; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * @return int - */ - public function getEvaluationMissingData() - { - return $this->evaluation_missing_data; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * @param int $var - * @return $this - */ - public function setEvaluationMissingData($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); - $this->evaluation_missing_data = $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/MetricThreshold/ForecastOptions.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php deleted file mode 100644 index 5b730b5b812..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php +++ /dev/null @@ -1,101 +0,0 @@ -google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions - */ -class ForecastOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * - * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $forecast_horizon = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $forecast_horizon - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * - * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Duration|null - */ - public function getForecastHorizon() - { - return $this->forecast_horizon; - } - - public function hasForecastHorizon() - { - return isset($this->forecast_horizon); - } - - public function clearForecastHorizon() - { - unset($this->forecast_horizon); - } - - /** - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * - * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setForecastHorizon($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->forecast_horizon = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ForecastOptions::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold_ForecastOptions::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 deleted file mode 100644 index 4752ce7876d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php +++ /dev/null @@ -1,257 +0,0 @@ -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; - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - */ - protected $evaluation_missing_data = 0; - - /** - * 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. - * @type int $evaluation_missing_data - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * } - */ - 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; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * @return int - */ - public function getEvaluationMissingData() - { - return $this->evaluation_missing_data; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * @param int $var - * @return $this - */ - public function setEvaluationMissingData($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); - $this->evaluation_missing_data = $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/PrometheusQueryLanguageCondition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php deleted file mode 100644 index 6db9f2637a4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php +++ /dev/null @@ -1,433 +0,0 @@ -google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition - */ -class PrometheusQueryLanguageCondition extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query = ''; - /** - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $duration = null; - /** - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * - * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $evaluation_interval = null; - /** - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $rule_group = ''; - /** - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $alert_rule = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * @type \Google\Protobuf\Duration $duration - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * @type \Google\Protobuf\Duration $evaluation_interval - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * @type string $rule_group - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * @type string $alert_rule - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * - * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getEvaluationInterval() - { - return $this->evaluation_interval; - } - - public function hasEvaluationInterval() - { - return isset($this->evaluation_interval); - } - - public function clearEvaluationInterval() - { - unset($this->evaluation_interval); - } - - /** - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * - * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEvaluationInterval($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->evaluation_interval = $var; - - return $this; - } - - /** - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @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; - } - - /** - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRuleGroup() - { - return $this->rule_group; - } - - /** - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRuleGroup($var) - { - GPBUtil::checkString($var, True); - $this->rule_group = $var; - - return $this; - } - - /** - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAlertRule() - { - return $this->alert_rule; - } - - /** - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAlertRule($var) - { - GPBUtil::checkString($var, True); - $this->alert_rule = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PrometheusQueryLanguageCondition::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_PrometheusQueryLanguageCondition::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 deleted file mode 100644 index 8daaca29380..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php +++ /dev/null @@ -1,118 +0,0 @@ -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 deleted file mode 100644 index bb9e016f4bd..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php +++ /dev/null @@ -1,81 +0,0 @@ -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 => 'AND', - self::PBOR => 'OR', - 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)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - 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 deleted file mode 100644 index 7df7159cc1b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php +++ /dev/null @@ -1,207 +0,0 @@ -google.monitoring.v3.AlertPolicy.Documentation - */ -class Documentation extends \Google\Protobuf\Internal\Message -{ - /** - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * - * 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 = ''; - /** - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * - * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $subject = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * @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. - * @type string $subject - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * - * Generated from protobuf field string content = 1; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * - * 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; - } - - /** - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * - * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSubject() - { - return $this->subject; - } - - /** - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * - * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSubject($var) - { - GPBUtil::checkString($var, True); - $this->subject = $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/AlertPolicy/Severity.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php deleted file mode 100644 index 76e47474924..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php +++ /dev/null @@ -1,75 +0,0 @@ -google.monitoring.v3.AlertPolicy.Severity - */ -class Severity -{ - /** - * No severity is specified. This is the default value. - * - * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; - */ - const SEVERITY_UNSPECIFIED = 0; - /** - * This is the highest severity level. Use this if the problem could - * cause significant damage or downtime. - * - * Generated from protobuf enum CRITICAL = 1; - */ - const CRITICAL = 1; - /** - * This is the medium severity level. Use this if the problem could - * cause minor damage or downtime. - * - * Generated from protobuf enum ERROR = 2; - */ - const ERROR = 2; - /** - * This is the lowest severity level. Use this if the problem is not causing - * any damage or downtime, but could potentially lead to a problem in the - * future. - * - * Generated from protobuf enum WARNING = 3; - */ - const WARNING = 3; - - private static $valueToName = [ - self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', - self::CRITICAL => 'CRITICAL', - self::ERROR => 'ERROR', - self::WARNING => 'WARNING', - ]; - - 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(Severity::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Severity::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php deleted file mode 100644 index 5becfda99f4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php +++ /dev/null @@ -1,269 +0,0 @@ -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 array|\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 array|\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 array|\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 array|\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 array|\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 array|\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 deleted file mode 100644 index 39790b19ee0..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100644 index 331b6b6e46f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php +++ /dev/null @@ -1,84 +0,0 @@ -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/ComparisonType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php deleted file mode 100644 index d86a3fbc2cd..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100644 index 6c9c18ef40f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php +++ /dev/null @@ -1,188 +0,0 @@ -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 Metrics Scope, 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; - - /** - * @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 Metrics Scope, 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 \Google\Cloud\Monitoring\V3\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. - * - * @return \Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self - { - return (new self()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - } - - /** - * 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 Metrics Scope, 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 Metrics Scope, 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 Metrics Scope, 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 deleted file mode 100644 index bad7c64edac..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php +++ /dev/null @@ -1,181 +0,0 @@ -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; - - /** - * @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 \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. - * - * @return \Google\Cloud\Monitoring\V3\CreateGroupRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Monitoring\V3\Group $group): self - { - return (new self()) - ->setName($name) - ->setGroup($group); - } - - /** - * 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 deleted file mode 100644 index 45d737e63e8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -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; - - /** - * @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 \Google\Api\MetricDescriptor $metricDescriptor Required. The new [custom - * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. - * - * @return \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest - * - * @experimental - */ - public static function build(string $name, \Google\Api\MetricDescriptor $metricDescriptor): self - { - return (new self()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - } - - /** - * 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 deleted file mode 100644 index 2a528898beb..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php +++ /dev/null @@ -1,163 +0,0 @@ -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; - - /** - * @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 \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel Required. The definition of the `NotificationChannel` to create. - * - * @return \Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self - { - return (new self()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - } - - /** - * 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 deleted file mode 100644 index 151f66b7a84..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -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-zA-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; - - /** - * @param string $parent Required. Resource name of the parent `Service`. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * - * @return \Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self - { - return (new self()) - ->setParent($parent) - ->setServiceLevelObjective($serviceLevelObjective); - } - - /** - * 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-zA-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-zA-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-zA-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 deleted file mode 100644 index 7d9425e30c5..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php +++ /dev/null @@ -1,180 +0,0 @@ -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 Metrics Scope. 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; - - /** - * @param string $parent Required. Resource - * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the - * parent Metrics Scope. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to create. - * - * @return \Google\Cloud\Monitoring\V3\CreateServiceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\Service $service): self - { - return (new self()) - ->setParent($parent) - ->setService($service); - } - - /** - * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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/CreateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php deleted file mode 100644 index c03b63fbc9d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php +++ /dev/null @@ -1,149 +0,0 @@ -google.monitoring.v3.CreateSnoozeRequest - */ -class CreateSnoozeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $snooze = null; - - /** - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. - * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * @return \Google\Cloud\Monitoring\V3\CreateSnoozeRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\Snooze $snooze): self - { - return (new self()) - ->setParent($parent) - ->setSnooze($snooze); - } - - /** - * 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 - * a `Snooze` should be created. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type \Google\Cloud\Monitoring\V3\Snooze $snooze - * Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. 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 - * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Snooze|null - */ - public function getSnooze() - { - return $this->snooze; - } - - public function hasSnooze() - { - return isset($this->snooze); - } - - public function clearSnooze() - { - unset($this->snooze); - } - - /** - * Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Snooze $var - * @return $this - */ - public function setSnooze($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); - $this->snooze = $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 deleted file mode 100644 index 556d57d6608..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100644 index 66cb39cd93a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -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; - - /** - * @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] - * Please see {@see MetricServiceClient::projectName()} for help formatting this field. - * @param \Google\Cloud\Monitoring\V3\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. - * - * @return \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest - * - * @experimental - */ - public static function build(string $name, array $timeSeries): self - { - return (new self()) - ->setName($name) - ->setTimeSeries($timeSeries); - } - - /** - * 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 array<\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 array<\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 deleted file mode 100644 index 8fb4fe1f025..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php +++ /dev/null @@ -1,135 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 5bd917825b9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php +++ /dev/null @@ -1,114 +0,0 @@ -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/CreateUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php deleted file mode 100644 index 991e2028b3a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php +++ /dev/null @@ -1,142 +0,0 @@ -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; - - /** - * @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 \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. - * - * @return \Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self - { - return (new self()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - } - - /** - * 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 deleted file mode 100644 index 2333c3a4691..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php +++ /dev/null @@ -1,93 +0,0 @@ -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 = ''; - - /** - * @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]. Please see - * {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index b63a0bdb79f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php +++ /dev/null @@ -1,130 +0,0 @@ -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; - - /** - * @param string $name Required. The group to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * Please see {@see GroupServiceClient::groupName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteGroupRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 3d57dd66af3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -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 = ''; - - /** - * @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"`. Please see - * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 56e0316342e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php +++ /dev/null @@ -1,138 +0,0 @@ -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; - - /** - * @param string $name Required. The channel for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * @param 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. - * - * @return \Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name, bool $force): self - { - return (new self()) - ->setName($name) - ->setForce($force); - } - - /** - * 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 deleted file mode 100644 index 8771b8fb4ab..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 = ''; - - /** - * @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] - * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 378fecd0724..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. Resource name of the `Service` to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index dfda97aa016..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The Uptime check configuration to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index cffd93e1651..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php +++ /dev/null @@ -1,127 +0,0 @@ -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 deleted file mode 100644 index 4fb73d3bdd7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100644 index 573ae71a8ad..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The alerting policy to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * Please see {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetAlertPolicyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index da9c56f0a13..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The group to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * Please see {@see GroupServiceClient::groupName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetGroupRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 360bdfac4cc..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -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 = ''; - - /** - * @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"`. Please see - * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 82d4800c5e1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php +++ /dev/null @@ -1,98 +0,0 @@ -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 = ''; - - /** - * @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`. Please see - * {@see MetricServiceClient::monitoredResourceDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index f7ff869b729..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The channel type for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] - * Please see {@see NotificationChannelServiceClient::notificationChannelDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 708a1446cd9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The channel for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index acb10877c21..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -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; - - /** - * @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. Please see - * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index b62d064177a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -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 deleted file mode 100644 index c22d24403f6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,138 +0,0 @@ -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; - - /** - * @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] - * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 6113d513f42..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. Resource name of the `Service`. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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/GetSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php deleted file mode 100644 index 83b9da5e20f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.monitoring.v3.GetSnoozeRequest - */ -class GetSnoozeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * Please see {@see SnoozeServiceClient::snoozeName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetSnoozeRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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 ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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 deleted file mode 100644 index 83b9a3f2eaa..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The Uptime check configuration to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 4a768d02d74..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php +++ /dev/null @@ -1,257 +0,0 @@ -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 deleted file mode 100644 index ddf9d0eee1a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php +++ /dev/null @@ -1,66 +0,0 @@ -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/InternalChecker.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php deleted file mode 100644 index 19273fdc3f2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php +++ /dev/null @@ -1,271 +0,0 @@ -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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Metrics Scope 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 deleted file mode 100644 index d006a60c773..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php +++ /dev/null @@ -1,74 +0,0 @@ -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/LabelValue.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php deleted file mode 100644 index 3a66a26a435..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php +++ /dev/null @@ -1,141 +0,0 @@ -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 deleted file mode 100644 index cda153f70a1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php +++ /dev/null @@ -1,294 +0,0 @@ -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 = ''; - - /** - * @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. - * - * @return \Google\Cloud\Monitoring\V3\ListAlertPoliciesRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 45d31688ec1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php +++ /dev/null @@ -1,147 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 876c5364c1a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php +++ /dev/null @@ -1,277 +0,0 @@ -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; - - /** - * @param string $name Required. The group whose members are listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * Please see {@see GroupServiceClient::groupName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\ListGroupMembersRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 8cfc0e8fcd3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php +++ /dev/null @@ -1,143 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 7203ea37100..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php +++ /dev/null @@ -1,316 +0,0 @@ -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; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListGroupsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 98e3257f20a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 800b557691f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php +++ /dev/null @@ -1,238 +0,0 @@ -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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * - * 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 = ''; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * @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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * - * 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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * - * 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 deleted file mode 100644 index 4ea2039e212..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 14696bd981c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php +++ /dev/null @@ -1,222 +0,0 @@ -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 = ''; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 07992037c86..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index ef7d9522e6f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php +++ /dev/null @@ -1,206 +0,0 @@ -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 = ''; - - /** - * @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. - * - * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 93034ae1599..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php +++ /dev/null @@ -1,117 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 6bced117ff1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php +++ /dev/null @@ -1,307 +0,0 @@ -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 = ''; - - /** - * @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. - * - * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 28dc01fb0af..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php +++ /dev/null @@ -1,151 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 19128d58f56..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -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 Metrics Scope. 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; - - /** - * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Metrics Scope. The formats are: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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 deleted file mode 100644 index 8e9d2ead1ab..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 795a4e8e34e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php +++ /dev/null @@ -1,275 +0,0 @@ -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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * 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 = ''; - - /** - * @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 Metrics Scope. The formats are: - * - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * - * @return \Google\Cloud\Monitoring\V3\ListServicesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * @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 Metrics Scope. 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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * 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 deleted file mode 100644 index 4359a2689b2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -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 array<\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 array<\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/ListSnoozesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php deleted file mode 100644 index ff92a8e233f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.monitoring.v3.ListSnoozesRequest - */ -class ListSnoozesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be 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 = ''; - /** - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\ListSnoozesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 - * `Snooze`s should be listed. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type string $filter - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * @type int $page_size - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * @type string $page_token - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be 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 - * `Snooze`s should be 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; - } - - /** - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @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/ListSnoozesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php deleted file mode 100644 index e22e8db840e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.monitoring.v3.ListSnoozesResponse - */ -class ListSnoozesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * `Snooze`s matching this list call. - * - * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; - */ - private $snoozes; - /** - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * - * 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 array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $snoozes - * `Snooze`s matching this list call. - * @type string $next_page_token - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * `Snooze`s matching this list call. - * - * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSnoozes() - { - return $this->snoozes; - } - - /** - * `Snooze`s matching this list call. - * - * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; - * @param array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSnoozes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Snooze::class); - $this->snoozes = $arr; - - return $this; - } - - /** - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * - * 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 deleted file mode 100644 index 0b123db098c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php +++ /dev/null @@ -1,501 +0,0 @@ -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 = ''; - - /** - * @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] - * Please see {@see MetricServiceClient::workspaceName()} for help formatting this field. - * @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 \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. - * @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} - * - * @return \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest - * - * @experimental - */ - public static function build(string $name, string $filter, \Google\Cloud\Monitoring\V3\TimeInterval $interval, int $view): self - { - return (new self()) - ->setName($name) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - } - - /** - * 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 deleted file mode 100644 index cd4d2c1bcc5..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php +++ /dev/null @@ -1,59 +0,0 @@ -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/ListTimeSeriesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php deleted file mode 100644 index f2d874bd347..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php +++ /dev/null @@ -1,201 +0,0 @@ -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 array<\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 array<\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 array<\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 array<\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 deleted file mode 100644 index 0718e498334..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php +++ /dev/null @@ -1,230 +0,0 @@ -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 = ''; - /** - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * 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 = ''; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 string $filter - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * @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; - } - - /** - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * - * 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; - } - - /** - * 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 deleted file mode 100644 index f12354762fe..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php +++ /dev/null @@ -1,155 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index f2d106e8898..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -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 deleted file mode 100644 index 26da2fcdd61..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -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 array<\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 array<\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/MutationRecord.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php deleted file mode 100644 index 73a1f82bce8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100644 index 0ef18788e23..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php +++ /dev/null @@ -1,594 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 2b70fa84287..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100644 index f9e6c8c2714..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php +++ /dev/null @@ -1,326 +0,0 @@ -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 array<\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 array|\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 array<\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 array|\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/Point.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php deleted file mode 100644 index 5db4ed6c5b7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 8ff8ad79a2a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php +++ /dev/null @@ -1,115 +0,0 @@ -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 deleted file mode 100644 index 95542afd49b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php +++ /dev/null @@ -1,105 +0,0 @@ -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 array<\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 array<\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/QueryTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php deleted file mode 100644 index 05eb26d2f95..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -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 deleted file mode 100644 index 79b8487cb24..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php +++ /dev/null @@ -1,195 +0,0 @@ -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 array<\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 array<\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 array<\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 array<\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 deleted file mode 100644 index 3dd0db9c39f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100644 index e4820f273c2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php +++ /dev/null @@ -1,121 +0,0 @@ -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 deleted file mode 100644 index efa0e97e35b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The notification channel to which to send a verification code. Please see - * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index a07a1f621e8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php +++ /dev/null @@ -1,420 +0,0 @@ -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 deleted file mode 100644 index 8f04ef19e93..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100644 index 24cc957f7c8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100644 index bcbab5c1818..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php +++ /dev/null @@ -1,198 +0,0 @@ -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 deleted file mode 100644 index 08ba22af9c2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100644 index 0feb3f3aaa8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php +++ /dev/null @@ -1,171 +0,0 @@ -= - * 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 deleted file mode 100644 index e90ac6f8b63..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php +++ /dev/null @@ -1,151 +0,0 @@ -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 deleted file mode 100644 index 6bb4bd89086..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100644 index a1d08a4e348..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 82a234459a4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php +++ /dev/null @@ -1,338 +0,0 @@ -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 deleted file mode 100644 index a21fbcb2596..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php +++ /dev/null @@ -1,71 +0,0 @@ -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/ServiceTier.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php deleted file mode 100644 index 90668230848..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php +++ /dev/null @@ -1,74 +0,0 @@ -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 Cloud Monitoring 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 Cloud Monitoring Premium tier, a higher, more expensive tier of service - * that provides access to all Cloud Monitoring features, lets you use Cloud - * Monitoring 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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php deleted file mode 100644 index 972f136cc0c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php +++ /dev/null @@ -1,224 +0,0 @@ -google.monitoring.v3.Snooze - */ -class Snooze extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * - * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $criteria = null; - /** - * Required. The `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * - * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $interval = null; - /** - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * @type \Google\Cloud\Monitoring\V3\Snooze\Criteria $criteria - * Required. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * @type \Google\Cloud\Monitoring\V3\TimeInterval $interval - * Required. The `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * @type string $display_name - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * - * 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. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * - * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Snooze\Criteria|null - */ - public function getCriteria() - { - return $this->criteria; - } - - public function hasCriteria() - { - return isset($this->criteria); - } - - public function clearCriteria() - { - unset($this->criteria); - } - - /** - * Required. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * - * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Snooze\Criteria $var - * @return $this - */ - public function setCriteria($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze\Criteria::class); - $this->criteria = $var; - - return $this; - } - - /** - * Required. The `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * - * 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 `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * - * 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; - } - - /** - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php deleted file mode 100644 index 13e62c6c185..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php +++ /dev/null @@ -1,88 +0,0 @@ -google.monitoring.v3.Snooze.Criteria - */ -class Criteria extends \Google\Protobuf\Internal\Message -{ - /** - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * - * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { - */ - private $policies; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $policies - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); - parent::__construct($data); - } - - /** - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * - * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPolicies() - { - return $this->policies; - } - - /** - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * - * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->policies = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Criteria::class, \Google\Cloud\Monitoring\V3\Snooze_Criteria::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php deleted file mode 100644 index cfeb31ba834..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100644 index 6c6c82460c6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php +++ /dev/null @@ -1,303 +0,0 @@ -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 deleted file mode 100644 index bd81e7bff71..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php +++ /dev/null @@ -1,108 +0,0 @@ -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/TimeInterval.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php deleted file mode 100644 index 1869cd41c8a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php +++ /dev/null @@ -1,165 +0,0 @@ -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 deleted file mode 100644 index 884802d3cdc..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php +++ /dev/null @@ -1,404 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 4c91cd6c80a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php +++ /dev/null @@ -1,114 +0,0 @@ -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 array<\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 array<\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 array<\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 array<\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 deleted file mode 100644 index 9aa86421aa7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php +++ /dev/null @@ -1,116 +0,0 @@ -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 array<\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 array<\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/TimeSeriesDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php deleted file mode 100644 index ec714c4abc2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php +++ /dev/null @@ -1,101 +0,0 @@ -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 array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $label_descriptors - * Descriptors for the labels. - * @type array<\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 array<\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 array<\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 deleted file mode 100644 index ac5dbc3a79e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php +++ /dev/null @@ -1,184 +0,0 @@ -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/TimeSeriesRatio.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php deleted file mode 100644 index bbd4edb9bac..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php +++ /dev/null @@ -1,180 +0,0 @@ -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 deleted file mode 100644 index 866bd8da016..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php +++ /dev/null @@ -1,213 +0,0 @@ -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 deleted file mode 100644 index 2e02f8c2541..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php +++ /dev/null @@ -1,239 +0,0 @@ -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; - - /** - * @param \Google\Protobuf\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. - * @param \Google\Cloud\Monitoring\V3\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. - * - * @return \Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest - * - * @experimental - */ - public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self - { - return (new self()) - ->setUpdateMask($updateMask) - ->setAlertPolicy($alertPolicy); - } - - /** - * 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 deleted file mode 100644 index 1acaca5a69d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php +++ /dev/null @@ -1,134 +0,0 @@ -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; - - /** - * @param \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. - * - * @return \Google\Cloud\Monitoring\V3\UpdateGroupRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\Group $group): self - { - return (new self()) - ->setGroup($group); - } - - /** - * 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 deleted file mode 100644 index 6528f4c7e50..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -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; - - /** - * @param \Google\Protobuf\FieldMask $updateMask The fields to update. - * @param \Google\Cloud\Monitoring\V3\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`. - * - * @return \Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest - * - * @experimental - */ - public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self - { - return (new self()) - ->setUpdateMask($updateMask) - ->setNotificationChannel($notificationChannel); - } - - /** - * 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 deleted file mode 100644 index c6521c3f2a3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -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; - - /** - * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. - * The given `name` specifies the resource to update. - * - * @return \Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self - { - return (new self()) - ->setServiceLevelObjective($serviceLevelObjective); - } - - /** - * 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 deleted file mode 100644 index c672ae081a8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -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; - - /** - * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * - * @return \Google\Cloud\Monitoring\V3\UpdateServiceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\Service $service): self - { - return (new self()) - ->setService($service); - } - - /** - * 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/UpdateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php deleted file mode 100644 index d3091d8bda9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php +++ /dev/null @@ -1,227 +0,0 @@ -google.monitoring.v3.UpdateSnoozeRequest - */ -class UpdateSnoozeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `Snooze` to update. Must have the name field present. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $snooze = null; - /** - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to update. Must have the name field present. - * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to update. - * - * For each field listed in `update_mask`: - * - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * - * Fields not listed retain their existing value. - * - * The following are the field names that are accepted in `update_mask`: - * - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * @return \Google\Cloud\Monitoring\V3\UpdateSnoozeRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\Snooze $snooze, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Monitoring\V3\Snooze $snooze - * Required. The `Snooze` to update. Must have the name field present. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `Snooze` to update. Must have the name field present. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Snooze|null - */ - public function getSnooze() - { - return $this->snooze; - } - - public function hasSnooze() - { - return isset($this->snooze); - } - - public function clearSnooze() - { - unset($this->snooze); - } - - /** - * Required. The `Snooze` to update. Must have the name field present. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Snooze $var - * @return $this - */ - public function setSnooze($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); - $this->snooze = $var; - - return $this; - } - - /** - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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 deleted file mode 100644 index 151f4486915..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php +++ /dev/null @@ -1,192 +0,0 @@ -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 corresponding 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; - - /** - * @param \Google\Cloud\Monitoring\V3\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 corresponding 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`. - * - * @return \Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self - { - return (new self()) - ->setUptimeCheckConfig($uptimeCheckConfig); - } - - /** - * 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 corresponding 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 corresponding 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 corresponding 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 deleted file mode 100644 index 10904aecc43..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php +++ /dev/null @@ -1,711 +0,0 @@ -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 Cloud Monitoring 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 type of checkers to use to execute the Uptime check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; - */ - protected $checker_type = 0; - /** - * 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; - /** - * User-supplied key/value data to be used for organizing and - * identifying the `UptimeCheckConfig` 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 = 20; - */ - private $user_labels; - 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 Cloud Monitoring 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` - * `servicedirectory_service` - * `cloud_run_revision` - * @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 array<\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 $checker_type - * The type of checkers to use to execute the Uptime check. - * @type array|\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 array<\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`. - * @type array|\Google\Protobuf\Internal\MapField $user_labels - * User-supplied key/value data to be used for organizing and - * identifying the `UptimeCheckConfig` 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. - * } - */ - 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 Cloud Monitoring 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 Cloud Monitoring 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` - * `servicedirectory_service` - * `cloud_run_revision` - * - * 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` - * `servicedirectory_service` - * `cloud_run_revision` - * - * 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 array<\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 type of checkers to use to execute the Uptime check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; - * @return int - */ - public function getCheckerType() - { - return $this->checker_type; - } - - /** - * The type of checkers to use to execute the Uptime check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; - * @param int $var - * @return $this - */ - public function setCheckerType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\CheckerType::class); - $this->checker_type = $var; - - 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 array|\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 array<\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; - } - - /** - * User-supplied key/value data to be used for organizing and - * identifying the `UptimeCheckConfig` 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 = 20; - * @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 `UptimeCheckConfig` 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 = 20; - * @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 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/CheckerType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php deleted file mode 100644 index e97a33453e2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php +++ /dev/null @@ -1,69 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.CheckerType - */ -class CheckerType -{ - /** - * The default checker type. Currently converted to `STATIC_IP_CHECKERS` - * on creation, the default conversion behavior may change in the future. - * - * Generated from protobuf enum CHECKER_TYPE_UNSPECIFIED = 0; - */ - const CHECKER_TYPE_UNSPECIFIED = 0; - /** - * `STATIC_IP_CHECKERS` are used for uptime checks that perform egress - * across the public internet. `STATIC_IP_CHECKERS` use the static IP - * addresses returned by `ListUptimeCheckIps`. - * - * Generated from protobuf enum STATIC_IP_CHECKERS = 1; - */ - const STATIC_IP_CHECKERS = 1; - /** - * `VPC_CHECKERS` are used for uptime checks that perform egress using - * Service Directory and private network access. When using `VPC_CHECKERS`, - * the monitored resource type must be `servicedirectory_service`. - * - * Generated from protobuf enum VPC_CHECKERS = 3; - */ - const VPC_CHECKERS = 3; - - private static $valueToName = [ - self::CHECKER_TYPE_UNSPECIFIED => 'CHECKER_TYPE_UNSPECIFIED', - self::STATIC_IP_CHECKERS => 'STATIC_IP_CHECKERS', - self::VPC_CHECKERS => 'VPC_CHECKERS', - ]; - - 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(CheckerType::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_CheckerType::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 deleted file mode 100644 index 6c5646dbef8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php +++ /dev/null @@ -1,158 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.ContentMatcher - */ -class ContentMatcher extends \Google\Protobuf\Internal\Message -{ - /** - * String, regex or JSON 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; - protected $additional_matcher_info; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * String, regex or JSON 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. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $json_path_matcher - * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * String, regex or JSON 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, regex or JSON 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; - } - - /** - * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher|null - */ - public function getJsonPathMatcher() - { - return $this->readOneof(3); - } - - public function hasJsonPathMatcher() - { - return $this->hasOneof(3); - } - - /** - * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $var - * @return $this - */ - public function setJsonPathMatcher($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getAdditionalMatcherInfo() - { - return $this->whichOneof("additional_matcher_info"); - } - -} - -// 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 deleted file mode 100644 index 3dffeaa7586..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php +++ /dev/null @@ -1,107 +0,0 @@ -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 if 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; - /** - * Selects JSONPath matching. See `JsonPathMatcher` for details on when - * the match succeeds. JSONPath matching is only supported for HTTP/HTTPS - * checks. - * - * Generated from protobuf enum MATCHES_JSON_PATH = 5; - */ - const MATCHES_JSON_PATH = 5; - /** - * Selects JSONPath matching. See `JsonPathMatcher` for details on when - * the match succeeds. Succeeds when output does _NOT_ match as specified. - * JSONPath is only supported for HTTP/HTTPS checks. - * - * Generated from protobuf enum NOT_MATCHES_JSON_PATH = 6; - */ - const NOT_MATCHES_JSON_PATH = 6; - - 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', - self::MATCHES_JSON_PATH => 'MATCHES_JSON_PATH', - self::NOT_MATCHES_JSON_PATH => 'NOT_MATCHES_JSON_PATH', - ]; - - 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/ContentMatcher/JsonPathMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php deleted file mode 100644 index 04e6f363bfa..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php +++ /dev/null @@ -1,114 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher - */ -class JsonPathMatcher extends \Google\Protobuf\Internal\Message -{ - /** - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * - * Generated from protobuf field string json_path = 1; - */ - protected $json_path = ''; - /** - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; - */ - protected $json_matcher = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $json_path - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * @type int $json_matcher - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * - * Generated from protobuf field string json_path = 1; - * @return string - */ - public function getJsonPath() - { - return $this->json_path; - } - - /** - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * - * Generated from protobuf field string json_path = 1; - * @param string $var - * @return $this - */ - public function setJsonPath($var) - { - GPBUtil::checkString($var, True); - $this->json_path = $var; - - return $this; - } - - /** - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; - * @return int - */ - public function getJsonMatcher() - { - return $this->json_matcher; - } - - /** - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; - * @param int $var - * @return $this - */ - public function setJsonMatcher($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher\JsonPathMatcherOption::class); - $this->json_matcher = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(JsonPathMatcher::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php deleted file mode 100644 index 965725688ee..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php +++ /dev/null @@ -1,68 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption - */ -class JsonPathMatcherOption -{ - /** - * No JSONPath matcher type specified (not valid). - * - * Generated from protobuf enum JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; - */ - const JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; - /** - * Selects 'exact string' matching. The match succeeds if the content at - * the `json_path` within the output is exactly the same as the - * `content` string. - * - * Generated from protobuf enum EXACT_MATCH = 1; - */ - const EXACT_MATCH = 1; - /** - * Selects regular-expression matching. The match succeeds if the - * content at the `json_path` within the output matches the regular - * expression specified in the `content` string. - * - * Generated from protobuf enum REGEX_MATCH = 2; - */ - const REGEX_MATCH = 2; - - private static $valueToName = [ - self::JSON_PATH_MATCHER_OPTION_UNSPECIFIED => 'JSON_PATH_MATCHER_OPTION_UNSPECIFIED', - self::EXACT_MATCH => 'EXACT_MATCH', - self::REGEX_MATCH => 'REGEX_MATCH', - ]; - - 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(JsonPathMatcherOption::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption::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 deleted file mode 100644 index e158f367c01..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php +++ /dev/null @@ -1,678 +0,0 @@ -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; - /** - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * - * Generated from protobuf field string custom_content_type = 13; - */ - protected $custom_content_type = ''; - /** - * 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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * - * Generated from protobuf field bytes body = 10; - */ - protected $body = ''; - /** - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; - */ - private $accepted_response_status_codes; - /** - * Contains information needed to add pings to an HTTP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; - */ - protected $ping_config = null; - - /** - * 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 string $custom_content_type - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * @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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * @type array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $accepted_response_status_codes - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config - * Contains information needed to add pings to an HTTP check. - * } - */ - 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; - } - - /** - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * - * Generated from protobuf field string custom_content_type = 13; - * @return string - */ - public function getCustomContentType() - { - return $this->custom_content_type; - } - - /** - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * - * Generated from protobuf field string custom_content_type = 13; - * @param string $var - * @return $this - */ - public function setCustomContentType($var) - { - GPBUtil::checkString($var, True); - $this->custom_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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * - * 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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * - * 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; - } - - /** - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAcceptedResponseStatusCodes() - { - return $this->accepted_response_status_codes; - } - - /** - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; - * @param array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAcceptedResponseStatusCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode::class); - $this->accepted_response_status_codes = $arr; - - return $this; - } - - /** - * Contains information needed to add pings to an HTTP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null - */ - public function getPingConfig() - { - return $this->ping_config; - } - - public function hasPingConfig() - { - return isset($this->ping_config); - } - - public function clearPingConfig() - { - unset($this->ping_config); - } - - /** - * Contains information needed to add pings to an HTTP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var - * @return $this - */ - public function setPingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); - $this->ping_config = $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 deleted file mode 100644 index d193ecd51c7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100644 index 7eeb5f3ad04..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php +++ /dev/null @@ -1,67 +0,0 @@ -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; - /** - * `body` is in `custom_content_type` form. Equivalent to setting the - * `Content-Type` to the contents of `custom_content_type` in the HTTP - * request. - * - * Generated from protobuf enum USER_PROVIDED = 2; - */ - const USER_PROVIDED = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::URL_ENCODED => 'URL_ENCODED', - self::USER_PROVIDED => 'USER_PROVIDED', - ]; - - 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 deleted file mode 100644 index 981e2cbc372..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php +++ /dev/null @@ -1,64 +0,0 @@ -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/HttpCheck/ResponseStatusCode.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php deleted file mode 100644 index 61fe31c3dab..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php +++ /dev/null @@ -1,112 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode - */ -class ResponseStatusCode extends \Google\Protobuf\Internal\Message -{ - protected $status_code; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $status_value - * A status code to accept. - * @type int $status_class - * A class of status codes to accept. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * A status code to accept. - * - * Generated from protobuf field int32 status_value = 1; - * @return int - */ - public function getStatusValue() - { - return $this->readOneof(1); - } - - public function hasStatusValue() - { - return $this->hasOneof(1); - } - - /** - * A status code to accept. - * - * Generated from protobuf field int32 status_value = 1; - * @param int $var - * @return $this - */ - public function setStatusValue($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A class of status codes to accept. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; - * @return int - */ - public function getStatusClass() - { - return $this->readOneof(2); - } - - public function hasStatusClass() - { - return $this->hasOneof(2); - } - - /** - * A class of status codes to accept. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; - * @param int $var - * @return $this - */ - public function setStatusClass($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode\StatusClass::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getStatusCode() - { - return $this->whichOneof("status_code"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResponseStatusCode::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php deleted file mode 100644 index ec9ccc03c04..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php +++ /dev/null @@ -1,92 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass - */ -class StatusClass -{ - /** - * Default value that matches no status codes. - * - * Generated from protobuf enum STATUS_CLASS_UNSPECIFIED = 0; - */ - const STATUS_CLASS_UNSPECIFIED = 0; - /** - * The class of status codes between 100 and 199. - * - * Generated from protobuf enum STATUS_CLASS_1XX = 100; - */ - const STATUS_CLASS_1XX = 100; - /** - * The class of status codes between 200 and 299. - * - * Generated from protobuf enum STATUS_CLASS_2XX = 200; - */ - const STATUS_CLASS_2XX = 200; - /** - * The class of status codes between 300 and 399. - * - * Generated from protobuf enum STATUS_CLASS_3XX = 300; - */ - const STATUS_CLASS_3XX = 300; - /** - * The class of status codes between 400 and 499. - * - * Generated from protobuf enum STATUS_CLASS_4XX = 400; - */ - const STATUS_CLASS_4XX = 400; - /** - * The class of status codes between 500 and 599. - * - * Generated from protobuf enum STATUS_CLASS_5XX = 500; - */ - const STATUS_CLASS_5XX = 500; - /** - * The class of all status codes. - * - * Generated from protobuf enum STATUS_CLASS_ANY = 1000; - */ - const STATUS_CLASS_ANY = 1000; - - private static $valueToName = [ - self::STATUS_CLASS_UNSPECIFIED => 'STATUS_CLASS_UNSPECIFIED', - self::STATUS_CLASS_1XX => 'STATUS_CLASS_1XX', - self::STATUS_CLASS_2XX => 'STATUS_CLASS_2XX', - self::STATUS_CLASS_3XX => 'STATUS_CLASS_3XX', - self::STATUS_CLASS_4XX => 'STATUS_CLASS_4XX', - self::STATUS_CLASS_5XX => 'STATUS_CLASS_5XX', - self::STATUS_CLASS_ANY => 'STATUS_CLASS_ANY', - ]; - - 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(StatusClass::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php deleted file mode 100644 index ae85d7f1047..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.PingConfig - */ -class PingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * - * Generated from protobuf field int32 pings_count = 1; - */ - protected $pings_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $pings_count - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * - * Generated from protobuf field int32 pings_count = 1; - * @return int - */ - public function getPingsCount() - { - return $this->pings_count; - } - - /** - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * - * Generated from protobuf field int32 pings_count = 1; - * @param int $var - * @return $this - */ - public function setPingsCount($var) - { - GPBUtil::checkInt32($var); - $this->pings_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PingConfig::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_PingConfig::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 deleted file mode 100644 index 25ef6cb80c6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php +++ /dev/null @@ -1,113 +0,0 @@ -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 deleted file mode 100644 index 09c0668c3b3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php +++ /dev/null @@ -1,122 +0,0 @@ -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; - /** - * Contains information needed to add pings to a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; - */ - protected $ping_config = null; - - /** - * 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. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config - * Contains information needed to add pings to a TCP check. - * } - */ - 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; - } - - /** - * Contains information needed to add pings to a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null - */ - public function getPingConfig() - { - return $this->ping_config; - } - - public function hasPingConfig() - { - return isset($this->ping_config); - } - - public function clearPingConfig() - { - unset($this->ping_config); - } - - /** - * Contains information needed to add pings to a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var - * @return $this - */ - public function setPingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); - $this->ping_config = $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/UptimeCheckIp.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php deleted file mode 100644 index 8eb3b2a696b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index 8524b68cf0f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php +++ /dev/null @@ -1,102 +0,0 @@ -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; - /** - * Allows checks to run from locations within the western United States of - * America - * - * Generated from protobuf enum USA_OREGON = 5; - */ - const USA_OREGON = 5; - /** - * Allows checks to run from locations within the central United States of - * America - * - * Generated from protobuf enum USA_IOWA = 6; - */ - const USA_IOWA = 6; - /** - * Allows checks to run from locations within the eastern United States of - * America - * - * Generated from protobuf enum USA_VIRGINIA = 7; - */ - const USA_VIRGINIA = 7; - - private static $valueToName = [ - self::REGION_UNSPECIFIED => 'REGION_UNSPECIFIED', - self::USA => 'USA', - self::EUROPE => 'EUROPE', - self::SOUTH_AMERICA => 'SOUTH_AMERICA', - self::ASIA_PACIFIC => 'ASIA_PACIFIC', - self::USA_OREGON => 'USA_OREGON', - self::USA_IOWA => 'USA_IOWA', - self::USA_VIRGINIA => 'USA_VIRGINIA', - ]; - - 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/VerifyNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php deleted file mode 100644 index 95410209d06..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The notification channel to verify. Please see - * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * @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). - * - * @return \Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name, string $code): self - { - return (new self()) - ->setName($name) - ->setCode($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 deleted file mode 100644 index f049ead8c43..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php +++ /dev/null @@ -1,236 +0,0 @@ -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 deleted file mode 100644 index 2a86a24e4ea..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php +++ /dev/null @@ -1,125 +0,0 @@ -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 deleted file mode 100644 index 7ff22f3a677..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php +++ /dev/null @@ -1,146 +0,0 @@ -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/samples/V3/AlertPolicyServiceClient/create_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php deleted file mode 100644 index 8da94f5c6a8..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($name) - ->setAlertPolicy($alertPolicy); - - // Call the API and handle any network failures. - try { - /** @var AlertPolicy $response */ - $response = $alertPolicyServiceClient->createAlertPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_alert_policy_sample($name); -} -// [END monitoring_v3_generated_AlertPolicyService_CreateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php deleted file mode 100644 index 20341bb9ced..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $alertPolicyServiceClient->deleteAlertPolicy($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - - delete_alert_policy_sample($formattedName); -} -// [END monitoring_v3_generated_AlertPolicyService_DeleteAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php deleted file mode 100644 index a6b8ef21ad6..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var AlertPolicy $response */ - $response = $alertPolicyServiceClient->getAlertPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - - get_alert_policy_sample($formattedName); -} -// [END monitoring_v3_generated_AlertPolicyService_GetAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php deleted file mode 100644 index dc60fddad14..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $alertPolicyServiceClient->listAlertPolicies($request); - - /** @var AlertPolicy $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_alert_policies_sample($name); -} -// [END monitoring_v3_generated_AlertPolicyService_ListAlertPolicies_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php deleted file mode 100644 index d4f9c5060ec..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php +++ /dev/null @@ -1,66 +0,0 @@ -setAlertPolicy($alertPolicy); - - // Call the API and handle any network failures. - try { - /** @var AlertPolicy $response */ - $response = $alertPolicyServiceClient->updateAlertPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_AlertPolicyService_UpdateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php deleted file mode 100644 index 5662f185f72..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($name) - ->setGroup($group); - - // Call the API and handle any network failures. - try { - /** @var Group $response */ - $response = $groupServiceClient->createGroup($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_group_sample($name); -} -// [END monitoring_v3_generated_GroupService_CreateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php deleted file mode 100644 index 2b0b5d393b3..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $groupServiceClient->deleteGroup($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); - - delete_group_sample($formattedName); -} -// [END monitoring_v3_generated_GroupService_DeleteGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php deleted file mode 100644 index 59d00116484..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Group $response */ - $response = $groupServiceClient->getGroup($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); - - get_group_sample($formattedName); -} -// [END monitoring_v3_generated_GroupService_GetGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php deleted file mode 100644 index 810ef1fb51c..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $groupServiceClient->listGroupMembers($request); - - /** @var MonitoredResource $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); - - list_group_members_sample($formattedName); -} -// [END monitoring_v3_generated_GroupService_ListGroupMembers_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php deleted file mode 100644 index 073f54a6f17..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $groupServiceClient->listGroups($request); - - /** @var Group $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_groups_sample($name); -} -// [END monitoring_v3_generated_GroupService_ListGroups_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php deleted file mode 100644 index 58d8ed1e52b..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php +++ /dev/null @@ -1,60 +0,0 @@ -setGroup($group); - - // Call the API and handle any network failures. - try { - /** @var Group $response */ - $response = $groupServiceClient->updateGroup($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_GroupService_UpdateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php deleted file mode 100644 index c54f10ba5a8..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($name) - ->setMetricDescriptor($metricDescriptor); - - // Call the API and handle any network failures. - try { - /** @var MetricDescriptor $response */ - $response = $metricServiceClient->createMetricDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_metric_descriptor_sample($name); -} -// [END monitoring_v3_generated_MetricService_CreateMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php deleted file mode 100644 index 3676da8a884..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName) - ->setTimeSeries($timeSeries); - - // Call the API and handle any network failures. - try { - $metricServiceClient->createServiceTimeSeries($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::projectName('[PROJECT]'); - - create_service_time_series_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_CreateServiceTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php deleted file mode 100644 index 943e3d74156..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php +++ /dev/null @@ -1,82 +0,0 @@ -setName($formattedName) - ->setTimeSeries($timeSeries); - - // Call the API and handle any network failures. - try { - $metricServiceClient->createTimeSeries($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::projectName('[PROJECT]'); - - create_time_series_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_CreateTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php deleted file mode 100644 index 5be71ec658a..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $metricServiceClient->deleteMetricDescriptor($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - - delete_metric_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_DeleteMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php deleted file mode 100644 index f1733d7ebcf..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var MetricDescriptor $response */ - $response = $metricServiceClient->getMetricDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - - get_metric_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_GetMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php deleted file mode 100644 index b80928f31d4..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var MonitoredResourceDescriptor $response */ - $response = $metricServiceClient->getMonitoredResourceDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::monitoredResourceDescriptorName( - '[PROJECT]', - '[MONITORED_RESOURCE_DESCRIPTOR]' - ); - - get_monitored_resource_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_GetMonitoredResourceDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php deleted file mode 100644 index 2a60d376cdf..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $metricServiceClient->listMetricDescriptors($request); - - /** @var MetricDescriptor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_metric_descriptors_sample($name); -} -// [END monitoring_v3_generated_MetricService_ListMetricDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php deleted file mode 100644 index 8594af87cfc..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $metricServiceClient->listMonitoredResourceDescriptors($request); - - /** @var MonitoredResourceDescriptor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_monitored_resource_descriptors_sample($name); -} -// [END monitoring_v3_generated_MetricService_ListMonitoredResourceDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php deleted file mode 100644 index 2d408169cc2..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php +++ /dev/null @@ -1,99 +0,0 @@ -setName($formattedName) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $metricServiceClient->listTimeSeries($request); - - /** @var TimeSeries $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::workspaceName('[PROJECT]'); - $filter = '[FILTER]'; - $view = TimeSeriesView::FULL; - - list_time_series_sample($formattedName, $filter, $view); -} -// [END monitoring_v3_generated_MetricService_ListTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php deleted file mode 100644 index 4e2647ee023..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($name) - ->setNotificationChannel($notificationChannel); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->createNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_notification_channel_sample($name); -} -// [END monitoring_v3_generated_NotificationChannelService_CreateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php deleted file mode 100644 index 1af1aacc41e..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $notificationChannelServiceClient->deleteNotificationChannel($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - delete_notification_channel_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_DeleteNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php deleted file mode 100644 index a1efeebeec4..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->getNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - get_notification_channel_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php deleted file mode 100644 index 3f4bc0a7731..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannelDescriptor $response */ - $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelDescriptorName( - '[PROJECT]', - '[CHANNEL_DESCRIPTOR]' - ); - - get_notification_channel_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php deleted file mode 100644 index a63472001e2..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php +++ /dev/null @@ -1,96 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var GetNotificationChannelVerificationCodeResponse $response */ - $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - get_notification_channel_verification_code_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php deleted file mode 100644 index 0382fad734f..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $notificationChannelServiceClient->listNotificationChannelDescriptors($request); - - /** @var NotificationChannelDescriptor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_notification_channel_descriptors_sample($name); -} -// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannelDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php deleted file mode 100644 index 4a236f89c3a..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $notificationChannelServiceClient->listNotificationChannels($request); - - /** @var NotificationChannel $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_notification_channels_sample($name); -} -// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannels_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php deleted file mode 100644 index b8810b7a301..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $notificationChannelServiceClient->sendNotificationChannelVerificationCode($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - send_notification_channel_verification_code_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_SendNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php deleted file mode 100644 index ad79286eff6..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php +++ /dev/null @@ -1,65 +0,0 @@ -setNotificationChannel($notificationChannel); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->updateNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_NotificationChannelService_UpdateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php deleted file mode 100644 index 7603415aff5..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName) - ->setCode($code); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->verifyNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - $code = '[CODE]'; - - verify_notification_channel_sample($formattedName, $code); -} -// [END monitoring_v3_generated_NotificationChannelService_VerifyNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php deleted file mode 100644 index c9e9a6166ae..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($name) - ->setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $queryServiceClient->queryTimeSeries($request); - - /** @var TimeSeriesData $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - $query = '[QUERY]'; - - query_time_series_sample($name, $query); -} -// [END monitoring_v3_generated_QueryService_QueryTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php deleted file mode 100644 index f1cd6dae994..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($parent) - ->setService($service); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $serviceMonitoringServiceClient->createService($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - create_service_sample($parent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_CreateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php deleted file mode 100644 index 2559795e52e..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php +++ /dev/null @@ -1,75 +0,0 @@ -setParent($formattedParent) - ->setServiceLevelObjective($serviceLevelObjective); - - // Call the API and handle any network failures. - try { - /** @var ServiceLevelObjective $response */ - $response = $serviceMonitoringServiceClient->createServiceLevelObjective($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - create_service_level_objective_sample($formattedParent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php deleted file mode 100644 index dd319f9e610..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $serviceMonitoringServiceClient->deleteService($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - delete_service_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_DeleteService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php deleted file mode 100644 index ca3c8187246..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $serviceMonitoringServiceClient->deleteServiceLevelObjective($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - - delete_service_level_objective_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_DeleteServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php deleted file mode 100644 index cb12b2fcac7..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $serviceMonitoringServiceClient->getService($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - get_service_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_GetService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php deleted file mode 100644 index 7bc8c814262..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ServiceLevelObjective $response */ - $response = $serviceMonitoringServiceClient->getServiceLevelObjective($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - - get_service_level_objective_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_GetServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php deleted file mode 100644 index 4476bfaaafd..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $serviceMonitoringServiceClient->listServiceLevelObjectives($request); - - /** @var ServiceLevelObjective $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - list_service_level_objectives_sample($formattedParent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_ListServiceLevelObjectives_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php deleted file mode 100644 index f1495ce77ad..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $serviceMonitoringServiceClient->listServices($request); - - /** @var Service $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_services_sample($parent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_ListServices_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php deleted file mode 100644 index 1a9fbecdfd9..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php +++ /dev/null @@ -1,59 +0,0 @@ -setService($service); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $serviceMonitoringServiceClient->updateService($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_ServiceMonitoringService_UpdateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php deleted file mode 100644 index 30611bd57c1..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php +++ /dev/null @@ -1,59 +0,0 @@ -setServiceLevelObjective($serviceLevelObjective); - - // Call the API and handle any network failures. - try { - /** @var ServiceLevelObjective $response */ - $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_ServiceMonitoringService_UpdateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php deleted file mode 100644 index f16d2759dbb..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php +++ /dev/null @@ -1,99 +0,0 @@ -setName($snoozeName) - ->setCriteria($snoozeCriteria) - ->setInterval($snoozeInterval) - ->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - - // Call the API and handle any network failures. - try { - /** @var Snooze $response */ - $response = $snoozeServiceClient->createSnooze($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); - $snoozeName = '[NAME]'; - $snoozeDisplayName = '[DISPLAY_NAME]'; - - create_snooze_sample($formattedParent, $snoozeName, $snoozeDisplayName); -} -// [END monitoring_v3_generated_SnoozeService_CreateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php deleted file mode 100644 index cf467e5c3c3..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Snooze $response */ - $response = $snoozeServiceClient->getSnooze($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SnoozeServiceClient::snoozeName('[PROJECT]', '[SNOOZE]'); - - get_snooze_sample($formattedName); -} -// [END monitoring_v3_generated_SnoozeService_GetSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php deleted file mode 100644 index f0fb94d6601..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $snoozeServiceClient->listSnoozes($request); - - /** @var Snooze $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); - - list_snoozes_sample($formattedParent); -} -// [END monitoring_v3_generated_SnoozeService_ListSnoozes_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php deleted file mode 100644 index 2fa14b61a73..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php +++ /dev/null @@ -1,90 +0,0 @@ -setName($snoozeName) - ->setCriteria($snoozeCriteria) - ->setInterval($snoozeInterval) - ->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $request = (new UpdateSnoozeRequest()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Snooze $response */ - $response = $snoozeServiceClient->updateSnooze($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $snoozeName = '[NAME]'; - $snoozeDisplayName = '[DISPLAY_NAME]'; - - update_snooze_sample($snoozeName, $snoozeDisplayName); -} -// [END monitoring_v3_generated_SnoozeService_UpdateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php deleted file mode 100644 index 6ad37bedcda..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - - // Call the API and handle any network failures. - try { - /** @var UptimeCheckConfig $response */ - $response = $uptimeCheckServiceClient->createUptimeCheckConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - create_uptime_check_config_sample($parent); -} -// [END monitoring_v3_generated_UptimeCheckService_CreateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php deleted file mode 100644 index d33f28aec3e..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $uptimeCheckServiceClient->deleteUptimeCheckConfig($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - - delete_uptime_check_config_sample($formattedName); -} -// [END monitoring_v3_generated_UptimeCheckService_DeleteUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php deleted file mode 100644 index a3dbc0e2c41..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var UptimeCheckConfig $response */ - $response = $uptimeCheckServiceClient->getUptimeCheckConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - - get_uptime_check_config_sample($formattedName); -} -// [END monitoring_v3_generated_UptimeCheckService_GetUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php deleted file mode 100644 index 7a681db4527..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $uptimeCheckServiceClient->listUptimeCheckConfigs($request); - - /** @var UptimeCheckConfig $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_uptime_check_configs_sample($parent); -} -// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckConfigs_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php deleted file mode 100644 index 9d96322e41f..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php +++ /dev/null @@ -1,62 +0,0 @@ -listUptimeCheckIps($request); - - /** @var UptimeCheckIp $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckIps_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php deleted file mode 100644 index cdef12857a2..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php +++ /dev/null @@ -1,62 +0,0 @@ -setUptimeCheckConfig($uptimeCheckConfig); - - // Call the API and handle any network failures. - try { - /** @var UptimeCheckConfig $response */ - $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_UptimeCheckService_UpdateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php deleted file mode 100644 index 66d3410ff0c..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('alertPolicy')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted alert_policy_condition resource. - */ - public static function alertPolicyConditionName(string $project, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('alertPolicyCondition')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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(string $folder, string $alertPolicy): string - { - return self::getPathTemplate('folderAlertPolicy')->render([ - 'folder' => $folder, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_alert_policy_condition resource. - * - * @param string $folder - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted folder_alert_policy_condition resource. - */ - public static function folderAlertPolicyConditionName(string $folder, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('folderAlertPolicyCondition')->render([ - 'folder' => $folder, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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(string $organization, string $alertPolicy): string - { - return self::getPathTemplate('organizationAlertPolicy')->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_alert_policy_condition resource. - * - * @param string $organization - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted organization_alert_policy_condition resource. - */ - public static function organizationAlertPolicyConditionName(string $organization, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('organizationAlertPolicyCondition')->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('projectAlertPolicy')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted project_alert_policy_condition resource. - */ - public static function projectAlertPolicyConditionName(string $project, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('projectAlertPolicyCondition')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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} - * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - * 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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new alerting policy. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * The async variant is {@see AlertPolicyServiceClient::createAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/create_alert_policy.php - * - * @param CreateAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AlertPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function createAlertPolicy(CreateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy - { - return $this->startApiCall('CreateAlertPolicy', $request, $callOptions)->wait(); - } - - /** - * Deletes an alerting policy. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * The async variant is {@see AlertPolicyServiceClient::deleteAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/delete_alert_policy.php - * - * @param DeleteAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteAlertPolicy(DeleteAlertPolicyRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteAlertPolicy', $request, $callOptions)->wait(); - } - - /** - * Gets a single alerting policy. - * - * The async variant is {@see AlertPolicyServiceClient::getAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/get_alert_policy.php - * - * @param GetAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AlertPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getAlertPolicy(GetAlertPolicyRequest $request, array $callOptions = []): AlertPolicy - { - return $this->startApiCall('GetAlertPolicy', $request, $callOptions)->wait(); - } - - /** - * Lists the existing alerting policies for the workspace. - * - * The async variant is {@see AlertPolicyServiceClient::listAlertPoliciesAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/list_alert_policies.php - * - * @param ListAlertPoliciesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listAlertPolicies(ListAlertPoliciesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListAlertPolicies', $request, $callOptions); - } - - /** - * 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * The async variant is {@see AlertPolicyServiceClient::updateAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/update_alert_policy.php - * - * @param UpdateAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AlertPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateAlertPolicy(UpdateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy - { - return $this->startApiCall('UpdateAlertPolicy', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php deleted file mode 100644 index 2f50d564b82..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php +++ /dev/null @@ -1,444 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $group): string - { - return self::getPathTemplate('folderGroup')->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(string $project, string $group): string - { - return self::getPathTemplate('group')->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(string $organization, string $group): string - { - return self::getPathTemplate('organizationGroup')->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(string $project, string $group): string - { - return self::getPathTemplate('projectGroup')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new group. - * - * The async variant is {@see GroupServiceClient::createGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/create_group.php - * - * @param CreateGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Group - * - * @throws ApiException Thrown if the API call fails. - */ - public function createGroup(CreateGroupRequest $request, array $callOptions = []): Group - { - return $this->startApiCall('CreateGroup', $request, $callOptions)->wait(); - } - - /** - * Deletes an existing group. - * - * The async variant is {@see GroupServiceClient::deleteGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/delete_group.php - * - * @param DeleteGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteGroup(DeleteGroupRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteGroup', $request, $callOptions)->wait(); - } - - /** - * Gets a single group. - * - * The async variant is {@see GroupServiceClient::getGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/get_group.php - * - * @param GetGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Group - * - * @throws ApiException Thrown if the API call fails. - */ - public function getGroup(GetGroupRequest $request, array $callOptions = []): Group - { - return $this->startApiCall('GetGroup', $request, $callOptions)->wait(); - } - - /** - * Lists the monitored resources that are members of a group. - * - * The async variant is {@see GroupServiceClient::listGroupMembersAsync()} . - * - * @example samples/V3/GroupServiceClient/list_group_members.php - * - * @param ListGroupMembersRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listGroupMembers(ListGroupMembersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListGroupMembers', $request, $callOptions); - } - - /** - * Lists the existing groups. - * - * The async variant is {@see GroupServiceClient::listGroupsAsync()} . - * - * @example samples/V3/GroupServiceClient/list_groups.php - * - * @param ListGroupsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listGroups(ListGroupsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListGroups', $request, $callOptions); - } - - /** - * Updates an existing group. - * You can change any group attributes except `name`. - * - * The async variant is {@see GroupServiceClient::updateGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/update_group.php - * - * @param UpdateGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Group - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateGroup(UpdateGroupRequest $request, array $callOptions = []): Group - { - return $this->startApiCall('UpdateGroup', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php deleted file mode 100644 index 84d12bcedab..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php +++ /dev/null @@ -1,675 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder): string - { - return self::getPathTemplate('folder')->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(string $folder, string $metricDescriptor): string - { - return self::getPathTemplate('folderMetricDescriptor')->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(string $folder, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('folderMonitoredResourceDescriptor')->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(string $project, string $metricDescriptor): string - { - return self::getPathTemplate('metricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('monitoredResourceDescriptor')->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(string $organization): string - { - return self::getPathTemplate('organization')->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(string $organization, string $metricDescriptor): string - { - return self::getPathTemplate('organizationMetricDescriptor')->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(string $organization, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('organizationMonitoredResourceDescriptor')->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(string $project): string - { - return self::getPathTemplate('project')->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(string $project, string $metricDescriptor): string - { - return self::getPathTemplate('projectMetricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('projectMonitoredResourceDescriptor')->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(string $project): string - { - return self::getPathTemplate('workspace')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new metric descriptor. - * The creation is executed asynchronously. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - * The metric descriptor is updated if it already exists, - * except that metric labels are never removed. - * - * The async variant is {@see MetricServiceClient::createMetricDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/create_metric_descriptor.php - * - * @param CreateMetricDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return MetricDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function createMetricDescriptor(CreateMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor - { - return $this->startApiCall('CreateMetricDescriptor', $request, $callOptions)->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. - * - * The async variant is {@see MetricServiceClient::createServiceTimeSeriesAsync()} - * . - * - * @example samples/V3/MetricServiceClient/create_service_time_series.php - * - * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function createServiceTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void - { - $this->startApiCall('CreateServiceTimeSeries', $request, $callOptions)->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. - * This method does not support - * [resource locations constraint of an organization - * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - * - * The async variant is {@see MetricServiceClient::createTimeSeriesAsync()} . - * - * @example samples/V3/MetricServiceClient/create_time_series.php - * - * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void - { - $this->startApiCall('CreateTimeSeries', $request, $callOptions)->wait(); - } - - /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - * deleted. - * - * The async variant is {@see MetricServiceClient::deleteMetricDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/delete_metric_descriptor.php - * - * @param DeleteMetricDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteMetricDescriptor(DeleteMetricDescriptorRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteMetricDescriptor', $request, $callOptions)->wait(); - } - - /** - * Gets a single metric descriptor. - * - * The async variant is {@see MetricServiceClient::getMetricDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/get_metric_descriptor.php - * - * @param GetMetricDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return MetricDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function getMetricDescriptor(GetMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor - { - return $this->startApiCall('GetMetricDescriptor', $request, $callOptions)->wait(); - } - - /** - * Gets a single monitored resource descriptor. - * - * The async variant is - * {@see MetricServiceClient::getMonitoredResourceDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php - * - * @param GetMonitoredResourceDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return MonitoredResourceDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest $request, array $callOptions = []): MonitoredResourceDescriptor - { - return $this->startApiCall('GetMonitoredResourceDescriptor', $request, $callOptions)->wait(); - } - - /** - * Lists metric descriptors that match a filter. - * - * The async variant is {@see MetricServiceClient::listMetricDescriptorsAsync()} . - * - * @example samples/V3/MetricServiceClient/list_metric_descriptors.php - * - * @param ListMetricDescriptorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listMetricDescriptors(ListMetricDescriptorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListMetricDescriptors', $request, $callOptions); - } - - /** - * Lists monitored resource descriptors that match a filter. - * - * The async variant is - * {@see MetricServiceClient::listMonitoredResourceDescriptorsAsync()} . - * - * @example samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php - * - * @param ListMonitoredResourceDescriptorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListMonitoredResourceDescriptors', $request, $callOptions); - } - - /** - * Lists time series that match a filter. - * - * The async variant is {@see MetricServiceClient::listTimeSeriesAsync()} . - * - * @example samples/V3/MetricServiceClient/list_time_series.php - * - * @param ListTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTimeSeries(ListTimeSeriesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTimeSeries', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php deleted file mode 100644 index 20f4631ad33..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php +++ /dev/null @@ -1,679 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $channelDescriptor): string - { - return self::getPathTemplate('folderChannelDescriptor')->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(string $folder, string $notificationChannel): string - { - return self::getPathTemplate('folderNotificationChannel')->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(string $project, string $notificationChannel): string - { - return self::getPathTemplate('notificationChannel')->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(string $project, string $channelDescriptor): string - { - return self::getPathTemplate('notificationChannelDescriptor')->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(string $organization, string $channelDescriptor): string - { - return self::getPathTemplate('organizationChannelDescriptor')->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(string $organization, string $notificationChannel): string - { - return self::getPathTemplate('organizationNotificationChannel')->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(string $project, string $channelDescriptor): string - { - return self::getPathTemplate('projectChannelDescriptor')->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(string $project, string $notificationChannel): string - { - return self::getPathTemplate('projectNotificationChannel')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new notification channel, representing a single notification - * endpoint such as an email address, SMS number, or PagerDuty service. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * The async variant is - * {@see NotificationChannelServiceClient::createNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/create_notification_channel.php - * - * @param CreateNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function createNotificationChannel(CreateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('CreateNotificationChannel', $request, $callOptions)->wait(); - } - - /** - * Deletes a notification channel. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * The async variant is - * {@see NotificationChannelServiceClient::deleteNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/delete_notification_channel.php - * - * @param DeleteNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteNotificationChannel(DeleteNotificationChannelRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteNotificationChannel', $request, $callOptions)->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. - * - * The async variant is - * {@see NotificationChannelServiceClient::getNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/get_notification_channel.php - * - * @param GetNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNotificationChannel(GetNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('GetNotificationChannel', $request, $callOptions)->wait(); - } - - /** - * Gets a single channel descriptor. The descriptor indicates which fields - * are expected / permitted for a notification channel of the given type. - * - * The async variant is - * {@see NotificationChannelServiceClient::getNotificationChannelDescriptorAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php - * - * @param GetNotificationChannelDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannelDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNotificationChannelDescriptor(GetNotificationChannelDescriptorRequest $request, array $callOptions = []): NotificationChannelDescriptor - { - return $this->startApiCall('GetNotificationChannelDescriptor', $request, $callOptions)->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. - * - * The async variant is - * {@see NotificationChannelServiceClient::getNotificationChannelVerificationCodeAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php - * - * @param GetNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return GetNotificationChannelVerificationCodeResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNotificationChannelVerificationCode(GetNotificationChannelVerificationCodeRequest $request, array $callOptions = []): GetNotificationChannelVerificationCodeResponse - { - return $this->startApiCall('GetNotificationChannelVerificationCode', $request, $callOptions)->wait(); - } - - /** - * Lists the descriptors for supported channel types. The use of descriptors - * makes it possible for new channel types to be dynamically added. - * - * The async variant is - * {@see NotificationChannelServiceClient::listNotificationChannelDescriptorsAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php - * - * @param ListNotificationChannelDescriptorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listNotificationChannelDescriptors(ListNotificationChannelDescriptorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListNotificationChannelDescriptors', $request, $callOptions); - } - - /** - * Lists the notification channels that have been created for the project. - * To list the types of notification channels that are supported, use - * the `ListNotificationChannelDescriptors` method. - * - * The async variant is - * {@see NotificationChannelServiceClient::listNotificationChannelsAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/list_notification_channels.php - * - * @param ListNotificationChannelsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listNotificationChannels(ListNotificationChannelsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListNotificationChannels', $request, $callOptions); - } - - /** - * Causes a verification code to be delivered to the channel. The code - * can then be supplied in `VerifyNotificationChannel` to verify the channel. - * - * The async variant is - * {@see NotificationChannelServiceClient::sendNotificationChannelVerificationCodeAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php - * - * @param SendNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function sendNotificationChannelVerificationCode(SendNotificationChannelVerificationCodeRequest $request, array $callOptions = []): void - { - $this->startApiCall('SendNotificationChannelVerificationCode', $request, $callOptions)->wait(); - } - - /** - * Updates a notification channel. Fields not specified in the field mask - * remain unchanged. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * The async variant is - * {@see NotificationChannelServiceClient::updateNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/update_notification_channel.php - * - * @param UpdateNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateNotificationChannel(UpdateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('UpdateNotificationChannel', $request, $callOptions)->wait(); - } - - /** - * Verifies a `NotificationChannel` by proving receipt of the code - * delivered to the channel as a result of calling - * `SendNotificationChannelVerificationCode`. - * - * The async variant is - * {@see NotificationChannelServiceClient::verifyNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/verify_notification_channel.php - * - * @param VerifyNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function verifyNotificationChannel(VerifyNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('VerifyNotificationChannel', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php deleted file mode 100644 index 81a5eab5b18..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php +++ /dev/null @@ -1,193 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Queries time series using Monitoring Query Language. - * - * The async variant is {@see QueryServiceClient::queryTimeSeriesAsync()} . - * - * @example samples/V3/QueryServiceClient/query_time_series.php - * - * @param QueryTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function queryTimeSeries(QueryTimeSeriesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('QueryTimeSeries', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php deleted file mode 100644 index ec9bb443cf7..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php +++ /dev/null @@ -1,635 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $service): string - { - return self::getPathTemplate('folderService')->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(string $folder, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('folderServiceServiceLevelObjective')->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(string $organization, string $service): string - { - return self::getPathTemplate('organizationService')->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(string $organization, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('organizationServiceServiceLevelObjective')->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(string $project, string $service): string - { - return self::getPathTemplate('projectService')->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(string $project, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('projectServiceServiceLevelObjective')->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(string $project, string $service): string - { - return self::getPathTemplate('service')->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(string $project, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('serviceLevelObjective')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Create a `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::createServiceAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/create_service.php - * - * @param CreateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function createService(CreateServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('CreateService', $request, $callOptions)->wait(); - } - - /** - * Create a `ServiceLevelObjective` for the given `Service`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::createServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php - * - * @param CreateServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ServiceLevelObjective - * - * @throws ApiException Thrown if the API call fails. - */ - public function createServiceLevelObjective(CreateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective - { - return $this->startApiCall('CreateServiceLevelObjective', $request, $callOptions)->wait(); - } - - /** - * Soft delete this `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::deleteServiceAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/delete_service.php - * - * @param DeleteServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteService(DeleteServiceRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteService', $request, $callOptions)->wait(); - } - - /** - * Delete the given `ServiceLevelObjective`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::deleteServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php - * - * @param DeleteServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteServiceLevelObjective', $request, $callOptions)->wait(); - } - - /** - * Get the named `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::getServiceAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/get_service.php - * - * @param GetServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function getService(GetServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('GetService', $request, $callOptions)->wait(); - } - - /** - * Get a `ServiceLevelObjective` by name. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::getServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php - * - * @param GetServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ServiceLevelObjective - * - * @throws ApiException Thrown if the API call fails. - */ - public function getServiceLevelObjective(GetServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective - { - return $this->startApiCall('GetServiceLevelObjective', $request, $callOptions)->wait(); - } - - /** - * List the `ServiceLevelObjective`s for the given `Service`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::listServiceLevelObjectivesAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php - * - * @param ListServiceLevelObjectivesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listServiceLevelObjectives(ListServiceLevelObjectivesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListServiceLevelObjectives', $request, $callOptions); - } - - /** - * List `Service`s for this Metrics Scope. - * - * The async variant is {@see ServiceMonitoringServiceClient::listServicesAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/list_services.php - * - * @param ListServicesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListServices', $request, $callOptions); - } - - /** - * Update this `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::updateServiceAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/update_service.php - * - * @param UpdateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateService(UpdateServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); - } - - /** - * Update the given `ServiceLevelObjective`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::updateServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php - * - * @param UpdateServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ServiceLevelObjective - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective - { - return $this->startApiCall('UpdateServiceLevelObjective', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php deleted file mode 100644 index e41cf63ae34..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php +++ /dev/null @@ -1,434 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/snooze_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('alertPolicy')->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(string $folder, string $alertPolicy): string - { - return self::getPathTemplate('folderAlertPolicy')->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(string $organization, string $alertPolicy): string - { - return self::getPathTemplate('organizationAlertPolicy')->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * 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(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('projectAlertPolicy')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a snooze - * resource. - * - * @param string $project - * @param string $snooze - * - * @return string The formatted snooze resource. - */ - public static function snoozeName(string $project, string $snooze): string - { - return self::getPathTemplate('snooze')->render([ - 'project' => $project, - 'snooze' => $snooze, - ]); - } - - /** - * 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(string $project): string - { - return self::getPathTemplate('workspace')->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 - * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - project: projects/{project} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - snooze: projects/{project}/snoozes/{snooze} - * - 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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a `Snooze` that will prevent alerts, which match the provided - * criteria, from being opened. The `Snooze` applies for a specific time - * interval. - * - * The async variant is {@see SnoozeServiceClient::createSnoozeAsync()} . - * - * @example samples/V3/SnoozeServiceClient/create_snooze.php - * - * @param CreateSnoozeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Snooze - * - * @throws ApiException Thrown if the API call fails. - */ - public function createSnooze(CreateSnoozeRequest $request, array $callOptions = []): Snooze - { - return $this->startApiCall('CreateSnooze', $request, $callOptions)->wait(); - } - - /** - * Retrieves a `Snooze` by `name`. - * - * The async variant is {@see SnoozeServiceClient::getSnoozeAsync()} . - * - * @example samples/V3/SnoozeServiceClient/get_snooze.php - * - * @param GetSnoozeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Snooze - * - * @throws ApiException Thrown if the API call fails. - */ - public function getSnooze(GetSnoozeRequest $request, array $callOptions = []): Snooze - { - return $this->startApiCall('GetSnooze', $request, $callOptions)->wait(); - } - - /** - * Lists the `Snooze`s associated with a project. Can optionally pass in - * `filter`, which specifies predicates to match `Snooze`s. - * - * The async variant is {@see SnoozeServiceClient::listSnoozesAsync()} . - * - * @example samples/V3/SnoozeServiceClient/list_snoozes.php - * - * @param ListSnoozesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSnoozes(ListSnoozesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSnoozes', $request, $callOptions); - } - - /** - * Updates a `Snooze`, identified by its `name`, with the parameters in the - * given `Snooze` object. - * - * The async variant is {@see SnoozeServiceClient::updateSnoozeAsync()} . - * - * @example samples/V3/SnoozeServiceClient/update_snooze.php - * - * @param UpdateSnoozeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Snooze - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateSnooze(UpdateSnoozeRequest $request, array $callOptions = []): Snooze - { - return $this->startApiCall('UpdateSnooze', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php deleted file mode 100644 index f80c8f32665..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php +++ /dev/null @@ -1,451 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $uptimeCheckConfig): string - { - return self::getPathTemplate('folderUptimeCheckConfig')->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(string $organization, string $uptimeCheckConfig): string - { - return self::getPathTemplate('organizationUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string - { - return self::getPathTemplate('projectUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string - { - return self::getPathTemplate('uptimeCheckConfig')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new Uptime check configuration. - * - * The async variant is - * {@see UptimeCheckServiceClient::createUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php - * - * @param CreateUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return UptimeCheckConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function createUptimeCheckConfig(CreateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig - { - return $this->startApiCall('CreateUptimeCheckConfig', $request, $callOptions)->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. - * - * The async variant is - * {@see UptimeCheckServiceClient::deleteUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php - * - * @param DeleteUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteUptimeCheckConfig', $request, $callOptions)->wait(); - } - - /** - * Gets a single Uptime check configuration. - * - * The async variant is - * {@see UptimeCheckServiceClient::getUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php - * - * @param GetUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return UptimeCheckConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getUptimeCheckConfig(GetUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig - { - return $this->startApiCall('GetUptimeCheckConfig', $request, $callOptions)->wait(); - } - - /** - * Lists the existing valid Uptime check configurations for the project - * (leaving out any invalid configurations). - * - * The async variant is - * {@see UptimeCheckServiceClient::listUptimeCheckConfigsAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php - * - * @param ListUptimeCheckConfigsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listUptimeCheckConfigs(ListUptimeCheckConfigsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListUptimeCheckConfigs', $request, $callOptions); - } - - /** - * Returns the list of IP addresses that checkers run from - * - * The async variant is {@see UptimeCheckServiceClient::listUptimeCheckIpsAsync()} - * . - * - * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php - * - * @param ListUptimeCheckIpsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listUptimeCheckIps(ListUptimeCheckIpsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListUptimeCheckIps', $request, $callOptions); - } - - /** - * 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. - * - * The async variant is - * {@see UptimeCheckServiceClient::updateUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php - * - * @param UpdateUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return UptimeCheckConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateUptimeCheckConfig(UpdateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig - { - return $this->startApiCall('UpdateUptimeCheckConfig', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php deleted file mode 100644 index b21dfc9d265..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php +++ /dev/null @@ -1,806 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\AlertPolicyServiceClient}. - */ -class AlertPolicyServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.AlertPolicyService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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 $alertPolicyConditionNameTemplate; - - private static $folderAlertPolicyNameTemplate; - - private static $folderAlertPolicyConditionNameTemplate; - - private static $organizationAlertPolicyNameTemplate; - - private static $organizationAlertPolicyConditionNameTemplate; - - private static $projectAlertPolicyNameTemplate; - - private static $projectAlertPolicyConditionNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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 getAlertPolicyConditionNameTemplate() - { - if (self::$alertPolicyConditionNameTemplate == null) { - self::$alertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$alertPolicyConditionNameTemplate; - } - - private static function getFolderAlertPolicyNameTemplate() - { - if (self::$folderAlertPolicyNameTemplate == null) { - self::$folderAlertPolicyNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}'); - } - - return self::$folderAlertPolicyNameTemplate; - } - - private static function getFolderAlertPolicyConditionNameTemplate() - { - if (self::$folderAlertPolicyConditionNameTemplate == null) { - self::$folderAlertPolicyConditionNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$folderAlertPolicyConditionNameTemplate; - } - - private static function getOrganizationAlertPolicyNameTemplate() - { - if (self::$organizationAlertPolicyNameTemplate == null) { - self::$organizationAlertPolicyNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}'); - } - - return self::$organizationAlertPolicyNameTemplate; - } - - private static function getOrganizationAlertPolicyConditionNameTemplate() - { - if (self::$organizationAlertPolicyConditionNameTemplate == null) { - self::$organizationAlertPolicyConditionNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$organizationAlertPolicyConditionNameTemplate; - } - - private static function getProjectAlertPolicyNameTemplate() - { - if (self::$projectAlertPolicyNameTemplate == null) { - self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); - } - - return self::$projectAlertPolicyNameTemplate; - } - - private static function getProjectAlertPolicyConditionNameTemplate() - { - if (self::$projectAlertPolicyConditionNameTemplate == null) { - self::$projectAlertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$projectAlertPolicyConditionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'alertPolicy' => self::getAlertPolicyNameTemplate(), - 'alertPolicyCondition' => self::getAlertPolicyConditionNameTemplate(), - 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), - 'folderAlertPolicyCondition' => self::getFolderAlertPolicyConditionNameTemplate(), - 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), - 'organizationAlertPolicyCondition' => self::getOrganizationAlertPolicyConditionNameTemplate(), - 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), - 'projectAlertPolicyCondition' => self::getProjectAlertPolicyConditionNameTemplate(), - ]; - } - - 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 - * alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted alert_policy_condition resource. - */ - public static function alertPolicyConditionName($project, $alertPolicy, $condition) - { - return self::getAlertPolicyConditionNameTemplate()->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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 - * folder_alert_policy_condition resource. - * - * @param string $folder - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted folder_alert_policy_condition resource. - */ - public static function folderAlertPolicyConditionName($folder, $alertPolicy, $condition) - { - return self::getFolderAlertPolicyConditionNameTemplate()->render([ - 'folder' => $folder, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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 - * organization_alert_policy_condition resource. - * - * @param string $organization - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted organization_alert_policy_condition resource. - */ - public static function organizationAlertPolicyConditionName($organization, $alertPolicy, $condition) - { - return self::getOrganizationAlertPolicyConditionNameTemplate()->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted project_alert_policy_condition resource. - */ - public static function projectAlertPolicyConditionName($project, $alertPolicy, $condition) - { - return self::getProjectAlertPolicyConditionNameTemplate()->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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} - * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - * 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * 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 Metrics Scope, 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index 04306c6bc04..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php +++ /dev/null @@ -1,752 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\GroupServiceClient}. - */ -class GroupServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.GroupService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index ca515984779..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php +++ /dev/null @@ -1,1178 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\MetricServiceClient}. - */ -class MetricServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.MetricService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - * The metric descriptor is updated if it already exists, - * except that metric labels are never removed. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * This method does not support - * [resource locations constraint of an organization - * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index 0661a3c04e3..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php +++ /dev/null @@ -1,1075 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient}. - */ -class NotificationChannelServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.NotificationChannelService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * To list the types of notification channels that are supported, use - * the `ListNotificationChannelDescriptors` method. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index b083925f4ba..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php +++ /dev/null @@ -1,256 +0,0 @@ -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(); - * } - * ``` - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\QueryServiceClient}. - */ -class QueryServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.QueryService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index c7cc9a8589b..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php +++ /dev/null @@ -1,1044 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\ServiceMonitoringServiceClient}. - */ -class ServiceMonitoringServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.ServiceMonitoringService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 Metrics Scope. 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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-zA-Z0-9-_:.]+$` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 Metrics Scope. 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 Metrics Scope. - * - * 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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * @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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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/SnoozeServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php deleted file mode 100644 index 08c130e17a0..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php +++ /dev/null @@ -1,680 +0,0 @@ -workspaceName('[PROJECT]'); - * $snooze = new Snooze(); - * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); - * } finally { - * $snoozeServiceClient->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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\SnoozeServiceClient}. - */ -class SnoozeServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.SnoozeService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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 $projectNameTemplate; - - private static $projectAlertPolicyNameTemplate; - - private static $snoozeNameTemplate; - - private static $workspaceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/snooze_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 getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectAlertPolicyNameTemplate() - { - if (self::$projectAlertPolicyNameTemplate == null) { - self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); - } - - return self::$projectAlertPolicyNameTemplate; - } - - private static function getSnoozeNameTemplate() - { - if (self::$snoozeNameTemplate == null) { - self::$snoozeNameTemplate = new PathTemplate('projects/{project}/snoozes/{snooze}'); - } - - return self::$snoozeNameTemplate; - } - - 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 = [ - 'alertPolicy' => self::getAlertPolicyNameTemplate(), - 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), - 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), - 'snooze' => self::getSnoozeNameTemplate(), - 'workspace' => self::getWorkspaceNameTemplate(), - ]; - } - - 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 - * 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_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, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a snooze - * resource. - * - * @param string $project - * @param string $snooze - * - * @return string The formatted snooze resource. - */ - public static function snoozeName($project, $snooze) - { - return self::getSnoozeNameTemplate()->render([ - 'project' => $project, - 'snooze' => $snooze, - ]); - } - - /** - * 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 - * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - project: projects/{project} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - snooze: projects/{project}/snoozes/{snooze} - * - 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 $apiEndpoint - * 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 - * $apiEndpoint 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 `Snooze` that will prevent alerts, which match the provided - * criteria, from being opened. The `Snooze` applies for a specific time - * interval. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); - * $snooze = new Snooze(); - * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Snooze - * - * @throws ApiException if the remote call fails - */ - public function createSnooze($parent, $snooze, array $optionalArgs = []) - { - $request = new CreateSnoozeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSnooze($snooze); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateSnooze', Snooze::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a `Snooze` by `name`. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $formattedName = $snoozeServiceClient->snoozeName('[PROJECT]', '[SNOOZE]'); - * $response = $snoozeServiceClient->getSnooze($formattedName); - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Snooze - * - * @throws ApiException if the remote call fails - */ - public function getSnooze($name, array $optionalArgs = []) - { - $request = new GetSnoozeRequest(); - $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('GetSnooze', Snooze::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the `Snooze`s associated with a project. Can optionally pass in - * `filter`, which specifies predicates to match `Snooze`s. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * - * * `interval.start_time` - * * `interval.end_time` - * - * For example: - * - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * @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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSnoozes($parent, array $optionalArgs = []) - { - $request = new ListSnoozesRequest(); - $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('ListSnoozes', $optionalArgs, ListSnoozesResponse::class, $request); - } - - /** - * Updates a `Snooze`, identified by its `name`, with the parameters in the - * given `Snooze` object. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $snooze = new Snooze(); - * $updateMask = new FieldMask(); - * $response = $snoozeServiceClient->updateSnooze($snooze, $updateMask); - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param Snooze $snooze Required. The `Snooze` to update. Must have the name field present. - * @param FieldMask $updateMask Required. The fields to update. - * - * For each field listed in `update_mask`: - * - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * - * Fields not listed retain their existing value. - * - * The following are the field names that are accepted in `update_mask`: - * - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Snooze - * - * @throws ApiException if the remote call fails - */ - public function updateSnooze($snooze, $updateMask, array $optionalArgs = []) - { - $request = new UpdateSnoozeRequest(); - $requestParamHeaders = []; - $request->setSnooze($snooze); - $request->setUpdateMask($updateMask); - $requestParamHeaders['snooze.name'] = $snooze->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateSnooze', Snooze::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 deleted file mode 100644 index 5cdb98a3e21..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php +++ /dev/null @@ -1,692 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\UptimeCheckServiceClient}. - */ -class UptimeCheckServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.UptimeCheckService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 string $filter - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * @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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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['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('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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 corresponding 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index c8b5d43074e..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.monitoring.v3.AlertPolicyService' => [ - 'CreateAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListAlertPolicies' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getAlertPolicies', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListAlertPoliciesResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', - 'headerParams' => [ - [ - 'keyName' => 'alert_policy.name', - 'fieldAccessors' => [ - 'getAlertPolicy', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'alertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', - 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', - 'folderAlertPolicyCondition' => 'folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}', - 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', - 'organizationAlertPolicyCondition' => 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}', - 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'projectAlertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', - ], - ], - ], -]; 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 deleted file mode 100644 index dffb1c026b4..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php +++ /dev/null @@ -1,67 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 3701e6baf28..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "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 deleted file mode 100644 index ff6efe326c8..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php +++ /dev/null @@ -1,103 +0,0 @@ - [ - 'google.monitoring.v3.GroupService' => [ - 'CreateGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Group', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Group', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListGroupMembers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMembers', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupMembersResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListGroups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getGroup', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Group', - 'headerParams' => [ - [ - 'keyName' => 'group.name', - 'fieldAccessors' => [ - 'getGroup', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'folderGroup' => 'folders/{folder}/groups/{group}', - 'group' => 'projects/{project}/groups/{group}', - 'organizationGroup' => 'organizations/{organization}/groups/{group}', - 'projectGroup' => 'projects/{project}/groups/{group}', - ], - ], - ], -]; 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 deleted file mode 100644 index 2d4763692de..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 37d238c0584..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "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 deleted file mode 100644 index 537f2edc969..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php +++ /dev/null @@ -1,154 +0,0 @@ - [ - 'google.monitoring.v3.MetricService' => [ - 'CreateMetricDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\MetricDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateServiceTimeSeries' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateTimeSeries' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteMetricDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetMetricDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\MetricDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetMonitoredResourceDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\MonitoredResourceDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListMetricDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetricDescriptors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListMetricDescriptorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListMonitoredResourceDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResourceDescriptors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListTimeSeries' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTimeSeries', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListTimeSeriesResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index 741468a73ec..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php +++ /dev/null @@ -1,136 +0,0 @@ - [ - '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', - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 90437e7f64c..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "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 deleted file mode 100644 index 212e17ef746..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php +++ /dev/null @@ -1,155 +0,0 @@ - [ - 'google.monitoring.v3.NotificationChannelService' => [ - 'CreateNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetNotificationChannelDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannelDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetNotificationChannelVerificationCode' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListNotificationChannelDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getChannelDescriptors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListNotificationChannels' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getNotificationChannels', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'SendNotificationChannelVerificationCode' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'notification_channel.name', - 'fieldAccessors' => [ - 'getNotificationChannel', - 'getName', - ], - ], - ], - ], - 'VerifyNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index 3c782d2b3a6..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php +++ /dev/null @@ -1,125 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index c20408d0ece..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "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 deleted file mode 100644 index a3c68187c23..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'google.monitoring.v3.QueryService' => [ - 'QueryTimeSeries' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTimeSeriesData', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\QueryTimeSeriesResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; 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 deleted file mode 100644 index f258f2c5638..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php +++ /dev/null @@ -1,21 +0,0 @@ - [ - 'google.monitoring.v3.QueryService' => [ - 'QueryTimeSeries' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}/timeSeries:query', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index daae71bdd45..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "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 deleted file mode 100644 index ab57f32e711..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php +++ /dev/null @@ -1,156 +0,0 @@ - [ - 'google.monitoring.v3.ServiceMonitoringService' => [ - 'CreateService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Service', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Service', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListServiceLevelObjectives' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServiceLevelObjectives', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListServicesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Service', - 'headerParams' => [ - [ - 'keyName' => 'service.name', - 'fieldAccessors' => [ - 'getService', - 'getName', - ], - ], - ], - ], - 'UpdateServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', - 'headerParams' => [ - [ - 'keyName' => 'service_level_objective.name', - 'fieldAccessors' => [ - 'getServiceLevelObjective', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index ddefc86e0a7..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php +++ /dev/null @@ -1,125 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json deleted file mode 100644 index 0acb65e12bd..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "interfaces": { - "google.monitoring.v3.SnoozeService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_9_codes": [ - "UNAVAILABLE" - ], - "no_retry_7_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_9_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_7_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": { - "CreateSnooze": { - "timeout_millis": 30000, - "retry_codes_name": "no_retry_7_codes", - "retry_params_name": "no_retry_7_params" - }, - "GetSnooze": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_9_codes", - "retry_params_name": "retry_policy_9_params" - }, - "ListSnoozes": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_9_codes", - "retry_params_name": "retry_policy_9_params" - }, - "UpdateSnooze": { - "timeout_millis": 30000, - "retry_codes_name": "no_retry_7_codes", - "retry_params_name": "no_retry_7_params" - } - } - } - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php deleted file mode 100644 index a476bb04670..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php +++ /dev/null @@ -1,74 +0,0 @@ - [ - 'google.monitoring.v3.SnoozeService' => [ - 'CreateSnooze' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetSnooze' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListSnoozes' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSnoozes', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListSnoozesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateSnooze' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', - 'headerParams' => [ - [ - 'keyName' => 'snooze.name', - 'fieldAccessors' => [ - 'getSnooze', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', - 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', - 'project' => 'projects/{project}', - 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'snooze' => 'projects/{project}/snoozes/{snooze}', - 'workspace' => 'projects/{project}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php deleted file mode 100644 index de2890fcd30..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php +++ /dev/null @@ -1,59 +0,0 @@ - [ - 'google.monitoring.v3.SnoozeService' => [ - 'CreateSnooze' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', - 'body' => 'snooze', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetSnooze' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*/snoozes/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListSnoozes' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateSnooze' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{snooze.name=projects/*/snoozes/*}', - 'body' => 'snooze', - 'placeholders' => [ - 'snooze.name' => [ - 'getters' => [ - 'getSnooze', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 4e19af23389..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "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 deleted file mode 100644 index f69c027e8c7..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php +++ /dev/null @@ -1,95 +0,0 @@ - [ - 'google.monitoring.v3.UptimeCheckService' => [ - 'CreateUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListUptimeCheckConfigs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUptimeCheckConfigs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListUptimeCheckIps' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUptimeCheckIps', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckIpsResponse', - ], - 'UpdateUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', - 'headerParams' => [ - [ - 'keyName' => 'uptime_check_config.name', - 'fieldAccessors' => [ - 'getUptimeCheckConfig', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index 48eea72dceb..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php +++ /dev/null @@ -1,71 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php deleted file mode 100644 index 9811f18bd6f..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php +++ /dev/null @@ -1,380 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createAlertPolicy($name, $alertPolicy); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - try { - $gapicClient->deleteAlertPolicy($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - try { - $gapicClient->getAlertPolicy($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listAlertPolicies($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateAlertPolicy($alertPolicy); - // If the $gapicClient 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/Client/AlertPolicyServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php deleted file mode 100644 index 498d9a5be07..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php +++ /dev/null @@ -1,442 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateAlertPolicyRequest()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - $response = $gapicClient->createAlertPolicy($request); - $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(); - $gapicClient = $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(); - $request = (new CreateAlertPolicyRequest()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - try { - $gapicClient->createAlertPolicy($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new DeleteAlertPolicyRequest()) - ->setName($formattedName); - $gapicClient->deleteAlertPolicy($request); - $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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new DeleteAlertPolicyRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteAlertPolicy($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new GetAlertPolicyRequest()) - ->setName($formattedName); - $response = $gapicClient->getAlertPolicy($request); - $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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new GetAlertPolicyRequest()) - ->setName($formattedName); - try { - $gapicClient->getAlertPolicy($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListAlertPoliciesRequest()) - ->setName($name); - $response = $gapicClient->listAlertPolicies($request); - $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(); - $gapicClient = $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'; - $request = (new ListAlertPoliciesRequest()) - ->setName($name); - try { - $gapicClient->listAlertPolicies($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateAlertPolicyRequest()) - ->setAlertPolicy($alertPolicy); - $response = $gapicClient->updateAlertPolicy($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateAlertPolicyRequest()) - ->setAlertPolicy($alertPolicy); - try { - $gapicClient->updateAlertPolicy($request); - // If the $gapicClient 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 createAlertPolicyAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateAlertPolicyRequest()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - $response = $gapicClient->createAlertPolicyAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php deleted file mode 100644 index 5e7c3024f3a..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php +++ /dev/null @@ -1,541 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateGroupRequest()) - ->setName($name) - ->setGroup($group); - $response = $gapicClient->createGroup($request); - $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(); - $gapicClient = $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(); - $request = (new CreateGroupRequest()) - ->setName($name) - ->setGroup($group); - try { - $gapicClient->createGroup($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new DeleteGroupRequest()) - ->setName($formattedName); - $gapicClient->deleteGroup($request); - $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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new DeleteGroupRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteGroup($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new GetGroupRequest()) - ->setName($formattedName); - $response = $gapicClient->getGroup($request); - $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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new GetGroupRequest()) - ->setName($formattedName); - try { - $gapicClient->getGroup($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new ListGroupMembersRequest()) - ->setName($formattedName); - $response = $gapicClient->listGroupMembers($request); - $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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new ListGroupMembersRequest()) - ->setName($formattedName); - try { - $gapicClient->listGroupMembers($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListGroupsRequest()) - ->setName($name); - $response = $gapicClient->listGroups($request); - $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(); - $gapicClient = $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'; - $request = (new ListGroupsRequest()) - ->setName($name); - try { - $gapicClient->listGroups($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateGroupRequest()) - ->setGroup($group); - $response = $gapicClient->updateGroup($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateGroupRequest()) - ->setGroup($group); - try { - $gapicClient->updateGroup($request); - // If the $gapicClient 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 createGroupAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateGroupRequest()) - ->setName($name) - ->setGroup($group); - $response = $gapicClient->createGroupAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php deleted file mode 100644 index 8a38d03c86b..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php +++ /dev/null @@ -1,769 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateMetricDescriptorRequest()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - $response = $gapicClient->createMetricDescriptor($request); - $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(); - $gapicClient = $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(); - $request = (new CreateMetricDescriptorRequest()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - try { - $gapicClient->createMetricDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - $gapicClient->createServiceTimeSeries($request); - $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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - try { - $gapicClient->createServiceTimeSeries($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - $gapicClient->createTimeSeries($request); - $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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - try { - $gapicClient->createTimeSeries($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new DeleteMetricDescriptorRequest()) - ->setName($formattedName); - $gapicClient->deleteMetricDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new DeleteMetricDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteMetricDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new GetMetricDescriptorRequest()) - ->setName($formattedName); - $response = $gapicClient->getMetricDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new GetMetricDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->getMetricDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - $request = (new GetMonitoredResourceDescriptorRequest()) - ->setName($formattedName); - $response = $gapicClient->getMonitoredResourceDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - $request = (new GetMonitoredResourceDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->getMonitoredResourceDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListMetricDescriptorsRequest()) - ->setName($name); - $response = $gapicClient->listMetricDescriptors($request); - $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(); - $gapicClient = $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'; - $request = (new ListMetricDescriptorsRequest()) - ->setName($name); - try { - $gapicClient->listMetricDescriptors($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListMonitoredResourceDescriptorsRequest()) - ->setName($name); - $response = $gapicClient->listMonitoredResourceDescriptors($request); - $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(); - $gapicClient = $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'; - $request = (new ListMonitoredResourceDescriptorsRequest()) - ->setName($name); - try { - $gapicClient->listMonitoredResourceDescriptors($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - $request = (new ListTimeSeriesRequest()) - ->setName($formattedName) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - $response = $gapicClient->listTimeSeries($request); - $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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - $request = (new ListTimeSeriesRequest()) - ->setName($formattedName) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - try { - $gapicClient->listTimeSeries($request); - // If the $gapicClient 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 createMetricDescriptorAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateMetricDescriptorRequest()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - $response = $gapicClient->createMetricDescriptorAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php deleted file mode 100644 index 7a0e8fd53b0..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php +++ /dev/null @@ -1,809 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateNotificationChannelRequest()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - $response = $gapicClient->createNotificationChannel($request); - $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(); - $gapicClient = $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(); - $request = (new CreateNotificationChannelRequest()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - try { - $gapicClient->createNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new DeleteNotificationChannelRequest()) - ->setName($formattedName); - $gapicClient->deleteNotificationChannel($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new DeleteNotificationChannelRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelRequest()) - ->setName($formattedName); - $response = $gapicClient->getNotificationChannel($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelRequest()) - ->setName($formattedName); - try { - $gapicClient->getNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - $request = (new GetNotificationChannelDescriptorRequest()) - ->setName($formattedName); - $response = $gapicClient->getNotificationChannelDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - $request = (new GetNotificationChannelDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->getNotificationChannelDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $code = 'code3059181'; - $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); - $expectedResponse->setCode($code); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - $response = $gapicClient->getNotificationChannelVerificationCode($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - try { - $gapicClient->getNotificationChannelVerificationCode($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelDescriptorsRequest()) - ->setName($name); - $response = $gapicClient->listNotificationChannelDescriptors($request); - $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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelDescriptorsRequest()) - ->setName($name); - try { - $gapicClient->listNotificationChannelDescriptors($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelsRequest()) - ->setName($name); - $response = $gapicClient->listNotificationChannels($request); - $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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelsRequest()) - ->setName($name); - try { - $gapicClient->listNotificationChannels($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new SendNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - $gapicClient->sendNotificationChannelVerificationCode($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new SendNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - try { - $gapicClient->sendNotificationChannelVerificationCode($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateNotificationChannelRequest()) - ->setNotificationChannel($notificationChannel); - $response = $gapicClient->updateNotificationChannel($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateNotificationChannelRequest()) - ->setNotificationChannel($notificationChannel); - try { - $gapicClient->updateNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - $request = (new VerifyNotificationChannelRequest()) - ->setName($formattedName) - ->setCode($code); - $response = $gapicClient->verifyNotificationChannel($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - $request = (new VerifyNotificationChannelRequest()) - ->setName($formattedName) - ->setCode($code); - try { - $gapicClient->verifyNotificationChannel($request); - // If the $gapicClient 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 createNotificationChannelAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateNotificationChannelRequest()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - $response = $gapicClient->createNotificationChannelAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php deleted file mode 100644 index cd32140b2e9..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php +++ /dev/null @@ -1,182 +0,0 @@ -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(); - $gapicClient = $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'; - $request = (new QueryTimeSeriesRequest()) - ->setName($name) - ->setQuery($query); - $response = $gapicClient->queryTimeSeries($request); - $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(); - $gapicClient = $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'; - $request = (new QueryTimeSeriesRequest()) - ->setName($name) - ->setQuery($query); - try { - $gapicClient->queryTimeSeries($request); - // If the $gapicClient 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 queryTimeSeriesAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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'; - $request = (new QueryTimeSeriesRequest()) - ->setName($name) - ->setQuery($query); - $response = $gapicClient->queryTimeSeriesAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php deleted file mode 100644 index d679066683c..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php +++ /dev/null @@ -1,790 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateServiceRequest()) - ->setParent($parent) - ->setService($service); - $response = $gapicClient->createService($request); - $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(); - $gapicClient = $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(); - $request = (new CreateServiceRequest()) - ->setParent($parent) - ->setService($service); - try { - $gapicClient->createService($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - $request = (new CreateServiceLevelObjectiveRequest()) - ->setParent($formattedParent) - ->setServiceLevelObjective($serviceLevelObjective); - $response = $gapicClient->createServiceLevelObjective($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - $request = (new CreateServiceLevelObjectiveRequest()) - ->setParent($formattedParent) - ->setServiceLevelObjective($serviceLevelObjective); - try { - $gapicClient->createServiceLevelObjective($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - $gapicClient->deleteService($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteService($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new DeleteServiceLevelObjectiveRequest()) - ->setName($formattedName); - $gapicClient->deleteServiceLevelObjective($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new DeleteServiceLevelObjectiveRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteServiceLevelObjective($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->getService($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->getService($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new GetServiceLevelObjectiveRequest()) - ->setName($formattedName); - $response = $gapicClient->getServiceLevelObjective($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new GetServiceLevelObjectiveRequest()) - ->setName($formattedName); - try { - $gapicClient->getServiceLevelObjective($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new ListServiceLevelObjectivesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listServiceLevelObjectives($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new ListServiceLevelObjectivesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listServiceLevelObjectives($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListServicesRequest()) - ->setParent($parent); - $response = $gapicClient->listServices($request); - $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(); - $gapicClient = $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'; - $request = (new ListServicesRequest()) - ->setParent($parent); - try { - $gapicClient->listServices($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateServiceRequest()) - ->setService($service); - $response = $gapicClient->updateService($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateServiceRequest()) - ->setService($service); - try { - $gapicClient->updateService($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateServiceLevelObjectiveRequest()) - ->setServiceLevelObjective($serviceLevelObjective); - $response = $gapicClient->updateServiceLevelObjective($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateServiceLevelObjectiveRequest()) - ->setServiceLevelObjective($serviceLevelObjective); - try { - $gapicClient->updateServiceLevelObjective($request); - // If the $gapicClient 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 createServiceAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateServiceRequest()) - ->setParent($parent) - ->setService($service); - $response = $gapicClient->createServiceAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php deleted file mode 100644 index 5eb2436b612..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php +++ /dev/null @@ -1,426 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SnoozeServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SnoozeServiceClient($options); - } - - /** @test */ - public function createSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - $response = $gapicClient->createSnooze($request); - $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.SnoozeService/CreateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - try { - $gapicClient->createSnooze($request); - // If the $gapicClient 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 getSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - $request = (new GetSnoozeRequest()) - ->setName($formattedName); - $response = $gapicClient->getSnooze($request); - $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.SnoozeService/GetSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - $request = (new GetSnoozeRequest()) - ->setName($formattedName); - try { - $gapicClient->getSnooze($request); - // If the $gapicClient 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 listSnoozesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $snoozesElement = new Snooze(); - $snoozes = [ - $snoozesElement, - ]; - $expectedResponse = new ListSnoozesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSnoozes($snoozes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $request = (new ListSnoozesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listSnoozes($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnoozesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $request = (new ListSnoozesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listSnoozes($request); - // If the $gapicClient 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 updateSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $request = (new UpdateSnoozeRequest()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateSnooze($request); - $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.SnoozeService/UpdateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $request = (new UpdateSnoozeRequest()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateSnooze($request); - // If the $gapicClient 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 createSnoozeAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - $response = $gapicClient->createSnoozeAsync($request)->wait(); - $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.SnoozeService/CreateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php deleted file mode 100644 index 8b1fc5ae653..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php +++ /dev/null @@ -1,517 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateUptimeCheckConfigRequest()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - $response = $gapicClient->createUptimeCheckConfig($request); - $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(); - $gapicClient = $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(); - $request = (new CreateUptimeCheckConfigRequest()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - try { - $gapicClient->createUptimeCheckConfig($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new DeleteUptimeCheckConfigRequest()) - ->setName($formattedName); - $gapicClient->deleteUptimeCheckConfig($request); - $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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new DeleteUptimeCheckConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteUptimeCheckConfig($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new GetUptimeCheckConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getUptimeCheckConfig($request); - $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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new GetUptimeCheckConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getUptimeCheckConfig($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListUptimeCheckConfigsRequest()) - ->setParent($parent); - $response = $gapicClient->listUptimeCheckConfigs($request); - $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(); - $gapicClient = $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'; - $request = (new ListUptimeCheckConfigsRequest()) - ->setParent($parent); - try { - $gapicClient->listUptimeCheckConfigs($request); - // If the $gapicClient 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(); - $gapicClient = $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); - $request = new ListUptimeCheckIpsRequest(); - $response = $gapicClient->listUptimeCheckIps($request); - $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(); - $gapicClient = $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); - $request = new ListUptimeCheckIpsRequest(); - try { - $gapicClient->listUptimeCheckIps($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateUptimeCheckConfigRequest()) - ->setUptimeCheckConfig($uptimeCheckConfig); - $response = $gapicClient->updateUptimeCheckConfig($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateUptimeCheckConfigRequest()) - ->setUptimeCheckConfig($uptimeCheckConfig); - try { - $gapicClient->updateUptimeCheckConfig($request); - // If the $gapicClient 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 createUptimeCheckConfigAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateUptimeCheckConfigRequest()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - $response = $gapicClient->createUptimeCheckConfigAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php deleted file mode 100644 index 6ac70404aed..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php +++ /dev/null @@ -1,468 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createGroup($name, $group); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - try { - $gapicClient->deleteGroup($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - try { - $gapicClient->getGroup($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - try { - $gapicClient->listGroupMembers($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listGroups($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateGroup($group); - // If the $gapicClient 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 deleted file mode 100644 index 443a3f9faf1..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php +++ /dev/null @@ -1,672 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createMetricDescriptor($name, $metricDescriptor); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - try { - $gapicClient->createServiceTimeSeries($formattedName, $timeSeries); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - try { - $gapicClient->createTimeSeries($formattedName, $timeSeries); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - try { - $gapicClient->deleteMetricDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - try { - $gapicClient->getMetricDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - try { - $gapicClient->getMonitoredResourceDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listMetricDescriptors($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listMonitoredResourceDescriptors($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - try { - $gapicClient->listTimeSeries($formattedName, $filter, $interval, $view); - // If the $gapicClient 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 deleted file mode 100644 index 9b115e17697..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php +++ /dev/null @@ -1,716 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createNotificationChannel($name, $notificationChannel); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->deleteNotificationChannel($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->getNotificationChannel($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - try { - $gapicClient->getNotificationChannelDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $code = 'code3059181'; - $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); - $expectedResponse->setCode($code); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->getNotificationChannelVerificationCode($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listNotificationChannelDescriptors($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listNotificationChannels($name); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->sendNotificationChannelVerificationCode($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateNotificationChannel($notificationChannel); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - try { - $gapicClient->verifyNotificationChannel($formattedName, $code); - // If the $gapicClient 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 deleted file mode 100644 index c64caa89013..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php +++ /dev/null @@ -1,134 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->queryTimeSeries($name, $query); - // If the $gapicClient 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 deleted file mode 100644 index 7651f7245bc..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php +++ /dev/null @@ -1,701 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createService($parent, $service); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - try { - $gapicClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - try { - $gapicClient->deleteService($formattedName); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - try { - $gapicClient->deleteServiceLevelObjective($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - try { - $gapicClient->getService($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - try { - $gapicClient->getServiceLevelObjective($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - try { - $gapicClient->listServiceLevelObjectives($formattedParent); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listServices($parent); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateService($service); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateServiceLevelObjective($serviceLevelObjective); - // If the $gapicClient 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/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php deleted file mode 100644 index 653db774900..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php +++ /dev/null @@ -1,359 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SnoozeServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SnoozeServiceClient($options); - } - - /** @test */ - public function createSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $response = $gapicClient->createSnooze($formattedParent, $snooze); - $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.SnoozeService/CreateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - try { - $gapicClient->createSnooze($formattedParent, $snooze); - // If the $gapicClient 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 getSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - $response = $gapicClient->getSnooze($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.SnoozeService/GetSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - try { - $gapicClient->getSnooze($formattedName); - // If the $gapicClient 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 listSnoozesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $snoozesElement = new Snooze(); - $snoozes = [ - $snoozesElement, - ]; - $expectedResponse = new ListSnoozesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSnoozes($snoozes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $response = $gapicClient->listSnoozes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnoozesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - try { - $gapicClient->listSnoozes($formattedParent); - // If the $gapicClient 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 updateSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $response = $gapicClient->updateSnooze($snooze, $updateMask); - $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.SnoozeService/UpdateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - try { - $gapicClient->updateSnooze($snooze, $updateMask); - // If the $gapicClient 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 deleted file mode 100644 index 40d14acd439..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php +++ /dev/null @@ -1,450 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createUptimeCheckConfig($parent, $uptimeCheckConfig); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $gapicClient->deleteUptimeCheckConfig($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $gapicClient->getUptimeCheckConfig($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listUptimeCheckConfigs($parent); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listUptimeCheckIps(); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateUptimeCheckConfig($uptimeCheckConfig); - // If the $gapicClient 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()); - } -} From a9b815e0b676a9e044760a552d3136e3501ae9f1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 12 Apr 2024 23:57:42 +0000 Subject: [PATCH 3/4] fix!: mark parent/name fields with the REQUIRED field_behavior annotation docs: updated comments PiperOrigin-RevId: 624277410 Source-Link: https://github.com/googleapis/googleapis/commit/2d881be8c566e4c374061248dd205efd72b7ef4f Source-Link: https://github.com/googleapis/googleapis-gen/commit/1d063f9353aeffb9a968f1a00f1d105b0c14a42d Copy-Tag: eyJwIjoiTW9uaXRvcmluZy8uT3dsQm90LnlhbWwiLCJoIjoiMWQwNjNmOTM1M2FlZmZiOWE5NjhmMWEwMGYxZDEwNWIwYzE0YTQyZCJ9 --- .../Google/Monitoring/V3/Alert.php | Bin 0 -> 5915 bytes .../Google/Monitoring/V3/AlertService.php | 64 + .../Google/Monitoring/V3/Common.php | Bin 0 -> 2532 bytes .../Google/Monitoring/V3/DroppedLabels.php | 33 + .../Google/Monitoring/V3/Group.php | 37 + .../Google/Monitoring/V3/GroupService.php | Bin 0 -> 3723 bytes .../Google/Monitoring/V3/Metric.php | Bin 0 -> 2648 bytes .../Google/Monitoring/V3/MetricService.php | Bin 0 -> 7118 bytes .../Google/Monitoring/V3/MutationRecord.php | 32 + .../Google/Monitoring/V3/Notification.php | Bin 0 -> 2855 bytes .../Monitoring/V3/NotificationService.php | 97 ++ .../Google/Monitoring/V3/QueryService.php | 32 + .../Google/Monitoring/V3/Service.php | Bin 0 -> 4653 bytes .../Google/Monitoring/V3/ServiceService.php | 95 ++ .../Google/Monitoring/V3/Snooze.php | 39 + .../Google/Monitoring/V3/SnoozeService.php | 56 + .../Google/Monitoring/V3/SpanContext.php | 29 + .../Google/Monitoring/V3/Uptime.php | Bin 0 -> 5190 bytes .../Google/Monitoring/V3/UptimeService.php | 72 + .../Cloud/Monitoring/V3/Aggregation.php | 389 ++++++ .../Monitoring/V3/Aggregation/Aligner.php | 269 ++++ .../Monitoring/V3/Aggregation/Reducer.php | 191 +++ .../Cloud/Monitoring/V3/AlertPolicy.php | 805 +++++++++++ .../V3/AlertPolicy/AlertStrategy.php | 167 +++ .../NotificationChannelStrategy.php | 139 ++ .../AlertStrategy/NotificationRateLimit.php | 81 ++ .../Monitoring/V3/AlertPolicy/Condition.php | 373 ++++++ .../Condition/EvaluationMissingData.php | 76 ++ .../V3/AlertPolicy/Condition/LogMatch.php | 151 +++ .../AlertPolicy/Condition/MetricAbsence.php | 304 +++++ .../AlertPolicy/Condition/MetricThreshold.php | 635 +++++++++ .../MetricThreshold/ForecastOptions.php | 101 ++ .../MonitoringQueryLanguageCondition.php | 257 ++++ .../PrometheusQueryLanguageCondition.php | 433 ++++++ .../V3/AlertPolicy/Condition/Trigger.php | 118 ++ .../V3/AlertPolicy/ConditionCombinerType.php | 81 ++ .../V3/AlertPolicy/Documentation.php | 207 +++ .../Monitoring/V3/AlertPolicy/Severity.php | 75 ++ .../Google/Cloud/Monitoring/V3/BasicSli.php | 269 ++++ .../V3/BasicSli/AvailabilityCriteria.php | 36 + .../V3/BasicSli/LatencyCriteria.php | 84 ++ .../Cloud/Monitoring/V3/ComparisonType.php | 90 ++ .../V3/CreateAlertPolicyRequest.php | 188 +++ .../Monitoring/V3/CreateGroupRequest.php | 181 +++ .../V3/CreateMetricDescriptorRequest.php | 151 +++ .../V3/CreateNotificationChannelRequest.php | 163 +++ .../V3/CreateServiceLevelObjectiveRequest.php | 185 +++ .../Monitoring/V3/CreateServiceRequest.php | 180 +++ .../Monitoring/V3/CreateSnoozeRequest.php | 149 +++ .../Monitoring/V3/CreateTimeSeriesError.php | 135 ++ .../Monitoring/V3/CreateTimeSeriesRequest.php | 159 +++ .../Monitoring/V3/CreateTimeSeriesSummary.php | 135 ++ .../V3/CreateTimeSeriesSummary/Error.php | 114 ++ .../V3/CreateUptimeCheckConfigRequest.php | 142 ++ .../V3/DeleteAlertPolicyRequest.php | 93 ++ .../Monitoring/V3/DeleteGroupRequest.php | 130 ++ .../V3/DeleteMetricDescriptorRequest.php | 103 ++ .../V3/DeleteNotificationChannelRequest.php | 138 ++ .../V3/DeleteServiceLevelObjectiveRequest.php | 92 ++ .../Monitoring/V3/DeleteServiceRequest.php | 87 ++ .../V3/DeleteUptimeCheckConfigRequest.php | 87 ++ .../Cloud/Monitoring/V3/DistributionCut.php | 127 ++ .../Cloud/Monitoring/V3/DroppedLabels.php | 80 ++ .../Monitoring/V3/GetAlertPolicyRequest.php | 87 ++ .../Cloud/Monitoring/V3/GetGroupRequest.php | 87 ++ .../V3/GetMetricDescriptorRequest.php | 103 ++ .../GetMonitoredResourceDescriptorRequest.php | 98 ++ ...etNotificationChannelDescriptorRequest.php | 87 ++ .../V3/GetNotificationChannelRequest.php | 87 ++ ...ficationChannelVerificationCodeRequest.php | 167 +++ ...icationChannelVerificationCodeResponse.php | 131 ++ .../V3/GetServiceLevelObjectiveRequest.php | 138 ++ .../Cloud/Monitoring/V3/GetServiceRequest.php | 87 ++ .../Cloud/Monitoring/V3/GetSnoozeRequest.php | 88 ++ .../V3/GetUptimeCheckConfigRequest.php | 87 ++ .../src/Google/Cloud/Monitoring/V3/Group.php | 257 ++++ .../Cloud/Monitoring/V3/GroupResourceType.php | 66 + .../Cloud/Monitoring/V3/InternalChecker.php | 271 ++++ .../Monitoring/V3/InternalChecker/State.php | 74 ++ .../Google/Cloud/Monitoring/V3/LabelValue.php | 141 ++ .../V3/ListAlertPoliciesRequest.php | 294 ++++ .../V3/ListAlertPoliciesResponse.php | 147 ++ .../Monitoring/V3/ListGroupMembersRequest.php | 277 ++++ .../V3/ListGroupMembersResponse.php | 143 ++ .../Cloud/Monitoring/V3/ListGroupsRequest.php | 316 +++++ .../Monitoring/V3/ListGroupsResponse.php | 109 ++ .../V3/ListMetricDescriptorsRequest.php | 238 ++++ .../V3/ListMetricDescriptorsResponse.php | 113 ++ ...istMonitoredResourceDescriptorsRequest.php | 222 ++++ ...stMonitoredResourceDescriptorsResponse.php | 113 ++ ...tNotificationChannelDescriptorsRequest.php | 206 +++ ...NotificationChannelDescriptorsResponse.php | 117 ++ .../V3/ListNotificationChannelsRequest.php | 307 +++++ .../V3/ListNotificationChannelsResponse.php | 151 +++ .../V3/ListServiceLevelObjectivesRequest.php | 257 ++++ .../V3/ListServiceLevelObjectivesResponse.php | 109 ++ .../Monitoring/V3/ListServicesRequest.php | 275 ++++ .../Monitoring/V3/ListServicesResponse.php | 109 ++ .../Monitoring/V3/ListSnoozesRequest.php | 252 ++++ .../Monitoring/V3/ListSnoozesResponse.php | 106 ++ .../Monitoring/V3/ListTimeSeriesRequest.php | 501 +++++++ .../ListTimeSeriesRequest/TimeSeriesView.php | 59 + .../Monitoring/V3/ListTimeSeriesResponse.php | 201 +++ .../V3/ListUptimeCheckConfigsRequest.php | 230 ++++ .../V3/ListUptimeCheckConfigsResponse.php | 155 +++ .../V3/ListUptimeCheckIpsRequest.php | 129 ++ .../V3/ListUptimeCheckIpsResponse.php | 125 ++ .../Cloud/Monitoring/V3/MutationRecord.php | 111 ++ .../Monitoring/V3/NotificationChannel.php | 594 +++++++++ .../VerificationStatus.php | 76 ++ .../V3/NotificationChannelDescriptor.php | 326 +++++ .../src/Google/Cloud/Monitoring/V3/Point.php | 153 +++ .../Google/Cloud/Monitoring/V3/QueryError.php | 115 ++ .../Cloud/Monitoring/V3/QueryErrorList.php | 105 ++ .../Monitoring/V3/QueryTimeSeriesRequest.php | 197 +++ .../Monitoring/V3/QueryTimeSeriesResponse.php | 195 +++ .../src/Google/Cloud/Monitoring/V3/Range.php | 101 ++ .../Cloud/Monitoring/V3/RequestBasedSli.php | 121 ++ ...ficationChannelVerificationCodeRequest.php | 81 ++ .../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 + .../Cloud/Monitoring/V3/ServiceTier.php | 74 ++ .../src/Google/Cloud/Monitoring/V3/Snooze.php | 224 ++++ .../Cloud/Monitoring/V3/Snooze/Criteria.php | 88 ++ .../Cloud/Monitoring/V3/SpanContext.php | 91 ++ .../Cloud/Monitoring/V3/TextLocator.php | 303 +++++ .../Monitoring/V3/TextLocator/Position.php | 108 ++ .../Cloud/Monitoring/V3/TimeInterval.php | 165 +++ .../Google/Cloud/Monitoring/V3/TimeSeries.php | 404 ++++++ .../Cloud/Monitoring/V3/TimeSeriesData.php | 114 ++ .../V3/TimeSeriesData/PointData.php | 116 ++ .../Monitoring/V3/TimeSeriesDescriptor.php | 101 ++ .../TimeSeriesDescriptor/ValueDescriptor.php | 184 +++ .../Cloud/Monitoring/V3/TimeSeriesRatio.php | 180 +++ .../Google/Cloud/Monitoring/V3/TypedValue.php | 213 +++ .../V3/UpdateAlertPolicyRequest.php | 239 ++++ .../Monitoring/V3/UpdateGroupRequest.php | 134 ++ .../V3/UpdateNotificationChannelRequest.php | 151 +++ .../V3/UpdateServiceLevelObjectiveRequest.php | 139 ++ .../Monitoring/V3/UpdateServiceRequest.php | 139 ++ .../Monitoring/V3/UpdateSnoozeRequest.php | 227 ++++ .../V3/UpdateUptimeCheckConfigRequest.php | 192 +++ .../Cloud/Monitoring/V3/UptimeCheckConfig.php | 711 ++++++++++ .../V3/UptimeCheckConfig/CheckerType.php | 69 + .../V3/UptimeCheckConfig/ContentMatcher.php | 158 +++ .../ContentMatcher/ContentMatcherOption.php | 107 ++ .../ContentMatcher/JsonPathMatcher.php | 114 ++ .../JsonPathMatcher/JsonPathMatcherOption.php | 68 + .../V3/UptimeCheckConfig/HttpCheck.php | 678 ++++++++++ .../HttpCheck/BasicAuthentication.php | 107 ++ .../HttpCheck/ContentType.php | 67 + .../HttpCheck/RequestMethod.php | 64 + .../HttpCheck/ResponseStatusCode.php | 112 ++ .../ResponseStatusCode/StatusClass.php | 92 ++ .../V3/UptimeCheckConfig/PingConfig.php | 72 + .../V3/UptimeCheckConfig/ResourceGroup.php | 113 ++ .../V3/UptimeCheckConfig/TcpCheck.php | 122 ++ .../Cloud/Monitoring/V3/UptimeCheckIp.php | 160 +++ .../Cloud/Monitoring/V3/UptimeCheckRegion.php | 102 ++ .../V3/VerifyNotificationChannelRequest.php | 147 ++ .../Cloud/Monitoring/V3/WindowsBasedSli.php | 236 ++++ .../V3/WindowsBasedSli/MetricRange.php | 125 ++ .../WindowsBasedSli/PerformanceThreshold.php | 146 ++ .../create_alert_policy.php | 88 ++ .../delete_alert_policy.php | 77 ++ .../get_alert_policy.php | 73 + .../list_alert_policies.php | 85 ++ .../update_alert_policy.php | 66 + .../V3/GroupServiceClient/create_group.php | 76 ++ .../V3/GroupServiceClient/delete_group.php | 71 + .../V3/GroupServiceClient/get_group.php | 73 + .../GroupServiceClient/list_group_members.php | 78 ++ .../V3/GroupServiceClient/list_groups.php | 79 ++ .../V3/GroupServiceClient/update_group.php | 60 + .../create_metric_descriptor.php | 81 ++ .../create_service_time_series.php | 84 ++ .../create_time_series.php | 82 ++ .../delete_metric_descriptor.php | 77 ++ .../get_metric_descriptor.php | 77 ++ .../get_monitored_resource_descriptor.php | 79 ++ .../list_metric_descriptors.php | 79 ++ .../list_monitored_resource_descriptors.php | 79 ++ .../MetricServiceClient/list_time_series.php | 99 ++ .../create_notification_channel.php | 87 ++ .../delete_notification_channel.php | 79 ++ .../get_notification_channel.php | 80 ++ .../get_notification_channel_descriptor.php | 77 ++ ...notification_channel_verification_code.php | 96 ++ .../list_notification_channel_descriptors.php | 86 ++ .../list_notification_channels.php | 88 ++ ...notification_channel_verification_code.php | 73 + .../update_notification_channel.php | 65 + .../verify_notification_channel.php | 85 ++ .../QueryServiceClient/query_time_series.php | 84 ++ .../create_service.php | 76 ++ .../create_service_level_objective.php | 75 ++ .../delete_service.php | 71 + .../delete_service_level_objective.php | 76 ++ .../get_service.php | 73 + .../get_service_level_objective.php | 78 ++ .../list_service_level_objectives.php | 80 ++ .../list_services.php | 80 ++ .../update_service.php | 59 + .../update_service_level_objective.php | 59 + .../V3/SnoozeServiceClient/create_snooze.php | 99 ++ .../V3/SnoozeServiceClient/get_snooze.php | 73 + .../V3/SnoozeServiceClient/list_snoozes.php | 81 ++ .../V3/SnoozeServiceClient/update_snooze.php | 90 ++ .../create_uptime_check_config.php | 76 ++ .../delete_uptime_check_config.php | 76 ++ .../get_uptime_check_config.php | 76 ++ .../list_uptime_check_configs.php | 80 ++ .../list_uptime_check_ips.php | 62 + .../update_uptime_check_config.php | 62 + .../v3/src/V3/AlertPolicyServiceClient.php | 34 + .../V3/Client/AlertPolicyServiceClient.php | 507 +++++++ .../v3/src/V3/Client/GroupServiceClient.php | 444 +++++++ .../v3/src/V3/Client/MetricServiceClient.php | 675 ++++++++++ .../NotificationChannelServiceClient.php | 679 ++++++++++ .../v3/src/V3/Client/QueryServiceClient.php | 193 +++ .../Client/ServiceMonitoringServiceClient.php | 635 +++++++++ .../v3/src/V3/Client/SnoozeServiceClient.php | 434 ++++++ .../V3/Client/UptimeCheckServiceClient.php | 451 +++++++ .../Gapic/AlertPolicyServiceGapicClient.php | 806 +++++++++++ .../src/V3/Gapic/GroupServiceGapicClient.php | 752 +++++++++++ .../src/V3/Gapic/MetricServiceGapicClient.php | 1178 +++++++++++++++++ .../NotificationChannelServiceGapicClient.php | 1075 +++++++++++++++ .../src/V3/Gapic/QueryServiceGapicClient.php | 256 ++++ .../ServiceMonitoringServiceGapicClient.php | 1044 +++++++++++++++ .../src/V3/Gapic/SnoozeServiceGapicClient.php | 680 ++++++++++ .../Gapic/UptimeCheckServiceGapicClient.php | 692 ++++++++++ .../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/SnoozeServiceClient.php | 34 + .../v3/src/V3/UptimeCheckServiceClient.php | 34 + .../Monitoring/v3/src/V3/gapic_metadata.json | 336 +++++ .../alert_policy_service_client_config.json | 69 + ...alert_policy_service_descriptor_config.php | 107 ++ ...lert_policy_service_rest_client_config.php | 87 ++ .../group_service_client_config.json | 86 ++ .../group_service_descriptor_config.php | 123 ++ .../group_service_rest_client_config.php | 98 ++ .../metric_service_client_config.json | 101 ++ .../metric_service_descriptor_config.php | 174 +++ .../metric_service_rest_client_config.php | 156 +++ ...ication_channel_service_client_config.json | 94 ++ ...tion_channel_service_descriptor_config.php | 175 +++ ...ion_channel_service_rest_client_config.php | 145 ++ .../query_service_client_config.json | 27 + .../query_service_descriptor_config.php | 48 + .../query_service_rest_client_config.php | 41 + ...vice_monitoring_service_client_config.json | 94 ++ ...e_monitoring_service_descriptor_config.php | 176 +++ ..._monitoring_service_rest_client_config.php | 145 ++ .../snooze_service_client_config.json | 64 + .../snooze_service_descriptor_config.php | 94 ++ .../snooze_service_rest_client_config.php | 79 ++ .../uptime_check_service_client_config.json | 74 ++ ...uptime_check_service_descriptor_config.php | 115 ++ ...ptime_check_service_rest_client_config.php | 91 ++ .../Unit/V3/AlertPolicyServiceClientTest.php | 380 ++++++ .../Client/AlertPolicyServiceClientTest.php | 442 +++++++ .../Unit/V3/Client/GroupServiceClientTest.php | 541 ++++++++ .../V3/Client/MetricServiceClientTest.php | 769 +++++++++++ .../NotificationChannelServiceClientTest.php | 809 +++++++++++ .../Unit/V3/Client/QueryServiceClientTest.php | 182 +++ .../ServiceMonitoringServiceClientTest.php | 790 +++++++++++ .../V3/Client/SnoozeServiceClientTest.php | 426 ++++++ .../Client/UptimeCheckServiceClientTest.php | 517 ++++++++ .../tests/Unit/V3/GroupServiceClientTest.php | 468 +++++++ .../tests/Unit/V3/MetricServiceClientTest.php | 672 ++++++++++ .../NotificationChannelServiceClientTest.php | 716 ++++++++++ .../tests/Unit/V3/QueryServiceClientTest.php | 134 ++ .../V3/ServiceMonitoringServiceClientTest.php | 701 ++++++++++ .../tests/Unit/V3/SnoozeServiceClientTest.php | 359 +++++ .../Unit/V3/UptimeCheckServiceClientTest.php | 450 +++++++ 288 files changed, 53046 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/Snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.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/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/NotificationChannelStrategy.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/EvaluationMissingData.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/MetricThreshold/ForecastOptions.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/PrometheusQueryLanguageCondition.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/AlertPolicy/Severity.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/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/CreateSnoozeRequest.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/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/GetSnoozeRequest.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/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/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/ListSnoozesRequest.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.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/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/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/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/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/ServiceTier.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.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/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/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/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/UpdateSnoozeRequest.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/CheckerType.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/ContentMatcher/JsonPathMatcher.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.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/HttpCheck/ResponseStatusCode.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php create mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.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/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/samples/V3/AlertPolicyServiceClient/create_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php create mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/AlertPolicyServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.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/SnoozeServiceGapicClient.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/SnoozeServiceClient.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/snooze_service_client_config.json create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php create mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_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/Client/AlertPolicyServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php create mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.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/SnoozeServiceClientTest.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..611022bae32b07a433dbc0ce39a6519f97b2cf48 GIT binary patch literal 5915 zcmcgwO>-Mb8II)m>y^LKw(+c}q$W-vPIe=)^1|-Qge_T;9kI4#WZ7Z2R5djkwd8@( z%rGBb6qoPZse&6nfGYk0R}OI6+g>?v%AMlM+ubvxkt0P`iXxZD)BQgE@jlPfZ}(5X zurF+QBp*_fI;uz8a;qZxtjQ=5l8u6Z2A zHP3hV05n5&UAe&G;R`>2l%soDD25=qyYL3{af~_|XbZWHs>4kc! zTTVVdSk(YzTxgvJ`MPz~P-2=ztA`oB{g}hi$39D*W!9-?Iqln{L@6ox$WjD&kI+|+ zYTMLtZy#E>wdN^K*dG(aiSzttdO(vxyB)FO0JX9c<&kCe3Ho>scqrpiou%;Yi(~ToEDY@@!<6UXTmL;mHX4J_!19$)X6d?O?~pwSNw8O~*1_X^F#pI2ooG#*hjuU}jo6nyoa4Ygx&CIz>2YkB2t;HYFdzJT=vp zLEF+jzANbvDNJ2vAFb(JHGE1Q!@?!{B+k4q5#F1Gy)jW4L2_~*HciXZJG#a-rf3(c zX|fGl!IdtO7qF^1R5S_BNWifkhgd_T%?yj3h2Nl@l$s*^5LWnMqPQMAsJeY=lSkiz z44fFJK^Q5(f=e%{!}j8P2(glTHhTVXKAi>;`!oM6B+?aF9wyi-%p);8sM6sq!}D`Q9%7?6BY;j2t~2PI=m$c#+XI&HLOP@RJ;qcgA2=O z^KnzTy~#_7M$6z4?C4q}gm`&}oWa@vTWz^)L2UM^+~?B+7g)STIqc>Dwx@d91#K&a z)s;3l_9xR|A6eaFhJdhF@F)fw8K&|ZpE`XMyV>>CE|u2#AV<>-GB~w*xj+I)bK*l}Yj`EUDeDL%Uq68XT2cb!MNZrzNb$Cz0pPX+P+03&=sv3JDV7}?F=ObLV`j%HNO9(5qWs;Ye&!&+ ztO-c+8FTuctvb4EnbKXH|4MF*&7ms?{kSi0!D=K*1x?qd(kzB2(6AT6vy^*(D)&J+ zm; zPhexzcanmcU(E9(mp5%rEHo&9 znB>ib3~hy=>yKi}pTs&Aksy1p9uqFVU|?c+-7rZ+3DSc(&LX7YbbzA5}Z3GwTRxUk^$&CTGsl8xDR$7rfi$Bw$m9snFCveZfdJZpzeSB@hDv{aHBo9k}468S<&J)g=Z51{nB@Eqj zw_v?kJKnEU%QqxF4>N^o2~|4>$y$9aNghBNKPay%jhD)Cp;3Ivyr5n_t)112<+YjZ zpTk0UjUy6loR-ha^-ANb8?Z~TP{hxbV&Mp}7h$$suXFem%)ctss|bn`|9j$1;cp4} zL97}ZFL9EcQrYD5xMopy@ju@!KJt7jtr8R^u0ujo8Y!)P;FQHv!Lv>hUl&j@emm^R zoUCibUwqNv@X_}&7yD+n_6D0|xBi?=AMyv^Op!wkYKzSI?mxoDW|OxzEgy-|;yRA9gXwTYx61}{AB;H$N&$DBnW_eHXfO-wr0RIIC{HG)U 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..8dcca57c07d --- /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ÚAname‚Óä“%#/v3/{name=projects/*}/alertPolicies– +GetAlertPolicy+.google.monitoring.v3.GetAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"4ÚAname‚Óä“\'%/v3/{name=projects/*/alertPolicies/*}µ +CreateAlertPolicy..google.monitoring.v3.CreateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"MÚAname,alert_policy‚Óä“3"#/v3/{name=projects/*}/alertPolicies: alert_policy‘ +DeleteAlertPolicy..google.monitoring.v3.DeleteAlertPolicyRequest.google.protobuf.Empty"4ÚAname‚Óä“\'*%/v3/{name=projects/*/alertPolicies/*}Ë +UpdateAlertPolicy..google.monitoring.v3.UpdateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"cÚAupdate_mask,alert_policy‚Óä“B22/v3/{alert_policy.name=projects/*/alertPolicies/*}: 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.v3BAlertServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..2164fb3c8760677a8795493e23bb7537bf54f102 GIT binary patch literal 2532 zcmbVO*>2lL6tyI;BQG@LB&yM6;s%Huq;z1_0YcX;XlX1HkSLX+g`f~XP~=D!)pUy6{qrsjG(!utQ9Cvqb!Ud7VdE4b-O_v?H)99rCxqe8 z4ab(LV?WRW_<3&nstLhN%`$(4%+K&dvwRAs4|OM@tp}!K$HA|6Q7apbJu}N z&v2GXKPnyyABlEAJzKLzE$Zu@=|W+BQ04h44Q7-@Nc}Jk8@V$lxSr(5^AD0d!+{sl zVswl>8ibyG8s{B3xSRbqT0oTGnxmHK2c9_&qnda=FDm!3$Z}R!D}-kMKU2ko9tPUA zyEtr2L2{JhN{AJ>d|RD zCu{>TaLcClHMIlPrJm^+F+vfg_xWW z1*9I^Mti#F_N%mSj&Ie8NiD;#t>8+1r>MP7 zi^$9}yM;Cqv@1#sDjbD(Of`4iC4$6k=CPZ-D@kFta{a+om)T|+w3&DtD6JM5GCO(H z*g{q0E5a~&iV1olbOwZ}0UwVN^9xyMDq>Gc^mlVXpU6!jDPo7HZ{ITPV!;XXXrbWb zHM6%+@cM*#%+}Ce5w&7FhYM$vkcJ!#R`{+rt*X;|kIDpPxNrOIViWeej!B7JU z1zB5xvAzdIlRXc06kzinL=r*^zR35?$~`T(MyoG1R2@+7#?+}|!kzvU)doZ!iqKd^ zB=WuVfaf{sxiAo$kRvcNhxcXD6``x;{c^2z{znPbVBc8yu$)(uMI!zJ_Deqqy5)pM zrV3U^Q>VDPz)K9<%gu2CbH}IoTjh>Fl=s{5;=(m!SNZzF4I6)E!qF&}j*8n2tT%s^ sKTC{xK9=)*ZqD<=#&|V;!y7MVpUYRt+ECasKDuGVn#m$?hwc#i8&pH#s{jB1 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..f7e45d86002 --- /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.v3BDroppedLabelsProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..999b703bd1a --- /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 +GroupProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..a03455b22eaefbdb97cd6bc07b10a02c337b4ce1 GIT binary patch literal 3723 zcmb_fL2nyH6vj@IIuoE|)DqXF?Zi!q8-E@PSnn>o zV~0?M12+UhLcQ=4fd9Z9Rh;0K69-QG1Wvq}on5aTJGLcqakTT^oA15%y>DjTe%EVx z=nkn+hx!Jiby7PatVN0EyUaCRo76gu2K9;Qwmr+HzCy_EK6!utkUZFZe7Fp*f!py- zs*sLyN<8*DRCt^Z!Z7G5BJk&RYPMyPfEf&aR;-|E!OoUpTVFyN+oWOG0fhkP zZ5tiOWR~j??y&Eev~Z7vF}dxE=R(@sBm#86D*;u|A3Kctj$!M&G%$V3gDelgR8^al z#r5M~3isr;Je<`ag%G2vo&&i}nBSqv-3jq2>-f%=z|8}k#{cO<%B6Xht~rj&tKd3; zs`hf~g&5_yV_Vc=)A>BKs9i79meI9be>zv$T3UZXC26KYJH1yQm-HRC4dk30a=*7= z;N;FRYoKQj+8#R@?kdQ(@s1^_rPb>(lODpj72@7=Caj`wuc5-EbB3>mmI@>-CsOH_ za!blio-i6%T9!*aJX|3_Sm1;7 zzCc8z#SIxmNC`}3k@Dh(i}~NuXz@KOV4_#S6Z(0F1`OXvm$>3&FOyVZzO1kQrKSJX zmhtT#4kZi zjG3uo?4ql65FF~%4TmM7T$(D%BAWM%Cangbj@emooy8a-@rk*gQ71bm!e!80!?Ho= z@*g3bEM?$Tv($h-1wFkqx3k?i_fU7F<;%jADep{2O{d$e7n{+MwZ z+bX_IkAWQHAOl6S@XHYc1xx4gnqY3Xv*^&$;}DAHEeUaH=w}Zr_e%TVDX476DAX(cZ*Zof?Alu6AciSH+QRKTxa%%h^5;M~ut=i2oI zqW+Wo5AB;&i!m=yi^b#PV+kof=Zy|)!6nG;)HgiaU=7!Aua7hD?KOp|0!LK6{Cf&z z;d(K&Fy+OhYKYt8LF!{ofQuaX)uibrUs#X{%zAe-@y)Ak^&on+U(&gXcvvYrJkLnp z;CZGTm7Yh7x-M4rU;czDug=QK>d3cvf1Cuc_LQ7pZ)U!4W_IWPH^IvQZjeLjQEo-l zA)_-Ay`&`Ie&pM}OGfc{OgXXrX~0~{bwUn~$q&Z^^6=pCU>l*KA9I@;Wa9f1m$s+A z$0DCIZ_+;Pwx=}W%+{qh0MDAzFtBV&4*R_$8d;7NS>~YxnnyFBdD7hluw5$*30k28 z_!$U(f_UUIn}m@S;nz(T4jBexmdk#^%=gIHazl#Hw{6FIOVXtXh%0$oFQ9tcAK1zUAz~)-B zaU=gCB|YQ`Yt_Gv#bI$WFo-f~dQj^7$V9sXWl8ANa_a?BXjMB+eNjsKfK91vGqlv& zP{Oa6){7ECmO#z|>YNC>=HEpC;o&*ujD}hh*44x%F}2hI64q4%V2pCgD+zOb&MIY} zmR$P^%IH+iYJEfIb?cn~j3bS;`%qQc3|}$Nsjnfn)-iYHz;e8^=}MCP9_=*)K#DPp zkZ=96M1S&5u+(IL*4k&V9*8=G^%7Y_@jp&+bN!&JT5ZDR7>|W|8ADW>e-&XXlQc_B zy9-xcF?K^|b{K@H^PGF3vz*Nw?nk&PbD6`bw2Z}REefwoa+%x4Zw0vW#xt!7Yp>{; zEPmw;{X|FAI;-mUKTDS?DvDNV{!)ZmjuM{vsO6^8QdT&XaY?^RK_ykK2asrqUa)#L+7no5nFb`L&?aN_Xl!Mg#m$q=nD-pv;PIWAiO zBfL6>GQO-?`OziqL#U$XyLXbuqHJsU_!?}6coTY)N@!uu*Y3AUGrL|;cwl%aM7Ht>25t%*8*D$QSuP#xq9YOtSKD1~-h8?r2?ZY2BUKefzmuRdSon(yc~XsvYDU&H?@d|07jR literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php new file mode 100644 index 0000000000000000000000000000000000000000..5cd56e066aeefad844fdcf1fcff8a8fcad56221e GIT binary patch literal 7118 zcmb_hOLH7o6{clLk?s&hzK-Rw5|eh@j->H;CN+ZtZdt~yheg1O9ocazVT!3%&z(_| zneL_^Qe>4j>|jL|3t$BcR#YWB3X0+fP$`N9*`&0himbfKItz+(AN`!3k;cIrkNTc- z?m6Fi+^=un{+_ezpeynwv52etq$Teh$o?*o9oP14!|uvELAy;{*|2+#*(Gj8me(K1 zZ$Ee}Z>+!d_%f(^cHkOBl{>cG>5^*CwoKo4O{-Jgt5puK< z)%2Ps>}~2@^C<+fBDeLfN5DeAY&)DgBDK;@kajk0-%O6eWo=Li`RkEw^nYKHcD$nAG zI=mi8YnzBt8!5ukwNeGxShIUj(x-PhtvzbMQK>R{{U4LyY1XG}$)0FuaOm)EqvGrX9UQnjTEb;u&}}fiXht zk#B!Utl~HoQ+^?##gqN@92h$UZ=jb$tedT9K6*t-KC@V;H5P=w6>zvR%-0L(C5wFI zHxu44rxhPv+a$xV%R)y3i=ac#2c7b33BAfNU{#otsJp2|)mWm+xHKeD8B5Qb9T#01 z;F!qBcM;}Qo0E@MQ|ZWhG%yE0M)NcW8TktS<_+p{T5$f!r!Oy0lKZWJCu?0^y%$(0Q8K$7YWJ<1tAz6jV`bh*fr()!OU$ z>fl<7P2h9s8Ni~!x6l+j5cc#g>-j=W2@4}(bgy2ah8X<;Nv`@PD(Ib#OFE2qusKzz zUC!6mVnKWto%e`gTP@u^XeKQbAgEJWm_<{z+ahjr=b$)Ak-%GMe9t8N#TVeOnVOpK zL@uN(Fb?t)u)sr0jmIglnH`VQbXTRZfM#NVsXCrQ)Ngd6P}J>92$j# zslu58{w5j^;Kb&qjPe@^UEtjp?-cg7CQ6U@cAb^p4Rqb;+CeLv`#s%)Q^ghgL?;uF znx7EE$7(v%G3M2Yq4KtSiq2;}+n~Wg1!wT1MRc;!v7&@uN0a<~7Tuo%&??9&pXb2x zDCqT|fbm6i)(7g{Z8|nIQq!;l%ZDV=l6eK4^8&*lo|jsrhuH*PLzAiG)WhVY+b$ck z*tWuApTCPHI0#A<3EetB)#p$l=_7MPX`{J!0^%O@=liV4H#IoT+XABr;3nO8}WcC0Zn`?Jr!_|@3Aag9>$ zL&|PffI!pH;8jaU;mtw(q8I1Y!~c-bw}!JnyqxdlaIG-JQ}a`0JsAuz^1NV%#!@Yn zj__Y3e#U2Mj)!acVX$0fcvr{^<_AoV0XiZpZzcm-!i|NzNFXiQP4Vv~bS{Sl;y3a= z&k+q#AIi6sTS*6jQs?>C?;eBq?{MJe^GG}Zt9RGN1BGG&+tFl9%yo zv0&To0{3JSD;B}OmC$VVu*Ns?!^+BqC=5!>onvj5g-iDnM3F^#O*t`2RVv|6BK{%{ zjmHrP|1THs4|1`tRAT6o(>}&dHP{QE@C_WEKbAh#E+*nAat?uvd z3ydSSsR#Zp+%^F%z2S6qziqp{@=4=C{>6xn!&Wz?4XP#Yw=GYRhac6}kbelPPcLWvJZ^d;3aay}k0N&b=N I2pu8xKQr*R@&Et; 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..cc7e45493f8 --- /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.v3BMutationRecordProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..2c8d7ae84e61c4a16489fdfe927e4f0b27f488c0 GIT binary patch literal 2855 zcmbVO-EQMV6vk<{-JNvX#a#&#RG4-vHQS|*NQ40Q2c>OVD$z7*(yTz1qKPv}2ON(z zwu7=&-h_+2;f4p`ArMc}N8kc+Ja!VNP1&%yif7Ju=J-3`H$Hpcy4NmxflsMJ1@UPM zH~ZMXrq~tS=N7kdGibM|z!vYi%%(!e`1k^sFKW1Sd{$crsK*0gQ3H24@7OfgJTB_sk!FwY#H3WwO{G4(9LTzJU}gc?SN`Xlv91XSHow}SnUy@mhn7APCkqUuUM08`w6c+=v z!bOKT?2YsS#3UczFXM5W+by6kcN6`2zbwl3#vhAlbqWc0^f0NFyXuI9a7P{UQXQp{ zI>J7u^Ir~Im1s$?piikF(vDYhe9>3SC>?lIG-9Pambt!}J=Yb0r559SKcLkf6{8Pb z=wUzbv?o$dd$Z@QCz8PB3^~+SXpuUkY15XLhIHwCW|(ehRs9gYIdx(ORNY4_mY`A= zvAwk=3ECWjCV85?Pt^nT?9T1rX-_3LGvPBkD4k>_jplx){rC!aiXQdC8a3&CBlWeC z`2wxnCGs7Rjn_z>!qE%#S-o_5c5-%9testy8`WB|c2#X$m8+G~5iFOEpM9V%BXm`c z!r)l}MLr%qrHp@++v48}+DY*9ZfmOtvl$v}g4dlq@gO|KvYqFELt`XT0=m1`*nD7`h!am2EblEvF0{+#{|30-&2`W zIrZsBGS&I`+gLCBIovc&xoajzLzoS3Q)>~}Fyy{rjNyh+FEkgVK?+-=ulDEBw3Qgn TLZ32g%3vlVqcLiL1_=ENc~HR9 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..8b1e14a465e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php @@ -0,0 +1,97 @@ +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/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ÚAname‚Óä“64/v3/{name=projects/*}/notificationChannelDescriptorsÝ + GetNotificationChannelDescriptor=.google.monitoring.v3.GetNotificationChannelDescriptorRequest3.google.monitoring.v3.NotificationChannelDescriptor"EÚAname‚Óä“86/v3/{name=projects/*/notificationChannelDescriptors/*}Ä +ListNotificationChannels5.google.monitoring.v3.ListNotificationChannelsRequest6.google.monitoring.v3.ListNotificationChannelsResponse"9ÚAname‚Óä“,*/v3/{name=projects/*}/notificationChannelsµ +GetNotificationChannel3.google.monitoring.v3.GetNotificationChannelRequest).google.monitoring.v3.NotificationChannel";ÚAname‚Óä“.,/v3/{name=projects/*/notificationChannels/*}ä +CreateNotificationChannel6.google.monitoring.v3.CreateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"dÚAname,notification_channel‚Óä“B"*/v3/{name=projects/*}/notificationChannels:notification_channelƒ +UpdateNotificationChannel6.google.monitoring.v3.UpdateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"‚ÚA update_mask,notification_channel‚Óä“Y2A/v3/{notification_channel.name=projects/*/notificationChannels/*}:notification_channel® +DeleteNotificationChannel6.google.monitoring.v3.DeleteNotificationChannelRequest.google.protobuf.Empty"AÚA +name,force‚Óä“.*,/v3/{name=projects/*/notificationChannels/*}Ü +\'SendNotificationChannelVerificationCodeD.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.google.protobuf.Empty"SÚAname‚Óä“F"A/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode:*‡ +&GetNotificationChannelVerificationCodeC.google.monitoring.v3.GetNotificationChannelVerificationCodeRequestD.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse"RÚAname‚Óä“E"@/v3/{name=projects/*/notificationChannels/*}:getVerificationCode:*Ê +VerifyNotificationChannel6.google.monitoring.v3.VerifyNotificationChannelRequest).google.monitoring.v3.NotificationChannel"JÚA name,code‚Óä“8"3/v3/{name=projects/*/notificationChannels/*}:verify:*©Ê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.v3BNotificationServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..fb4ffd3bc28 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' +¼ +(google/monitoring/v3/query_service.protogoogle.monitoring.v3google/api/client.proto)google/monitoring/v3/metric_service.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.v3BQueryServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..1627dee4f7a7b671b07fe8db70c22464a26abb42 GIT binary patch literal 4653 zcmbVQOLNm!6h?XbI1eKdFs98Y28NJ=T;dMXQ3y=zgy3mH+$4k!;~61K*UoKaN!7zN zFj@6Kbl>TsGhKDnpU|1I>rDSZxBQBpdnMVjG{sSw6R{^R?P0N7lAG$l5`11wc17 z&y)5-4e$;m{O1I9lj@S^Yd-#Wi+U=>5ccWvOI@*vH zLmL(4gpsR~?*=4!x+J;84_s@7+szalcmApkh}4=xYr7;0ywY{3iywsQ__Q8isxcJG zxuN?<4ylzjlURo4R*6e(V=$P<@&02PMQzP6Izf7h^jYk<#hknY|IS1H=d5cAU0LJus#ZN12Z&0_f5EQf&(Y4MgvX=MW*K= z)y?1>Ou1203~M%w;{%xK%afRf;qS;%6vZhRZEI#gvb@BVp)UpHSK-6jF9Iwi`b}8p znnOJqM`2+voJ!(tY(C!--S-ObqQ8#gnTL;}U>}PG+ihwVeao|lFOok80&X^J(;zO2 zhJOqc5|&Dn0MsCsPaBlD`JcvMF0yQkw28S>XSUHc`ABnPRhJUC;9ATMlc9068d#h- z@i=|b%b%TD4gADP3}GiWZO!C~62u}*yS8cKRuDDd>?p6#>#@qXiOcbD!g_v)U9Y!o z^R_#^d?QA&)-LzXCB#*GOL>x)@=A-)&#CyAp=cLh8iNtW{QMt7FcF(2PQw^ZzC+u<{bCr)IXN#T_!As4ZR{zy`Qg}S zB45Fz*48MFJZe(^huy_w={UNsdL+q2$d8hZ1(lktBepOuHxwZKP7~R#ZCSjAHMJ+xF z1pY(&fk#2e|17{vU*^!o49)>V^=%(_7QRGt=&7mOr!9gFnG$c8wSFF@4DOY_OX~q! z!Bsu*BlAyT&w4_-9Qe;JFYCMuY{W3}#^8VKRQuG;Ft};YZ9vsiU4Yp^9*d74 zjqNgy#M#8|s|o6`1z*&qdiI9nc7Ig&MD*Y`$7B{Lt6|el zOz#5DZM+6)FDITk^_6ZJIQ8F#a+~}DMCM-va`z1Rp!hz1S*!84wd5@cUXy$n`ZNS9 p3V*LCUAUqg6zgMru`1r_e0bjrZyyqu6{lWQaLMpa;TVnq{sWYrinternalAddGeneratedFile( + ' +ó +*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";ÚAparent,service‚Óä“$"/v3/{parent=*/*}/services:service~ + +GetService\'.google.monitoring.v3.GetServiceRequest.google.monitoring.v3.Service"(ÚAname‚Óä“/v3/{name=*/*/services/*}‘ + ListServices).google.monitoring.v3.ListServicesRequest*.google.monitoring.v3.ListServicesResponse"*ÚAparent‚Óä“/v3/{parent=*/*}/services˜ + UpdateService*.google.monitoring.v3.UpdateServiceRequest.google.monitoring.v3.Service"<ÚAservice‚Óä“,2!/v3/{service.name=*/*/services/*}:service} + DeleteService*.google.monitoring.v3.DeleteServiceRequest.google.protobuf.Empty"(ÚAname‚Óä“*/v3/{name=*/*/services/*}ú +CreateServiceLevelObjective8.google.monitoring.v3.CreateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"tÚAparent,service_level_objective‚Óä“M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:service_level_objectiveÁ +GetServiceLevelObjective5.google.monitoring.v3.GetServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"AÚAname‚Óä“42/v3/{name=*/*/services/*/serviceLevelObjectives/*}Ô +ListServiceLevelObjectives7.google.monitoring.v3.ListServiceLevelObjectivesRequest8.google.monitoring.v3.ListServiceLevelObjectivesResponse"CÚAparent‚Óä“42/v3/{parent=*/*/services/*}/serviceLevelObjectivesŒ +UpdateServiceLevelObjective8.google.monitoring.v3.UpdateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"…ÚAservice_level_objective‚Óä“e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:service_level_objective² +DeleteServiceLevelObjective8.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.google.protobuf.Empty"AÚAname‚Óä“4*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}©Ê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.v3BServiceMonitoringServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php new file mode 100644 index 00000000000..eeb8487aad2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' + +!google/monitoring/v3/snooze.protogoogle.monitoring.v3google/api/resource.proto!google/monitoring/v3/common.proto"Å +Snooze +name ( BàA< +criteria ( 2%.google.monitoring.v3.Snooze.CriteriaBàA9 +interval ( 2".google.monitoring.v3.TimeIntervalBàA + display_name ( BàAH +Criteria< +policies ( B*úA\' +%monitoring.googleapis.com/AlertPolicy:JêAG + monitoring.googleapis.com/Snooze#projects/{project}/snoozes/{snooze}BÆ +com.google.monitoring.v3B SnoozeProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/SnoozeService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php new file mode 100644 index 00000000000..c0b830a5319 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php @@ -0,0 +1,56 @@ +internalAddGeneratedFile( + ' +• +)google/monitoring/v3/snooze_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/snooze.proto google/protobuf/field_mask.proto"‚ +CreateSnoozeRequest8 +parent ( B(àAúA" monitoring.googleapis.com/Snooze1 +snooze ( 2.google.monitoring.v3.SnoozeBàA"” +ListSnoozesRequest8 +parent ( B(àAúA" monitoring.googleapis.com/Snooze +filter ( BàA + page_size (BàA + +page_token ( BàA"] +ListSnoozesResponse- +snoozes ( 2.google.monitoring.v3.Snooze +next_page_token ( "J +GetSnoozeRequest6 +name ( B(àAúA" + monitoring.googleapis.com/Snooze"~ +UpdateSnoozeRequest1 +snooze ( 2.google.monitoring.v3.SnoozeBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA2˜ + SnoozeService˜ + CreateSnooze).google.monitoring.v3.CreateSnoozeRequest.google.monitoring.v3.Snooze"?ÚA parent,snooze‚Óä“)"/v3/{parent=projects/*}/snoozes:snooze” + ListSnoozes(.google.monitoring.v3.ListSnoozesRequest).google.monitoring.v3.ListSnoozesResponse"0ÚAparent‚Óä“!/v3/{parent=projects/*}/snoozes + GetSnooze&.google.monitoring.v3.GetSnoozeRequest.google.monitoring.v3.Snooze".ÚAname‚Óä“!/v3/{name=projects/*/snoozes/*}¤ + UpdateSnooze).google.monitoring.v3.UpdateSnoozeRequest.google.monitoring.v3.Snooze"KÚAsnooze,update_mask‚Óä“02&/v3/{snooze.name=projects/*/snoozes/*}:snooze©Ê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.v3BSnoozeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..ed30a8928d9 --- /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.v3BSpanContextProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..36ba869253e4af40d3ac4226633f0eec61f3f9e6 GIT binary patch literal 5190 zcmb_gOLN=S6*ehRqz?6as~qdS0rKz zK=DvV_Gr^z&`tkDr^{};?PT&By6$wcXcz6aGd=eL;M=j3sWu|cz31HX_|D_rUw&o} zZ1|9`6O%ZqM|A$|iuVSDw;ju~G;7G8`RC`v;Wg{RHipD0@O(|;o080nwTAovSzXI_ zG*agKmen7U{R_)9Jj*f6{{CfY-?u&Ef)toE08_mnuB~c>ueU14#8Y+EQ+svB*gGCE z_D)I%0NPM>UB1f%z#HK4&-TxThQ_;|>fyhKhN~EOn4u1h*Qoh3{#+fp1X<_zp8KZe z8J5XY2FcXO-eW$HN%uaqEwuC*AF0x!#-riAhUpQdORP3tG{jow4r-mMwnag1H0zldmxg4!+icR0csZVp<$w1+Yy}z0%&c1GxzWFo zsRzJ?F`4i@vpQY8AL)+qDa^t3@D3-zMiddH?^wRgoRcno95GIXyD+C=Ap&uoGNZsc zz`*ltMWeyWCeVZF;?tW7J48-q{$Y$0Vb#Nc1#)O$(#4dE0vuLJ^ zyOE3tafK+CxF?XLCD!u2Y>J)t9eZ1l(Jag_(^D=~50!M>>?*&6O8z`L;9Z`>5L5o+ zfSqf=8nYD<>0Q|*yT!m)y0Nq%Ib>wz1jx8#h?r)8=wqF5vw+HN6nl@}DX&c^19uP7 ztSJOlJG+V6q$&tht_E9CVF`jmP2XUq|8TMJnM`3)jv(#3XzEZsBSSa4!}vd0%s&sh zF0vjmPSNz7tDFk!Q#j;kwo^dTqz=l&b66h%o%xs6iMKn1!8wviotk?9(85+6CgwJz zZTxZ-&GJo;osr1>a}`!c5awRe)cTE2T!aYm28ck4s*U1jH??vk3X_bn~uAvDi2LWqnto6{s zd!f3olmSt7iUFGIDJ&?-h_J$f`uz5%9R?CvY`G5RMVM(UZmZ0R&u%X@%r}-H@58p{ zyPkD{@e8t;$zDgIwp?x5#Oz%Ff6JJZB$w83fVPOAzduqRP-3OxldtxQ7AE8Xf{rC zRixNBG-3nQ16bw$76)#DYVW~XXg2!H51MiU`@mpCXVWJWvQcc^ROdV?YIyOfxA^A`7 zIr7ht{QIRj^2bR2&pcUZewq14va$~83B2SAur>wzG%UR$S7Gs5heY6Amf_|2FJk#J zEqRkw;XUAvMfp&w%@~}7rMf8N$dQ8Omei3m@jSw5G8xb%@|P`fhK~*~?IT5OR;3ya zFfncm*1H|Ct+d+GNrRH&Sa(xVt7S!qmK|Dd6SIh=dVfE}ev^QWP}!(cV*LxVHgr#~ z2g$GthdBG(b^H0kh8?!P$b z&QQ_gtD}QMQyo}iq-k?|z5kCMg&7S32jn%lyKsTqgNL7Yq^8mmk+@0J#URtT_!aY^j@j7kc zg*QSB>%h6EusJil;8ozeGrf!1Ix*Z~c|$i>zd$!E$Xcudw7fN{N~5KO`#R|E46L2B zs$BSQ~*-Z7+Bc>j!oQnT@A)G zIs@cQEOTR%8aDR{tT=2YW-0jgk#T}6oT0Ia4y|BX3THD8z_1kr2P)wPH`6D7h)v!6 zLS76c;&MKbu$*^00!9>IMeMevmY88+?nqtCLE%_zH>v`H83QhK8Um&!y@6IU%iIP4 zaw-yvm6`}(ypYoGhV)X%tkC`R>!i`HH<}G0lYH`P*qWPyx%;r&7V)fhRa^u=l!@sl z3(cyCDq@NVFFT5OR8fv3p{7)XBf8Sg#4CS|K^8H#uxwS*fh$||?Wh&|m7onRUyrs@ zWcID-u>oiBeFQANk6jigX!hB`7}xgMALF??dm1ZLnW*E@16kpu^i8zb>#^0|internalAddGeneratedFile( + ' +˜ +)google/monitoring/v3/uptime_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/uptime.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"› +ListUptimeCheckConfigsRequestC +parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfig +filter (  + 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";ÚAparent‚Óä“,*/v3/{parent=projects/*}/uptimeCheckConfigs­ +GetUptimeCheckConfig1.google.monitoring.v3.GetUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"9ÚAname‚Óä“,*/v3/{name=projects/*/uptimeCheckConfigs/*}Þ +CreateUptimeCheckConfig4.google.monitoring.v3.CreateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"dÚAparent,uptime_check_config‚Óä“A"*/v3/{parent=projects/*}/uptimeCheckConfigs:uptime_check_configë +UpdateUptimeCheckConfig4.google.monitoring.v3.UpdateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"qÚAuptime_check_config‚Óä“U2>/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}:uptime_check_config¢ +DeleteUptimeCheckConfig4.google.monitoring.v3.DeleteUptimeCheckConfigRequest.google.protobuf.Empty"9ÚAname‚Óä“,**/v3/{name=projects/*/uptimeCheckConfigs/*}“ +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.v3BUptimeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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..7d97df10e8e --- /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 array|\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 array|\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/AlertPolicy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php new file mode 100644 index 00000000000..64b014d4429 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php @@ -0,0 +1,805 @@ +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 Cloud 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * + * 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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * + * 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`. + * If `condition_monitoring_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. This field is + * only set when the alert policy is invalid. An invalid 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; + /** + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $severity = 0; + + /** + * 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 Cloud 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * @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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * @type array<\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`. + * If `condition_monitoring_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. This field is + * only set when the alert policy is invalid. An invalid alert policy will not + * generate incidents. + * @type array|\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. + * @type int $severity + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * } + */ + 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 Cloud 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 Cloud 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * + * 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. + * The convention for the display_name of a PrometheusQueryLanguageCondition + * is "{rule group name}/{alert name}", where the {rule group name} and + * {alert name} should be taken from the corresponding Prometheus + * configuration file. This convention is not enforced. + * In any case the display_name is not a unique key of the AlertPolicy. + * + * 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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * + * 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. + * Note that Prometheus {alert name} is a + * [valid Prometheus label + * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), + * whereas Prometheus {rule group} is an unrestricted UTF-8 string. + * This means that they cannot be stored as-is in user labels, because + * they may contain characters that are not allowed in user-label values. + * + * 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`. + * If `condition_monitoring_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`. + * If `condition_monitoring_query_language` is present, it must be the only + * `condition`. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; + * @param array<\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. This field is + * only set when the alert policy is invalid. An invalid 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. This field is + * only set when the alert policy is invalid. An invalid 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 array|\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; + } + + /** + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Optional. The severity of an alert policy indicates how important incidents + * generated by that policy are. The severity level will be displayed on the + * Incident detail page and in notifications. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Severity::class); + $this->severity = $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..d5a4cff1ce3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php @@ -0,0 +1,167 @@ +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; + /** + * Control how notifications will be sent out, on a per-channel basis. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + */ + private $notification_channel_strategy; + + /** + * 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 + * @type array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $notification_channel_strategy + * Control how notifications will be sent out, on a per-channel basis. + * } + */ + 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; + } + + /** + * Control how notifications will be sent out, on a per-channel basis. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationChannelStrategy() + { + return $this->notification_channel_strategy; + } + + /** + * Control how notifications will be sent out, on a per-channel basis. + * + * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; + * @param array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationChannelStrategy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy::class); + $this->notification_channel_strategy = $arr; + + 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/NotificationChannelStrategy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php new file mode 100644 index 00000000000..3fb4be79589 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php @@ -0,0 +1,139 @@ +google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy + */ +class NotificationChannelStrategy extends \Google\Protobuf\Internal\Message +{ + /** + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channel_names = 1; + */ + private $notification_channel_names; + /** + * The frequency at which to send reminder notifications for open + * incidents. + * + * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; + */ + protected $renotify_interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $notification_channel_names + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @type \Google\Protobuf\Duration $renotify_interval + * The frequency at which to send reminder notifications for open + * incidents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channel_names = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationChannelNames() + { + return $this->notification_channel_names; + } + + /** + * The full REST resource name for the notification channels that these + * settings apply to. Each of these correspond to the name field in one + * of the NotificationChannel objects referenced in the + * notification_channels field of this AlertPolicy. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * + * Generated from protobuf field repeated string notification_channel_names = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationChannelNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->notification_channel_names = $arr; + + return $this; + } + + /** + * The frequency at which to send reminder notifications for open + * incidents. + * + * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getRenotifyInterval() + { + return $this->renotify_interval; + } + + public function hasRenotifyInterval() + { + return isset($this->renotify_interval); + } + + public function clearRenotifyInterval() + { + unset($this->renotify_interval); + } + + /** + * The frequency at which to send reminder notifications for open + * incidents. + * + * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRenotifyInterval($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->renotify_interval = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NotificationChannelStrategy::class, \Google\Cloud\Monitoring\V3\AlertPolicy_AlertStrategy_NotificationChannelStrategy::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..c476fb7bd10 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php @@ -0,0 +1,373 @@ +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 Cloud 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. Cloud 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 Cloud 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. Cloud 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. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $condition_prometheus_query_language + * A condition that uses the Prometheus 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 Cloud 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. Cloud 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 Cloud 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. Cloud 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; + } + + /** + * A condition that uses the Prometheus query language to define alerts. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition|null + */ + public function getConditionPrometheusQueryLanguage() + { + return $this->readOneof(21); + } + + public function hasConditionPrometheusQueryLanguage() + { + return $this->hasOneof(21); + } + + /** + * A condition that uses the Prometheus query language to define alerts. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $var + * @return $this + */ + public function setConditionPrometheusQueryLanguage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition::class); + $this->writeOneof(21, $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/EvaluationMissingData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php new file mode 100644 index 00000000000..6fc5a47b481 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php @@ -0,0 +1,76 @@ +google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData + */ +class EvaluationMissingData +{ + /** + * An unspecified evaluation missing data option. Equivalent to + * EVALUATION_MISSING_DATA_NO_OP. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_UNSPECIFIED = 0; + */ + const EVALUATION_MISSING_DATA_UNSPECIFIED = 0; + /** + * If there is no data to evaluate the condition, then evaluate the + * condition as false. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_INACTIVE = 1; + */ + const EVALUATION_MISSING_DATA_INACTIVE = 1; + /** + * If there is no data to evaluate the condition, then evaluate the + * condition as true. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_ACTIVE = 2; + */ + const EVALUATION_MISSING_DATA_ACTIVE = 2; + /** + * Do not evaluate the condition to any value if there is no data. + * + * Generated from protobuf enum EVALUATION_MISSING_DATA_NO_OP = 3; + */ + const EVALUATION_MISSING_DATA_NO_OP = 3; + + private static $valueToName = [ + self::EVALUATION_MISSING_DATA_UNSPECIFIED => 'EVALUATION_MISSING_DATA_UNSPECIFIED', + self::EVALUATION_MISSING_DATA_INACTIVE => 'EVALUATION_MISSING_DATA_INACTIVE', + self::EVALUATION_MISSING_DATA_ACTIVE => 'EVALUATION_MISSING_DATA_ACTIVE', + self::EVALUATION_MISSING_DATA_NO_OP => 'EVALUATION_MISSING_DATA_NO_OP', + ]; + + 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(EvaluationMissingData::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_EvaluationMissingData::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..fc6aad1dfc4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php @@ -0,0 +1,304 @@ +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 array<\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 array<\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..74e9099f57f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php @@ -0,0 +1,635 @@ +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; + /** + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + */ + protected $forecast_options = null; + /** + * 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; + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + */ + protected $evaluation_missing_data = 0; + + /** + * 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 array<\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 array<\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 \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $forecast_options + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * @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. + * @type int $evaluation_missing_data + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * } + */ + 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 array<\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 array<\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; + } + + /** + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions|null + */ + public function getForecastOptions() + { + return $this->forecast_options; + } + + public function hasForecastOptions() + { + return isset($this->forecast_options); + } + + public function clearForecastOptions() + { + unset($this->forecast_options); + } + + /** + * When this field is present, the `MetricThreshold` condition forecasts + * whether the time series is predicted to violate the threshold within + * the `forecast_horizon`. When this field is not set, the + * `MetricThreshold` tests the current value of the timeseries against the + * threshold. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $var + * @return $this + */ + public function setForecastOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions::class); + $this->forecast_options = $var; + + 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; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * @return int + */ + public function getEvaluationMissingData() + { + return $this->evaluation_missing_data; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. To use this control, the value + * of the `duration` field must be greater than or equal to 60 seconds. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; + * @param int $var + * @return $this + */ + public function setEvaluationMissingData($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); + $this->evaluation_missing_data = $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/MetricThreshold/ForecastOptions.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php new file mode 100644 index 00000000000..5b730b5b812 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php @@ -0,0 +1,101 @@ +google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions + */ +class ForecastOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * + * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forecast_horizon = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $forecast_horizon + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * + * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getForecastHorizon() + { + return $this->forecast_horizon; + } + + public function hasForecastHorizon() + { + return isset($this->forecast_horizon); + } + + public function clearForecastHorizon() + { + unset($this->forecast_horizon); + } + + /** + * Required. The length of time into the future to forecast whether a + * time series will violate the threshold. If the predicted value is + * found to violate the threshold, and the violation is observed in all + * forecasts made for the configured `duration`, then the time series is + * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. + * + * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setForecastHorizon($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->forecast_horizon = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ForecastOptions::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold_ForecastOptions::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..4752ce7876d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php @@ -0,0 +1,257 @@ +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; + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + */ + protected $evaluation_missing_data = 0; + + /** + * 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. + * @type int $evaluation_missing_data + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * } + */ + 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; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * @return int + */ + public function getEvaluationMissingData() + { + return $this->evaluation_missing_data; + } + + /** + * A condition control that determines how metric-threshold conditions + * are evaluated when data stops arriving. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; + * @param int $var + * @return $this + */ + public function setEvaluationMissingData($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); + $this->evaluation_missing_data = $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/PrometheusQueryLanguageCondition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php new file mode 100644 index 00000000000..6db9f2637a4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php @@ -0,0 +1,433 @@ +google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition + */ +class PrometheusQueryLanguageCondition extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $duration = null; + /** + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * + * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $evaluation_interval = null; + /** + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rule_group = ''; + /** + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $alert_rule = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * @type \Google\Protobuf\Duration $duration + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * @type \Google\Protobuf\Duration $evaluation_interval + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * @type string $rule_group + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * @type string $alert_rule + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The PromQL expression to evaluate. Every evaluation cycle + * this expression is evaluated at the current time, and all resultant + * time series become pending/firing alerts. This field must not be empty. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Optional. Alerts are considered firing once their PromQL expression was + * evaluated to be "true" for this long. + * Alerts whose PromQL expression was not evaluated to be "true" for + * long enough are considered pending. + * Must be a non-negative duration or missing. + * This field is optional. Its default value is zero. + * + * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * + * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getEvaluationInterval() + { + return $this->evaluation_interval; + } + + public function hasEvaluationInterval() + { + return isset($this->evaluation_interval); + } + + public function clearEvaluationInterval() + { + unset($this->evaluation_interval); + } + + /** + * Optional. How often this rule should be evaluated. + * Must be a positive multiple of 30 seconds or missing. + * This field is optional. Its default value is 30 seconds. + * If this PrometheusQueryLanguageCondition was generated from a + * Prometheus alerting rule, then this value should be taken from the + * enclosing rule group. + * + * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEvaluationInterval($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->evaluation_interval = $var; + + return $this; + } + + /** + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels to add to or overwrite in the PromQL query result. + * Label names [must be + * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * Label values can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * The only available variable names are the names of the labels in the + * PromQL result, including "__name__" and "value". "labels" may be empty. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @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; + } + + /** + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRuleGroup() + { + return $this->rule_group; + } + + /** + * Optional. The rule group name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must + * contain a valid UTF-8 string. + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRuleGroup($var) + { + GPBUtil::checkString($var, True); + $this->rule_group = $var; + + return $this; + } + + /** + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAlertRule() + { + return $this->alert_rule; + } + + /** + * Optional. The alerting rule name of this alert in the corresponding + * Prometheus configuration file. + * Some external tools may require this field to be populated correctly + * in order to refer to the original Prometheus configuration file. + * The rule group name and the alert name are necessary to update the + * relevant AlertPolicies in case the definition of the rule group changes + * in the future. + * This field is optional. If this field is not empty, then it must be a + * [valid Prometheus label + * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). + * This field may not exceed 2048 Unicode characters in length. + * + * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAlertRule($var) + { + GPBUtil::checkString($var, True); + $this->alert_rule = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrometheusQueryLanguageCondition::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_PrometheusQueryLanguageCondition::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..bb9e016f4bd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php @@ -0,0 +1,81 @@ +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 => 'AND', + self::PBOR => 'OR', + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + 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..7df7159cc1b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php @@ -0,0 +1,207 @@ +google.monitoring.v3.AlertPolicy.Documentation + */ +class Documentation extends \Google\Protobuf\Internal\Message +{ + /** + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * + * 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 = ''; + /** + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * + * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subject = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * @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. + * @type string $subject + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); + parent::__construct($data); + } + + /** + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * + * Generated from protobuf field string content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * The body 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. This text can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * + * 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; + } + + /** + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * + * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + /** + * Optional. The subject line of the notification. The subject line may not + * exceed 10,240 bytes. In notifications generated by this policy, the + * contents of the subject line after variable expansion will be truncated + * to 255 bytes or shorter at the latest UTF-8 character boundary. The + * 255-byte limit is recommended by [this + * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). + * It is both the limit imposed by some third-party ticketing products and + * it is common to define textual fields in databases as VARCHAR(255). + * The contents of the subject line can be [templatized by using + * variables](https://cloud.google.com/monitoring/alerts/doc-variables). + * If this field is missing or empty, a default subject line will be + * generated. + * + * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubject($var) + { + GPBUtil::checkString($var, True); + $this->subject = $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/AlertPolicy/Severity.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php new file mode 100644 index 00000000000..76e47474924 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php @@ -0,0 +1,75 @@ +google.monitoring.v3.AlertPolicy.Severity + */ +class Severity +{ + /** + * No severity is specified. This is the default value. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * This is the highest severity level. Use this if the problem could + * cause significant damage or downtime. + * + * Generated from protobuf enum CRITICAL = 1; + */ + const CRITICAL = 1; + /** + * This is the medium severity level. Use this if the problem could + * cause minor damage or downtime. + * + * Generated from protobuf enum ERROR = 2; + */ + const ERROR = 2; + /** + * This is the lowest severity level. Use this if the problem is not causing + * any damage or downtime, but could potentially lead to a problem in the + * future. + * + * Generated from protobuf enum WARNING = 3; + */ + const WARNING = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::CRITICAL => 'CRITICAL', + self::ERROR => 'ERROR', + self::WARNING => 'WARNING', + ]; + + 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(Severity::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Severity::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php new file mode 100644 index 00000000000..5becfda99f4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php @@ -0,0 +1,269 @@ +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 array|\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 array|\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 array|\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 array|\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 array|\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 array|\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/ComparisonType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php new file mode 100644 index 00000000000..d86a3fbc2cd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php @@ -0,0 +1,90 @@ +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..6c9c18ef40f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php @@ -0,0 +1,188 @@ +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 Metrics Scope, 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; + + /** + * @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 Metrics Scope, 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 \Google\Cloud\Monitoring\V3\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. + * + * @return \Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self + { + return (new self()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + } + + /** + * 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 Metrics Scope, 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 Metrics Scope, 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 Metrics Scope, 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..bad7c64edac --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php @@ -0,0 +1,181 @@ +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; + + /** + * @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 \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. + * + * @return \Google\Cloud\Monitoring\V3\CreateGroupRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Monitoring\V3\Group $group): self + { + return (new self()) + ->setName($name) + ->setGroup($group); + } + + /** + * 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..45d737e63e8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php @@ -0,0 +1,151 @@ +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; + + /** + * @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 \Google\Api\MetricDescriptor $metricDescriptor Required. The new [custom + * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. + * + * @return \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest + * + * @experimental + */ + public static function build(string $name, \Google\Api\MetricDescriptor $metricDescriptor): self + { + return (new self()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + } + + /** + * 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..2a528898beb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php @@ -0,0 +1,163 @@ +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; + + /** + * @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 \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel Required. The definition of the `NotificationChannel` to create. + * + * @return \Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self + { + return (new self()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + } + + /** + * 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..151f66b7a84 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php @@ -0,0 +1,185 @@ +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-zA-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; + + /** + * @param string $parent Required. Resource name of the parent `Service`. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * + * @return \Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self + { + return (new self()) + ->setParent($parent) + ->setServiceLevelObjective($serviceLevelObjective); + } + + /** + * 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-zA-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-zA-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-zA-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..7d9425e30c5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php @@ -0,0 +1,180 @@ +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 Metrics Scope. 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; + + /** + * @param string $parent Required. Resource + * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the + * parent Metrics Scope. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to create. + * + * @return \Google\Cloud\Monitoring\V3\CreateServiceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\Service $service): self + { + return (new self()) + ->setParent($parent) + ->setService($service); + } + + /** + * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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/CreateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php new file mode 100644 index 00000000000..c03b63fbc9d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php @@ -0,0 +1,149 @@ +google.monitoring.v3.CreateSnoozeRequest + */ +class CreateSnoozeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snooze = null; + + /** + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. + * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * @return \Google\Cloud\Monitoring\V3\CreateSnoozeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\Snooze $snooze): self + { + return (new self()) + ->setParent($parent) + ->setSnooze($snooze); + } + + /** + * 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 + * a `Snooze` should be created. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type \Google\Cloud\Monitoring\V3\Snooze $snooze + * Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. 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 + * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Snooze|null + */ + public function getSnooze() + { + return $this->snooze; + } + + public function hasSnooze() + { + return isset($this->snooze); + } + + public function clearSnooze() + { + unset($this->snooze); + } + + /** + * Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Snooze $var + * @return $this + */ + public function setSnooze($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); + $this->snooze = $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..66cb39cd93a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php @@ -0,0 +1,159 @@ +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; + + /** + * @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] + * Please see {@see MetricServiceClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Monitoring\V3\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. + * + * @return \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest + * + * @experimental + */ + public static function build(string $name, array $timeSeries): self + { + return (new self()) + ->setName($name) + ->setTimeSeries($timeSeries); + } + + /** + * 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 array<\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 array<\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..8fb4fe1f025 --- /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 array<\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 array<\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/CreateUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php new file mode 100644 index 00000000000..991e2028b3a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php @@ -0,0 +1,142 @@ +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; + + /** + * @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 \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. + * + * @return \Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self + { + return (new self()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + } + + /** + * 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..2333c3a4691 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php @@ -0,0 +1,93 @@ +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 = ''; + + /** + * @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]. Please see + * {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..b63a0bdb79f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php @@ -0,0 +1,130 @@ +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; + + /** + * @param string $name Required. The group to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Please see {@see GroupServiceClient::groupName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..3d57dd66af3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php @@ -0,0 +1,103 @@ +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 = ''; + + /** + * @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"`. Please see + * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..56e0316342e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php @@ -0,0 +1,138 @@ +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; + + /** + * @param string $name Required. The channel for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * @param 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. + * + * @return \Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name, bool $force): self + { + return (new self()) + ->setName($name) + ->setForce($force); + } + + /** + * 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..8771b8fb4ab --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php @@ -0,0 +1,92 @@ +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 = ''; + + /** + * @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] + * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..378fecd0724 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. Resource name of the `Service` to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..dfda97aa016 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The Uptime check configuration to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..573ae71a8ad --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The alerting policy to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * Please see {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetAlertPolicyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..da9c56f0a13 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The group to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Please see {@see GroupServiceClient::groupName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..360bdfac4cc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php @@ -0,0 +1,103 @@ +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 = ''; + + /** + * @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"`. Please see + * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..82d4800c5e1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php @@ -0,0 +1,98 @@ +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 = ''; + + /** + * @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`. Please see + * {@see MetricServiceClient::monitoredResourceDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..f7ff869b729 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The channel type for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * Please see {@see NotificationChannelServiceClient::notificationChannelDescriptorName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..708a1446cd9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The channel for which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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..acb10877c21 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php @@ -0,0 +1,167 @@ +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; + + /** + * @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. Please see + * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..c22d24403f6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php @@ -0,0 +1,138 @@ +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; + + /** + * @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] + * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..6113d513f42 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. Resource name of the `Service`. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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/GetSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php new file mode 100644 index 00000000000..83b9da5e20f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php @@ -0,0 +1,88 @@ +google.monitoring.v3.GetSnoozeRequest + */ +class GetSnoozeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * Please see {@see SnoozeServiceClient::snoozeName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetSnoozeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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 ID of the `Snooze` to retrieve. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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..83b9a3f2eaa --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php @@ -0,0 +1,87 @@ +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 = ''; + + /** + * @param string $name Required. The Uptime check configuration to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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/InternalChecker.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php new file mode 100644 index 00000000000..19273fdc3f2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php @@ -0,0 +1,271 @@ +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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Metrics Scope 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/LabelValue.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php new file mode 100644 index 00000000000..3a66a26a435 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php @@ -0,0 +1,141 @@ +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..cda153f70a1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php @@ -0,0 +1,294 @@ +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 = ''; + + /** + * @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. + * + * @return \Google\Cloud\Monitoring\V3\ListAlertPoliciesRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..45d31688ec1 --- /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 array<\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 array<\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..876c5364c1a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php @@ -0,0 +1,277 @@ +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; + + /** + * @param string $name Required. The group whose members are listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * Please see {@see GroupServiceClient::groupName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\ListGroupMembersRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..8cfc0e8fcd3 --- /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 array<\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 array<\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..7203ea37100 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php @@ -0,0 +1,316 @@ +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; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListGroupsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..98e3257f20a --- /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 array<\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 array<\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..800b557691f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php @@ -0,0 +1,238 @@ +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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * + * 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 = ''; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * @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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * + * 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. The + * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is + * submitted, will instead return a maximum of 10,000 results. + * + * 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..4ea2039e212 --- /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 array<\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 array<\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..14696bd981c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php @@ -0,0 +1,222 @@ +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 = ''; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..07992037c86 --- /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 array<\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 array<\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..ef7d9522e6f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php @@ -0,0 +1,206 @@ +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 = ''; + + /** + * @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. + * + * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..93034ae1599 --- /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 array<\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 array<\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..6bced117ff1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php @@ -0,0 +1,307 @@ +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 = ''; + + /** + * @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. + * + * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * 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..28dc01fb0af --- /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 array<\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 array<\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..19128d58f56 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php @@ -0,0 +1,257 @@ +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 Metrics Scope. 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; + + /** + * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Metrics Scope. The formats are: + * + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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..8e9d2ead1ab --- /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 array<\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 array<\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..795a4e8e34e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php @@ -0,0 +1,275 @@ +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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * 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 = ''; + + /** + * @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 Metrics Scope. The formats are: + * + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * + * @return \Google\Cloud\Monitoring\V3\ListServicesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * @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 Metrics Scope. 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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * 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..4359a2689b2 --- /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 array<\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 array<\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/ListSnoozesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php new file mode 100644 index 00000000000..ff92a8e233f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php @@ -0,0 +1,252 @@ +google.monitoring.v3.ListSnoozesRequest + */ +class ListSnoozesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be 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 = ''; + /** + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\ListSnoozesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 + * `Snooze`s should be listed. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * @type string $filter + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * @type int $page_size + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * @type string $page_token + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be 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 + * `Snooze`s should be 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; + } + + /** + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * * `interval.start_time` + * * `interval.end_time` + * For example: + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of results to return for a single query. The + * server may further constrain the maximum number of results returned in a + * single page. The value should be in the range [1, 1000]. If the value given + * is outside this range, the server will decide the number of results to be + * returned. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The `next_page_token` from a previous call to + * `ListSnoozesRequest` to get the next page of results. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @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/ListSnoozesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php new file mode 100644 index 00000000000..e22e8db840e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php @@ -0,0 +1,106 @@ +google.monitoring.v3.ListSnoozesResponse + */ +class ListSnoozesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * `Snooze`s matching this list call. + * + * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; + */ + private $snoozes; + /** + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * + * 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 array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $snoozes + * `Snooze`s matching this list call. + * @type string $next_page_token + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * `Snooze`s matching this list call. + * + * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSnoozes() + { + return $this->snoozes; + } + + /** + * `Snooze`s matching this list call. + * + * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; + * @param array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSnoozes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Snooze::class); + $this->snoozes = $arr; + + return $this; + } + + /** + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Page token for repeated calls to `ListSnoozes`, to fetch additional pages + * of results. If this is empty or missing, there are no more pages. + * + * 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..0b123db098c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php @@ -0,0 +1,501 @@ +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 = ''; + + /** + * @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] + * Please see {@see MetricServiceClient::workspaceName()} for help formatting this field. + * @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 \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. + * @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} + * + * @return \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest + * + * @experimental + */ + public static function build(string $name, string $filter, \Google\Cloud\Monitoring\V3\TimeInterval $interval, int $view): self + { + return (new self()) + ->setName($name) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + } + + /** + * 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..cd4d2c1bcc5 --- /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/ListTimeSeriesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php new file mode 100644 index 00000000000..f2d874bd347 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php @@ -0,0 +1,201 @@ +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 array<\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 array<\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 array<\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 array<\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..0718e498334 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php @@ -0,0 +1,230 @@ +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 = ''; + /** + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * 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 = ''; + + /** + * @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] + * + * @return \Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * 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 string $filter + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * @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; + } + + /** + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * + * 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; + } + + /** + * 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..f12354762fe --- /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 array<\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 array<\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..26da2fcdd61 --- /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 array<\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 array<\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/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..0ef18788e23 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php @@ -0,0 +1,594 @@ +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 array<\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 array<\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..f9e6c8c2714 --- /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 array<\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 array|\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 array<\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 array|\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/Point.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php new file mode 100644 index 00000000000..5db4ed6c5b7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php @@ -0,0 +1,153 @@ +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..95542afd49b --- /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 array<\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 array<\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/QueryTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php new file mode 100644 index 00000000000..05eb26d2f95 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php @@ -0,0 +1,197 @@ +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..79b8487cb24 --- /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 array<\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 array<\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 array<\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 array<\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..efa0e97e35b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php @@ -0,0 +1,81 @@ +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 = ''; + + /** + * @param string $name Required. The notification channel to which to send a verification code. Please see + * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * + * @return \Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($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/ServiceTier.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php new file mode 100644 index 00000000000..90668230848 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php @@ -0,0 +1,74 @@ +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 Cloud Monitoring 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 Cloud Monitoring Premium tier, a higher, more expensive tier of service + * that provides access to all Cloud Monitoring features, lets you use Cloud + * Monitoring 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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php new file mode 100644 index 00000000000..972f136cc0c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php @@ -0,0 +1,224 @@ +google.monitoring.v3.Snooze + */ +class Snooze extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * + * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $criteria = null; + /** + * Required. The `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * + * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interval = null; + /** + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * @type \Google\Cloud\Monitoring\V3\Snooze\Criteria $criteria + * Required. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * @type \Google\Cloud\Monitoring\V3\TimeInterval $interval + * Required. The `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * @type string $display_name + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the `Snooze`. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * The ID of the `Snooze` will be generated by the system. + * + * 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. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * + * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Snooze\Criteria|null + */ + public function getCriteria() + { + return $this->criteria; + } + + public function hasCriteria() + { + return isset($this->criteria); + } + + public function clearCriteria() + { + unset($this->criteria); + } + + /** + * Required. This defines the criteria for applying the `Snooze`. See + * `Criteria` for more information. + * + * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Snooze\Criteria $var + * @return $this + */ + public function setCriteria($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze\Criteria::class); + $this->criteria = $var; + + return $this; + } + + /** + * Required. The `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * + * 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 `Snooze` will be active from `interval.start_time` through + * `interval.end_time`. + * `interval.start_time` cannot be in the past. There is a 15 second clock + * skew to account for the time it takes for a request to reach the API from + * the UI. + * + * 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; + } + + /** + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. A display name for the `Snooze`. This can be, at most, 512 + * unicode characters. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php new file mode 100644 index 00000000000..13e62c6c185 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php @@ -0,0 +1,88 @@ +google.monitoring.v3.Snooze.Criteria + */ +class Criteria extends \Google\Protobuf\Internal\Message +{ + /** + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * + * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { + */ + private $policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $policies + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); + parent::__construct($data); + } + + /** + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * + * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicies() + { + return $this->policies; + } + + /** + * The specific `AlertPolicy` names for the alert that should be snoozed. + * The format is: + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] + * There is a limit of 16 policies per snooze. This limit is checked during + * snooze creation. + * + * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->policies = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Criteria::class, \Google\Cloud\Monitoring\V3\Snooze_Criteria::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php new file mode 100644 index 00000000000..cfeb31ba834 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php @@ -0,0 +1,91 @@ +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/TimeInterval.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php new file mode 100644 index 00000000000..1869cd41c8a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php @@ -0,0 +1,165 @@ +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..884802d3cdc --- /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 array<\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 array<\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..4c91cd6c80a --- /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 array<\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 array<\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 array<\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 array<\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..9aa86421aa7 --- /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 array<\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 array<\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/TimeSeriesDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php new file mode 100644 index 00000000000..ec714c4abc2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php @@ -0,0 +1,101 @@ +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 array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $label_descriptors + * Descriptors for the labels. + * @type array<\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 array<\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 array<\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/TimeSeriesRatio.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php new file mode 100644 index 00000000000..bbd4edb9bac --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php @@ -0,0 +1,180 @@ +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..2e02f8c2541 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php @@ -0,0 +1,239 @@ +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; + + /** + * @param \Google\Protobuf\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. + * @param \Google\Cloud\Monitoring\V3\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. + * + * @return \Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest + * + * @experimental + */ + public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self + { + return (new self()) + ->setUpdateMask($updateMask) + ->setAlertPolicy($alertPolicy); + } + + /** + * 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..1acaca5a69d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php @@ -0,0 +1,134 @@ +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; + + /** + * @param \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. + * + * @return \Google\Cloud\Monitoring\V3\UpdateGroupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\Group $group): self + { + return (new self()) + ->setGroup($group); + } + + /** + * 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..6528f4c7e50 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php @@ -0,0 +1,151 @@ +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; + + /** + * @param \Google\Protobuf\FieldMask $updateMask The fields to update. + * @param \Google\Cloud\Monitoring\V3\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`. + * + * @return \Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest + * + * @experimental + */ + public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self + { + return (new self()) + ->setUpdateMask($updateMask) + ->setNotificationChannel($notificationChannel); + } + + /** + * 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..c6521c3f2a3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php @@ -0,0 +1,139 @@ +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; + + /** + * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * + * @return \Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self + { + return (new self()) + ->setServiceLevelObjective($serviceLevelObjective); + } + + /** + * 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..c672ae081a8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php @@ -0,0 +1,139 @@ +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; + + /** + * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * + * @return \Google\Cloud\Monitoring\V3\UpdateServiceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\Service $service): self + { + return (new self()) + ->setService($service); + } + + /** + * 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/UpdateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php new file mode 100644 index 00000000000..d3091d8bda9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php @@ -0,0 +1,227 @@ +google.monitoring.v3.UpdateSnoozeRequest + */ +class UpdateSnoozeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `Snooze` to update. Must have the name field present. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snooze = null; + /** + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to update. Must have the name field present. + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to update. + * + * For each field listed in `update_mask`: + * + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * + * Fields not listed retain their existing value. + * + * The following are the field names that are accepted in `update_mask`: + * + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * @return \Google\Cloud\Monitoring\V3\UpdateSnoozeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\Snooze $snooze, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Monitoring\V3\Snooze $snooze + * Required. The `Snooze` to update. Must have the name field present. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `Snooze` to update. Must have the name field present. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Monitoring\V3\Snooze|null + */ + public function getSnooze() + { + return $this->snooze; + } + + public function hasSnooze() + { + return isset($this->snooze); + } + + public function clearSnooze() + { + unset($this->snooze); + } + + /** + * Required. The `Snooze` to update. Must have the name field present. + * + * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Monitoring\V3\Snooze $var + * @return $this + */ + public function setSnooze($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); + $this->snooze = $var; + + return $this; + } + + /** + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. The fields to update. + * For each field listed in `update_mask`: + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * Fields not listed retain their existing value. + * The following are the field names that are accepted in `update_mask`: + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @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..151f4486915 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php @@ -0,0 +1,192 @@ +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 corresponding 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; + + /** + * @param \Google\Cloud\Monitoring\V3\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 corresponding 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`. + * + * @return \Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self + { + return (new self()) + ->setUptimeCheckConfig($uptimeCheckConfig); + } + + /** + * 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 corresponding 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 corresponding 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 corresponding 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..10904aecc43 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php @@ -0,0 +1,711 @@ +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 Cloud Monitoring 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 type of checkers to use to execute the Uptime check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; + */ + protected $checker_type = 0; + /** + * 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; + /** + * User-supplied key/value data to be used for organizing and + * identifying the `UptimeCheckConfig` 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 = 20; + */ + private $user_labels; + 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 Cloud Monitoring 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` + * `servicedirectory_service` + * `cloud_run_revision` + * @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 array<\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 $checker_type + * The type of checkers to use to execute the Uptime check. + * @type array|\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 array<\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`. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * User-supplied key/value data to be used for organizing and + * identifying the `UptimeCheckConfig` 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. + * } + */ + 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 Cloud Monitoring 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 Cloud Monitoring 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` + * `servicedirectory_service` + * `cloud_run_revision` + * + * 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` + * `servicedirectory_service` + * `cloud_run_revision` + * + * 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 array<\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 type of checkers to use to execute the Uptime check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; + * @return int + */ + public function getCheckerType() + { + return $this->checker_type; + } + + /** + * The type of checkers to use to execute the Uptime check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; + * @param int $var + * @return $this + */ + public function setCheckerType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\CheckerType::class); + $this->checker_type = $var; + + 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 array|\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 array<\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; + } + + /** + * User-supplied key/value data to be used for organizing and + * identifying the `UptimeCheckConfig` 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 = 20; + * @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 `UptimeCheckConfig` 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 = 20; + * @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 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/CheckerType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php new file mode 100644 index 00000000000..e97a33453e2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php @@ -0,0 +1,69 @@ +google.monitoring.v3.UptimeCheckConfig.CheckerType + */ +class CheckerType +{ + /** + * The default checker type. Currently converted to `STATIC_IP_CHECKERS` + * on creation, the default conversion behavior may change in the future. + * + * Generated from protobuf enum CHECKER_TYPE_UNSPECIFIED = 0; + */ + const CHECKER_TYPE_UNSPECIFIED = 0; + /** + * `STATIC_IP_CHECKERS` are used for uptime checks that perform egress + * across the public internet. `STATIC_IP_CHECKERS` use the static IP + * addresses returned by `ListUptimeCheckIps`. + * + * Generated from protobuf enum STATIC_IP_CHECKERS = 1; + */ + const STATIC_IP_CHECKERS = 1; + /** + * `VPC_CHECKERS` are used for uptime checks that perform egress using + * Service Directory and private network access. When using `VPC_CHECKERS`, + * the monitored resource type must be `servicedirectory_service`. + * + * Generated from protobuf enum VPC_CHECKERS = 3; + */ + const VPC_CHECKERS = 3; + + private static $valueToName = [ + self::CHECKER_TYPE_UNSPECIFIED => 'CHECKER_TYPE_UNSPECIFIED', + self::STATIC_IP_CHECKERS => 'STATIC_IP_CHECKERS', + self::VPC_CHECKERS => 'VPC_CHECKERS', + ]; + + 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(CheckerType::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_CheckerType::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..6c5646dbef8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php @@ -0,0 +1,158 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher + */ +class ContentMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * String, regex or JSON 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; + protected $additional_matcher_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * String, regex or JSON 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. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $json_path_matcher + * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * String, regex or JSON 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, regex or JSON 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; + } + + /** + * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher|null + */ + public function getJsonPathMatcher() + { + return $this->readOneof(3); + } + + public function hasJsonPathMatcher() + { + return $this->hasOneof(3); + } + + /** + * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $var + * @return $this + */ + public function setJsonPathMatcher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAdditionalMatcherInfo() + { + return $this->whichOneof("additional_matcher_info"); + } + +} + +// 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..3dffeaa7586 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php @@ -0,0 +1,107 @@ +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 if 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; + /** + * Selects JSONPath matching. See `JsonPathMatcher` for details on when + * the match succeeds. JSONPath matching is only supported for HTTP/HTTPS + * checks. + * + * Generated from protobuf enum MATCHES_JSON_PATH = 5; + */ + const MATCHES_JSON_PATH = 5; + /** + * Selects JSONPath matching. See `JsonPathMatcher` for details on when + * the match succeeds. Succeeds when output does _NOT_ match as specified. + * JSONPath is only supported for HTTP/HTTPS checks. + * + * Generated from protobuf enum NOT_MATCHES_JSON_PATH = 6; + */ + const NOT_MATCHES_JSON_PATH = 6; + + 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', + self::MATCHES_JSON_PATH => 'MATCHES_JSON_PATH', + self::NOT_MATCHES_JSON_PATH => 'NOT_MATCHES_JSON_PATH', + ]; + + 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/ContentMatcher/JsonPathMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php new file mode 100644 index 00000000000..04e6f363bfa --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php @@ -0,0 +1,114 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher + */ +class JsonPathMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * + * Generated from protobuf field string json_path = 1; + */ + protected $json_path = ''; + /** + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; + */ + protected $json_matcher = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $json_path + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * @type int $json_matcher + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * + * Generated from protobuf field string json_path = 1; + * @return string + */ + public function getJsonPath() + { + return $this->json_path; + } + + /** + * JSONPath within the response output pointing to the expected + * `ContentMatcher::content` to match against. + * + * Generated from protobuf field string json_path = 1; + * @param string $var + * @return $this + */ + public function setJsonPath($var) + { + GPBUtil::checkString($var, True); + $this->json_path = $var; + + return $this; + } + + /** + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; + * @return int + */ + public function getJsonMatcher() + { + return $this->json_matcher; + } + + /** + * The type of JSONPath match that will be applied to the JSON output + * (`ContentMatcher.content`) + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; + * @param int $var + * @return $this + */ + public function setJsonMatcher($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher\JsonPathMatcherOption::class); + $this->json_matcher = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(JsonPathMatcher::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php new file mode 100644 index 00000000000..965725688ee --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php @@ -0,0 +1,68 @@ +google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption + */ +class JsonPathMatcherOption +{ + /** + * No JSONPath matcher type specified (not valid). + * + * Generated from protobuf enum JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; + */ + const JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; + /** + * Selects 'exact string' matching. The match succeeds if the content at + * the `json_path` within the output is exactly the same as the + * `content` string. + * + * Generated from protobuf enum EXACT_MATCH = 1; + */ + const EXACT_MATCH = 1; + /** + * Selects regular-expression matching. The match succeeds if the + * content at the `json_path` within the output matches the regular + * expression specified in the `content` string. + * + * Generated from protobuf enum REGEX_MATCH = 2; + */ + const REGEX_MATCH = 2; + + private static $valueToName = [ + self::JSON_PATH_MATCHER_OPTION_UNSPECIFIED => 'JSON_PATH_MATCHER_OPTION_UNSPECIFIED', + self::EXACT_MATCH => 'EXACT_MATCH', + self::REGEX_MATCH => 'REGEX_MATCH', + ]; + + 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(JsonPathMatcherOption::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption::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..e158f367c01 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php @@ -0,0 +1,678 @@ +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; + /** + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * + * Generated from protobuf field string custom_content_type = 13; + */ + protected $custom_content_type = ''; + /** + * 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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * + * Generated from protobuf field bytes body = 10; + */ + protected $body = ''; + /** + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; + */ + private $accepted_response_status_codes; + /** + * Contains information needed to add pings to an HTTP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; + */ + protected $ping_config = null; + + /** + * 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 string $custom_content_type + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * @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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * @type array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $accepted_response_status_codes + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config + * Contains information needed to add pings to an HTTP check. + * } + */ + 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; + } + + /** + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * + * Generated from protobuf field string custom_content_type = 13; + * @return string + */ + public function getCustomContentType() + { + return $this->custom_content_type; + } + + /** + * A user provided content type header to use for the check. The invalid + * configurations outlined in the `content_type` field apply to + * `custom_content_type`, as well as the following: + * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. + * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not + * set. + * + * Generated from protobuf field string custom_content_type = 13; + * @param string $var + * @return $this + */ + public function setCustomContentType($var) + { + GPBUtil::checkString($var, True); + $this->custom_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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * + * 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: If client libraries aren't used (which performs the conversion + * automatically) base64 encode your `body` data since the field is of + * `bytes` type. + * + * 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; + } + + /** + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAcceptedResponseStatusCodes() + { + return $this->accepted_response_status_codes; + } + + /** + * If present, the check will only pass if the HTTP response status code is + * in this set of status codes. If empty, the HTTP status code will only + * pass if the HTTP status code is 200-299. + * + * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; + * @param array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAcceptedResponseStatusCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode::class); + $this->accepted_response_status_codes = $arr; + + return $this; + } + + /** + * Contains information needed to add pings to an HTTP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null + */ + public function getPingConfig() + { + return $this->ping_config; + } + + public function hasPingConfig() + { + return isset($this->ping_config); + } + + public function clearPingConfig() + { + unset($this->ping_config); + } + + /** + * Contains information needed to add pings to an HTTP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var + * @return $this + */ + public function setPingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); + $this->ping_config = $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..7eeb5f3ad04 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php @@ -0,0 +1,67 @@ +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; + /** + * `body` is in `custom_content_type` form. Equivalent to setting the + * `Content-Type` to the contents of `custom_content_type` in the HTTP + * request. + * + * Generated from protobuf enum USER_PROVIDED = 2; + */ + const USER_PROVIDED = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::URL_ENCODED => 'URL_ENCODED', + self::USER_PROVIDED => 'USER_PROVIDED', + ]; + + 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/HttpCheck/ResponseStatusCode.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php new file mode 100644 index 00000000000..61fe31c3dab --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php @@ -0,0 +1,112 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode + */ +class ResponseStatusCode extends \Google\Protobuf\Internal\Message +{ + protected $status_code; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $status_value + * A status code to accept. + * @type int $status_class + * A class of status codes to accept. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * A status code to accept. + * + * Generated from protobuf field int32 status_value = 1; + * @return int + */ + public function getStatusValue() + { + return $this->readOneof(1); + } + + public function hasStatusValue() + { + return $this->hasOneof(1); + } + + /** + * A status code to accept. + * + * Generated from protobuf field int32 status_value = 1; + * @param int $var + * @return $this + */ + public function setStatusValue($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A class of status codes to accept. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; + * @return int + */ + public function getStatusClass() + { + return $this->readOneof(2); + } + + public function hasStatusClass() + { + return $this->hasOneof(2); + } + + /** + * A class of status codes to accept. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; + * @param int $var + * @return $this + */ + public function setStatusClass($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode\StatusClass::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getStatusCode() + { + return $this->whichOneof("status_code"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResponseStatusCode::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php new file mode 100644 index 00000000000..ec9ccc03c04 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php @@ -0,0 +1,92 @@ +google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass + */ +class StatusClass +{ + /** + * Default value that matches no status codes. + * + * Generated from protobuf enum STATUS_CLASS_UNSPECIFIED = 0; + */ + const STATUS_CLASS_UNSPECIFIED = 0; + /** + * The class of status codes between 100 and 199. + * + * Generated from protobuf enum STATUS_CLASS_1XX = 100; + */ + const STATUS_CLASS_1XX = 100; + /** + * The class of status codes between 200 and 299. + * + * Generated from protobuf enum STATUS_CLASS_2XX = 200; + */ + const STATUS_CLASS_2XX = 200; + /** + * The class of status codes between 300 and 399. + * + * Generated from protobuf enum STATUS_CLASS_3XX = 300; + */ + const STATUS_CLASS_3XX = 300; + /** + * The class of status codes between 400 and 499. + * + * Generated from protobuf enum STATUS_CLASS_4XX = 400; + */ + const STATUS_CLASS_4XX = 400; + /** + * The class of status codes between 500 and 599. + * + * Generated from protobuf enum STATUS_CLASS_5XX = 500; + */ + const STATUS_CLASS_5XX = 500; + /** + * The class of all status codes. + * + * Generated from protobuf enum STATUS_CLASS_ANY = 1000; + */ + const STATUS_CLASS_ANY = 1000; + + private static $valueToName = [ + self::STATUS_CLASS_UNSPECIFIED => 'STATUS_CLASS_UNSPECIFIED', + self::STATUS_CLASS_1XX => 'STATUS_CLASS_1XX', + self::STATUS_CLASS_2XX => 'STATUS_CLASS_2XX', + self::STATUS_CLASS_3XX => 'STATUS_CLASS_3XX', + self::STATUS_CLASS_4XX => 'STATUS_CLASS_4XX', + self::STATUS_CLASS_5XX => 'STATUS_CLASS_5XX', + self::STATUS_CLASS_ANY => 'STATUS_CLASS_ANY', + ]; + + 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(StatusClass::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass::class); + diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php new file mode 100644 index 00000000000..ae85d7f1047 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php @@ -0,0 +1,72 @@ +google.monitoring.v3.UptimeCheckConfig.PingConfig + */ +class PingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * + * Generated from protobuf field int32 pings_count = 1; + */ + protected $pings_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $pings_count + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); + parent::__construct($data); + } + + /** + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * + * Generated from protobuf field int32 pings_count = 1; + * @return int + */ + public function getPingsCount() + { + return $this->pings_count; + } + + /** + * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. + * + * Generated from protobuf field int32 pings_count = 1; + * @param int $var + * @return $this + */ + public function setPingsCount($var) + { + GPBUtil::checkInt32($var); + $this->pings_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PingConfig::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_PingConfig::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..09c0668c3b3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php @@ -0,0 +1,122 @@ +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; + /** + * Contains information needed to add pings to a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; + */ + protected $ping_config = null; + + /** + * 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. + * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config + * Contains information needed to add pings to a TCP check. + * } + */ + 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; + } + + /** + * Contains information needed to add pings to a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null + */ + public function getPingConfig() + { + return $this->ping_config; + } + + public function hasPingConfig() + { + return isset($this->ping_config); + } + + public function clearPingConfig() + { + unset($this->ping_config); + } + + /** + * Contains information needed to add pings to a TCP check. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; + * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var + * @return $this + */ + public function setPingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); + $this->ping_config = $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/UptimeCheckIp.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php new file mode 100644 index 00000000000..8eb3b2a696b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php @@ -0,0 +1,160 @@ +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..8524b68cf0f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php @@ -0,0 +1,102 @@ +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; + /** + * Allows checks to run from locations within the western United States of + * America + * + * Generated from protobuf enum USA_OREGON = 5; + */ + const USA_OREGON = 5; + /** + * Allows checks to run from locations within the central United States of + * America + * + * Generated from protobuf enum USA_IOWA = 6; + */ + const USA_IOWA = 6; + /** + * Allows checks to run from locations within the eastern United States of + * America + * + * Generated from protobuf enum USA_VIRGINIA = 7; + */ + const USA_VIRGINIA = 7; + + private static $valueToName = [ + self::REGION_UNSPECIFIED => 'REGION_UNSPECIFIED', + self::USA => 'USA', + self::EUROPE => 'EUROPE', + self::SOUTH_AMERICA => 'SOUTH_AMERICA', + self::ASIA_PACIFIC => 'ASIA_PACIFIC', + self::USA_OREGON => 'USA_OREGON', + self::USA_IOWA => 'USA_IOWA', + self::USA_VIRGINIA => 'USA_VIRGINIA', + ]; + + 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/VerifyNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php new file mode 100644 index 00000000000..95410209d06 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php @@ -0,0 +1,147 @@ +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 = ''; + + /** + * @param string $name Required. The notification channel to verify. Please see + * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. + * @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). + * + * @return \Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest + * + * @experimental + */ + public static function build(string $name, string $code): self + { + return (new self()) + ->setName($name) + ->setCode($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/samples/V3/AlertPolicyServiceClient/create_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php new file mode 100644 index 00000000000..8da94f5c6a8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php @@ -0,0 +1,88 @@ +setName($name) + ->setAlertPolicy($alertPolicy); + + // Call the API and handle any network failures. + try { + /** @var AlertPolicy $response */ + $response = $alertPolicyServiceClient->createAlertPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_alert_policy_sample($name); +} +// [END monitoring_v3_generated_AlertPolicyService_CreateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php new file mode 100644 index 00000000000..20341bb9ced --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $alertPolicyServiceClient->deleteAlertPolicy($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + + delete_alert_policy_sample($formattedName); +} +// [END monitoring_v3_generated_AlertPolicyService_DeleteAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php new file mode 100644 index 00000000000..a6b8ef21ad6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AlertPolicy $response */ + $response = $alertPolicyServiceClient->getAlertPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + + get_alert_policy_sample($formattedName); +} +// [END monitoring_v3_generated_AlertPolicyService_GetAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php new file mode 100644 index 00000000000..dc60fddad14 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php @@ -0,0 +1,85 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alertPolicyServiceClient->listAlertPolicies($request); + + /** @var AlertPolicy $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_alert_policies_sample($name); +} +// [END monitoring_v3_generated_AlertPolicyService_ListAlertPolicies_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php new file mode 100644 index 00000000000..d4f9c5060ec --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php @@ -0,0 +1,66 @@ +setAlertPolicy($alertPolicy); + + // Call the API and handle any network failures. + try { + /** @var AlertPolicy $response */ + $response = $alertPolicyServiceClient->updateAlertPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_AlertPolicyService_UpdateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php new file mode 100644 index 00000000000..5662f185f72 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php @@ -0,0 +1,76 @@ +setName($name) + ->setGroup($group); + + // Call the API and handle any network failures. + try { + /** @var Group $response */ + $response = $groupServiceClient->createGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_group_sample($name); +} +// [END monitoring_v3_generated_GroupService_CreateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php new file mode 100644 index 00000000000..2b0b5d393b3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $groupServiceClient->deleteGroup($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); + + delete_group_sample($formattedName); +} +// [END monitoring_v3_generated_GroupService_DeleteGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php new file mode 100644 index 00000000000..59d00116484 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Group $response */ + $response = $groupServiceClient->getGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); + + get_group_sample($formattedName); +} +// [END monitoring_v3_generated_GroupService_GetGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php new file mode 100644 index 00000000000..810ef1fb51c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $groupServiceClient->listGroupMembers($request); + + /** @var MonitoredResource $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); + + list_group_members_sample($formattedName); +} +// [END monitoring_v3_generated_GroupService_ListGroupMembers_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php new file mode 100644 index 00000000000..073f54a6f17 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $groupServiceClient->listGroups($request); + + /** @var Group $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_groups_sample($name); +} +// [END monitoring_v3_generated_GroupService_ListGroups_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php new file mode 100644 index 00000000000..58d8ed1e52b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php @@ -0,0 +1,60 @@ +setGroup($group); + + // Call the API and handle any network failures. + try { + /** @var Group $response */ + $response = $groupServiceClient->updateGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_GroupService_UpdateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php new file mode 100644 index 00000000000..c54f10ba5a8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php @@ -0,0 +1,81 @@ +setName($name) + ->setMetricDescriptor($metricDescriptor); + + // Call the API and handle any network failures. + try { + /** @var MetricDescriptor $response */ + $response = $metricServiceClient->createMetricDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_metric_descriptor_sample($name); +} +// [END monitoring_v3_generated_MetricService_CreateMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php new file mode 100644 index 00000000000..3676da8a884 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php @@ -0,0 +1,84 @@ +setName($formattedName) + ->setTimeSeries($timeSeries); + + // Call the API and handle any network failures. + try { + $metricServiceClient->createServiceTimeSeries($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::projectName('[PROJECT]'); + + create_service_time_series_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_CreateServiceTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php new file mode 100644 index 00000000000..943e3d74156 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php @@ -0,0 +1,82 @@ +setName($formattedName) + ->setTimeSeries($timeSeries); + + // Call the API and handle any network failures. + try { + $metricServiceClient->createTimeSeries($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::projectName('[PROJECT]'); + + create_time_series_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_CreateTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php new file mode 100644 index 00000000000..5be71ec658a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $metricServiceClient->deleteMetricDescriptor($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + + delete_metric_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_DeleteMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php new file mode 100644 index 00000000000..f1733d7ebcf --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var MetricDescriptor $response */ + $response = $metricServiceClient->getMetricDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + + get_metric_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_GetMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php new file mode 100644 index 00000000000..b80928f31d4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var MonitoredResourceDescriptor $response */ + $response = $metricServiceClient->getMonitoredResourceDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::monitoredResourceDescriptorName( + '[PROJECT]', + '[MONITORED_RESOURCE_DESCRIPTOR]' + ); + + get_monitored_resource_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_MetricService_GetMonitoredResourceDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php new file mode 100644 index 00000000000..2a60d376cdf --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $metricServiceClient->listMetricDescriptors($request); + + /** @var MetricDescriptor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_metric_descriptors_sample($name); +} +// [END monitoring_v3_generated_MetricService_ListMetricDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php new file mode 100644 index 00000000000..8594af87cfc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $metricServiceClient->listMonitoredResourceDescriptors($request); + + /** @var MonitoredResourceDescriptor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_monitored_resource_descriptors_sample($name); +} +// [END monitoring_v3_generated_MetricService_ListMonitoredResourceDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php new file mode 100644 index 00000000000..2d408169cc2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php @@ -0,0 +1,99 @@ +setName($formattedName) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $metricServiceClient->listTimeSeries($request); + + /** @var TimeSeries $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = MetricServiceClient::workspaceName('[PROJECT]'); + $filter = '[FILTER]'; + $view = TimeSeriesView::FULL; + + list_time_series_sample($formattedName, $filter, $view); +} +// [END monitoring_v3_generated_MetricService_ListTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php new file mode 100644 index 00000000000..4e2647ee023 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php @@ -0,0 +1,87 @@ +setName($name) + ->setNotificationChannel($notificationChannel); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->createNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + create_notification_channel_sample($name); +} +// [END monitoring_v3_generated_NotificationChannelService_CreateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php new file mode 100644 index 00000000000..1af1aacc41e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $notificationChannelServiceClient->deleteNotificationChannel($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + delete_notification_channel_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_DeleteNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php new file mode 100644 index 00000000000..a1efeebeec4 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->getNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + get_notification_channel_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php new file mode 100644 index 00000000000..3f4bc0a7731 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannelDescriptor $response */ + $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelDescriptorName( + '[PROJECT]', + '[CHANNEL_DESCRIPTOR]' + ); + + get_notification_channel_descriptor_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php new file mode 100644 index 00000000000..a63472001e2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php @@ -0,0 +1,96 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var GetNotificationChannelVerificationCodeResponse $response */ + $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + get_notification_channel_verification_code_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php new file mode 100644 index 00000000000..0382fad734f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php @@ -0,0 +1,86 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $notificationChannelServiceClient->listNotificationChannelDescriptors($request); + + /** @var NotificationChannelDescriptor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_notification_channel_descriptors_sample($name); +} +// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannelDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php new file mode 100644 index 00000000000..4a236f89c3a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php @@ -0,0 +1,88 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $notificationChannelServiceClient->listNotificationChannels($request); + + /** @var NotificationChannel $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + list_notification_channels_sample($name); +} +// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannels_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php new file mode 100644 index 00000000000..b8810b7a301 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $notificationChannelServiceClient->sendNotificationChannelVerificationCode($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + + send_notification_channel_verification_code_sample($formattedName); +} +// [END monitoring_v3_generated_NotificationChannelService_SendNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php new file mode 100644 index 00000000000..ad79286eff6 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php @@ -0,0 +1,65 @@ +setNotificationChannel($notificationChannel); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->updateNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_NotificationChannelService_UpdateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php new file mode 100644 index 00000000000..7603415aff5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php @@ -0,0 +1,85 @@ +setName($formattedName) + ->setCode($code); + + // Call the API and handle any network failures. + try { + /** @var NotificationChannel $response */ + $response = $notificationChannelServiceClient->verifyNotificationChannel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = NotificationChannelServiceClient::notificationChannelName( + '[PROJECT]', + '[NOTIFICATION_CHANNEL]' + ); + $code = '[CODE]'; + + verify_notification_channel_sample($formattedName, $code); +} +// [END monitoring_v3_generated_NotificationChannelService_VerifyNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php new file mode 100644 index 00000000000..c9e9a6166ae --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php @@ -0,0 +1,84 @@ +setName($name) + ->setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $queryServiceClient->queryTimeSeries($request); + + /** @var TimeSeriesData $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + $query = '[QUERY]'; + + query_time_series_sample($name, $query); +} +// [END monitoring_v3_generated_QueryService_QueryTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php new file mode 100644 index 00000000000..f1cd6dae994 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php @@ -0,0 +1,76 @@ +setParent($parent) + ->setService($service); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $serviceMonitoringServiceClient->createService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + create_service_sample($parent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_CreateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php new file mode 100644 index 00000000000..2559795e52e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php @@ -0,0 +1,75 @@ +setParent($formattedParent) + ->setServiceLevelObjective($serviceLevelObjective); + + // Call the API and handle any network failures. + try { + /** @var ServiceLevelObjective $response */ + $response = $serviceMonitoringServiceClient->createServiceLevelObjective($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + create_service_level_objective_sample($formattedParent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php new file mode 100644 index 00000000000..dd319f9e610 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $serviceMonitoringServiceClient->deleteService($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + delete_service_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_DeleteService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php new file mode 100644 index 00000000000..ca3c8187246 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $serviceMonitoringServiceClient->deleteServiceLevelObjective($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + + delete_service_level_objective_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_DeleteServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php new file mode 100644 index 00000000000..cb12b2fcac7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $serviceMonitoringServiceClient->getService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + get_service_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_GetService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php new file mode 100644 index 00000000000..7bc8c814262 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ServiceLevelObjective $response */ + $response = $serviceMonitoringServiceClient->getServiceLevelObjective($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( + '[PROJECT]', + '[SERVICE]', + '[SERVICE_LEVEL_OBJECTIVE]' + ); + + get_service_level_objective_sample($formattedName); +} +// [END monitoring_v3_generated_ServiceMonitoringService_GetServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php new file mode 100644 index 00000000000..4476bfaaafd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $serviceMonitoringServiceClient->listServiceLevelObjectives($request); + + /** @var ServiceLevelObjective $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); + + list_service_level_objectives_sample($formattedParent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_ListServiceLevelObjectives_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php new file mode 100644 index 00000000000..f1495ce77ad --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php @@ -0,0 +1,80 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $serviceMonitoringServiceClient->listServices($request); + + /** @var Service $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_services_sample($parent); +} +// [END monitoring_v3_generated_ServiceMonitoringService_ListServices_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php new file mode 100644 index 00000000000..1a9fbecdfd9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php @@ -0,0 +1,59 @@ +setService($service); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $serviceMonitoringServiceClient->updateService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_ServiceMonitoringService_UpdateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php new file mode 100644 index 00000000000..30611bd57c1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php @@ -0,0 +1,59 @@ +setServiceLevelObjective($serviceLevelObjective); + + // Call the API and handle any network failures. + try { + /** @var ServiceLevelObjective $response */ + $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_ServiceMonitoringService_UpdateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php new file mode 100644 index 00000000000..f16d2759dbb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php @@ -0,0 +1,99 @@ +setName($snoozeName) + ->setCriteria($snoozeCriteria) + ->setInterval($snoozeInterval) + ->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + + // Call the API and handle any network failures. + try { + /** @var Snooze $response */ + $response = $snoozeServiceClient->createSnooze($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); + $snoozeName = '[NAME]'; + $snoozeDisplayName = '[DISPLAY_NAME]'; + + create_snooze_sample($formattedParent, $snoozeName, $snoozeDisplayName); +} +// [END monitoring_v3_generated_SnoozeService_CreateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php new file mode 100644 index 00000000000..cf467e5c3c3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Snooze $response */ + $response = $snoozeServiceClient->getSnooze($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SnoozeServiceClient::snoozeName('[PROJECT]', '[SNOOZE]'); + + get_snooze_sample($formattedName); +} +// [END monitoring_v3_generated_SnoozeService_GetSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php new file mode 100644 index 00000000000..f0fb94d6601 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $snoozeServiceClient->listSnoozes($request); + + /** @var Snooze $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); + + list_snoozes_sample($formattedParent); +} +// [END monitoring_v3_generated_SnoozeService_ListSnoozes_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php new file mode 100644 index 00000000000..2fa14b61a73 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php @@ -0,0 +1,90 @@ +setName($snoozeName) + ->setCriteria($snoozeCriteria) + ->setInterval($snoozeInterval) + ->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateSnoozeRequest()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Snooze $response */ + $response = $snoozeServiceClient->updateSnooze($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $snoozeName = '[NAME]'; + $snoozeDisplayName = '[DISPLAY_NAME]'; + + update_snooze_sample($snoozeName, $snoozeDisplayName); +} +// [END monitoring_v3_generated_SnoozeService_UpdateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php new file mode 100644 index 00000000000..6ad37bedcda --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php @@ -0,0 +1,76 @@ +setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + + // Call the API and handle any network failures. + try { + /** @var UptimeCheckConfig $response */ + $response = $uptimeCheckServiceClient->createUptimeCheckConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + create_uptime_check_config_sample($parent); +} +// [END monitoring_v3_generated_UptimeCheckService_CreateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php new file mode 100644 index 00000000000..d33f28aec3e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $uptimeCheckServiceClient->deleteUptimeCheckConfig($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( + '[PROJECT]', + '[UPTIME_CHECK_CONFIG]' + ); + + delete_uptime_check_config_sample($formattedName); +} +// [END monitoring_v3_generated_UptimeCheckService_DeleteUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php new file mode 100644 index 00000000000..a3dbc0e2c41 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var UptimeCheckConfig $response */ + $response = $uptimeCheckServiceClient->getUptimeCheckConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( + '[PROJECT]', + '[UPTIME_CHECK_CONFIG]' + ); + + get_uptime_check_config_sample($formattedName); +} +// [END monitoring_v3_generated_UptimeCheckService_GetUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php new file mode 100644 index 00000000000..7a681db4527 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php @@ -0,0 +1,80 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $uptimeCheckServiceClient->listUptimeCheckConfigs($request); + + /** @var UptimeCheckConfig $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_uptime_check_configs_sample($parent); +} +// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckConfigs_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php new file mode 100644 index 00000000000..9d96322e41f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php @@ -0,0 +1,62 @@ +listUptimeCheckIps($request); + + /** @var UptimeCheckIp $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckIps_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php new file mode 100644 index 00000000000..cdef12857a2 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php @@ -0,0 +1,62 @@ +setUptimeCheckConfig($uptimeCheckConfig); + + // Call the API and handle any network failures. + try { + /** @var UptimeCheckConfig $response */ + $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END monitoring_v3_generated_UptimeCheckService_UpdateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php new file mode 100644 index 00000000000..66d3410ff0c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php @@ -0,0 +1,34 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('alertPolicy')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted alert_policy_condition resource. + */ + public static function alertPolicyConditionName(string $project, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('alertPolicyCondition')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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(string $folder, string $alertPolicy): string + { + return self::getPathTemplate('folderAlertPolicy')->render([ + 'folder' => $folder, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * folder_alert_policy_condition resource. + * + * @param string $folder + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted folder_alert_policy_condition resource. + */ + public static function folderAlertPolicyConditionName(string $folder, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('folderAlertPolicyCondition')->render([ + 'folder' => $folder, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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(string $organization, string $alertPolicy): string + { + return self::getPathTemplate('organizationAlertPolicy')->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_alert_policy_condition resource. + * + * @param string $organization + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted organization_alert_policy_condition resource. + */ + public static function organizationAlertPolicyConditionName(string $organization, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('organizationAlertPolicyCondition')->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('projectAlertPolicy')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted project_alert_policy_condition resource. + */ + public static function projectAlertPolicyConditionName(string $project, string $alertPolicy, string $condition): string + { + return self::getPathTemplate('projectAlertPolicyCondition')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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} + * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * + * 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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new alerting policy. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * The async variant is {@see AlertPolicyServiceClient::createAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/create_alert_policy.php + * + * @param CreateAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AlertPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAlertPolicy(CreateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy + { + return $this->startApiCall('CreateAlertPolicy', $request, $callOptions)->wait(); + } + + /** + * Deletes an alerting policy. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * The async variant is {@see AlertPolicyServiceClient::deleteAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/delete_alert_policy.php + * + * @param DeleteAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAlertPolicy(DeleteAlertPolicyRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteAlertPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets a single alerting policy. + * + * The async variant is {@see AlertPolicyServiceClient::getAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/get_alert_policy.php + * + * @param GetAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AlertPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAlertPolicy(GetAlertPolicyRequest $request, array $callOptions = []): AlertPolicy + { + return $this->startApiCall('GetAlertPolicy', $request, $callOptions)->wait(); + } + + /** + * Lists the existing alerting policies for the workspace. + * + * The async variant is {@see AlertPolicyServiceClient::listAlertPoliciesAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/list_alert_policies.php + * + * @param ListAlertPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAlertPolicies(ListAlertPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAlertPolicies', $request, $callOptions); + } + + /** + * 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * The async variant is {@see AlertPolicyServiceClient::updateAlertPolicyAsync()} . + * + * @example samples/V3/AlertPolicyServiceClient/update_alert_policy.php + * + * @param UpdateAlertPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AlertPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAlertPolicy(UpdateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy + { + return $this->startApiCall('UpdateAlertPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php new file mode 100644 index 00000000000..2f50d564b82 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php @@ -0,0 +1,444 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $group): string + { + return self::getPathTemplate('folderGroup')->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(string $project, string $group): string + { + return self::getPathTemplate('group')->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(string $organization, string $group): string + { + return self::getPathTemplate('organizationGroup')->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(string $project, string $group): string + { + return self::getPathTemplate('projectGroup')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new group. + * + * The async variant is {@see GroupServiceClient::createGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/create_group.php + * + * @param CreateGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Group + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGroup(CreateGroupRequest $request, array $callOptions = []): Group + { + return $this->startApiCall('CreateGroup', $request, $callOptions)->wait(); + } + + /** + * Deletes an existing group. + * + * The async variant is {@see GroupServiceClient::deleteGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/delete_group.php + * + * @param DeleteGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGroup(DeleteGroupRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteGroup', $request, $callOptions)->wait(); + } + + /** + * Gets a single group. + * + * The async variant is {@see GroupServiceClient::getGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/get_group.php + * + * @param GetGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Group + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGroup(GetGroupRequest $request, array $callOptions = []): Group + { + return $this->startApiCall('GetGroup', $request, $callOptions)->wait(); + } + + /** + * Lists the monitored resources that are members of a group. + * + * The async variant is {@see GroupServiceClient::listGroupMembersAsync()} . + * + * @example samples/V3/GroupServiceClient/list_group_members.php + * + * @param ListGroupMembersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGroupMembers(ListGroupMembersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGroupMembers', $request, $callOptions); + } + + /** + * Lists the existing groups. + * + * The async variant is {@see GroupServiceClient::listGroupsAsync()} . + * + * @example samples/V3/GroupServiceClient/list_groups.php + * + * @param ListGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGroups(ListGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGroups', $request, $callOptions); + } + + /** + * Updates an existing group. + * You can change any group attributes except `name`. + * + * The async variant is {@see GroupServiceClient::updateGroupAsync()} . + * + * @example samples/V3/GroupServiceClient/update_group.php + * + * @param UpdateGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Group + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGroup(UpdateGroupRequest $request, array $callOptions = []): Group + { + return $this->startApiCall('UpdateGroup', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php new file mode 100644 index 00000000000..84d12bcedab --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php @@ -0,0 +1,675 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder): string + { + return self::getPathTemplate('folder')->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(string $folder, string $metricDescriptor): string + { + return self::getPathTemplate('folderMetricDescriptor')->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(string $folder, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('folderMonitoredResourceDescriptor')->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(string $project, string $metricDescriptor): string + { + return self::getPathTemplate('metricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('monitoredResourceDescriptor')->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(string $organization): string + { + return self::getPathTemplate('organization')->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(string $organization, string $metricDescriptor): string + { + return self::getPathTemplate('organizationMetricDescriptor')->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(string $organization, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('organizationMonitoredResourceDescriptor')->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(string $project): string + { + return self::getPathTemplate('project')->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(string $project, string $metricDescriptor): string + { + return self::getPathTemplate('projectMetricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string + { + return self::getPathTemplate('projectMonitoredResourceDescriptor')->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(string $project): string + { + return self::getPathTemplate('workspace')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new metric descriptor. + * The creation is executed asynchronously. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * The metric descriptor is updated if it already exists, + * except that metric labels are never removed. + * + * The async variant is {@see MetricServiceClient::createMetricDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/create_metric_descriptor.php + * + * @param CreateMetricDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MetricDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function createMetricDescriptor(CreateMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor + { + return $this->startApiCall('CreateMetricDescriptor', $request, $callOptions)->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. + * + * The async variant is {@see MetricServiceClient::createServiceTimeSeriesAsync()} + * . + * + * @example samples/V3/MetricServiceClient/create_service_time_series.php + * + * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function createServiceTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void + { + $this->startApiCall('CreateServiceTimeSeries', $request, $callOptions)->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. + * This method does not support + * [resource locations constraint of an organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + * + * The async variant is {@see MetricServiceClient::createTimeSeriesAsync()} . + * + * @example samples/V3/MetricServiceClient/create_time_series.php + * + * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function createTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void + { + $this->startApiCall('CreateTimeSeries', $request, $callOptions)->wait(); + } + + /** + * Deletes a metric descriptor. Only user-created + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + * deleted. + * + * The async variant is {@see MetricServiceClient::deleteMetricDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/delete_metric_descriptor.php + * + * @param DeleteMetricDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteMetricDescriptor(DeleteMetricDescriptorRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteMetricDescriptor', $request, $callOptions)->wait(); + } + + /** + * Gets a single metric descriptor. + * + * The async variant is {@see MetricServiceClient::getMetricDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/get_metric_descriptor.php + * + * @param GetMetricDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MetricDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMetricDescriptor(GetMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor + { + return $this->startApiCall('GetMetricDescriptor', $request, $callOptions)->wait(); + } + + /** + * Gets a single monitored resource descriptor. + * + * The async variant is + * {@see MetricServiceClient::getMonitoredResourceDescriptorAsync()} . + * + * @example samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php + * + * @param GetMonitoredResourceDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MonitoredResourceDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest $request, array $callOptions = []): MonitoredResourceDescriptor + { + return $this->startApiCall('GetMonitoredResourceDescriptor', $request, $callOptions)->wait(); + } + + /** + * Lists metric descriptors that match a filter. + * + * The async variant is {@see MetricServiceClient::listMetricDescriptorsAsync()} . + * + * @example samples/V3/MetricServiceClient/list_metric_descriptors.php + * + * @param ListMetricDescriptorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMetricDescriptors(ListMetricDescriptorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMetricDescriptors', $request, $callOptions); + } + + /** + * Lists monitored resource descriptors that match a filter. + * + * The async variant is + * {@see MetricServiceClient::listMonitoredResourceDescriptorsAsync()} . + * + * @example samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php + * + * @param ListMonitoredResourceDescriptorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMonitoredResourceDescriptors', $request, $callOptions); + } + + /** + * Lists time series that match a filter. + * + * The async variant is {@see MetricServiceClient::listTimeSeriesAsync()} . + * + * @example samples/V3/MetricServiceClient/list_time_series.php + * + * @param ListTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTimeSeries(ListTimeSeriesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTimeSeries', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php new file mode 100644 index 00000000000..20f4631ad33 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php @@ -0,0 +1,679 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $channelDescriptor): string + { + return self::getPathTemplate('folderChannelDescriptor')->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(string $folder, string $notificationChannel): string + { + return self::getPathTemplate('folderNotificationChannel')->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(string $project, string $notificationChannel): string + { + return self::getPathTemplate('notificationChannel')->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(string $project, string $channelDescriptor): string + { + return self::getPathTemplate('notificationChannelDescriptor')->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(string $organization, string $channelDescriptor): string + { + return self::getPathTemplate('organizationChannelDescriptor')->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(string $organization, string $notificationChannel): string + { + return self::getPathTemplate('organizationNotificationChannel')->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(string $project, string $channelDescriptor): string + { + return self::getPathTemplate('projectChannelDescriptor')->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(string $project, string $notificationChannel): string + { + return self::getPathTemplate('projectNotificationChannel')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new notification channel, representing a single notification + * endpoint such as an email address, SMS number, or PagerDuty service. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * The async variant is + * {@see NotificationChannelServiceClient::createNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/create_notification_channel.php + * + * @param CreateNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function createNotificationChannel(CreateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('CreateNotificationChannel', $request, $callOptions)->wait(); + } + + /** + * Deletes a notification channel. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * The async variant is + * {@see NotificationChannelServiceClient::deleteNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/delete_notification_channel.php + * + * @param DeleteNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteNotificationChannel(DeleteNotificationChannelRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteNotificationChannel', $request, $callOptions)->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. + * + * The async variant is + * {@see NotificationChannelServiceClient::getNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/get_notification_channel.php + * + * @param GetNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNotificationChannel(GetNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('GetNotificationChannel', $request, $callOptions)->wait(); + } + + /** + * Gets a single channel descriptor. The descriptor indicates which fields + * are expected / permitted for a notification channel of the given type. + * + * The async variant is + * {@see NotificationChannelServiceClient::getNotificationChannelDescriptorAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php + * + * @param GetNotificationChannelDescriptorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannelDescriptor + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNotificationChannelDescriptor(GetNotificationChannelDescriptorRequest $request, array $callOptions = []): NotificationChannelDescriptor + { + return $this->startApiCall('GetNotificationChannelDescriptor', $request, $callOptions)->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. + * + * The async variant is + * {@see NotificationChannelServiceClient::getNotificationChannelVerificationCodeAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php + * + * @param GetNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GetNotificationChannelVerificationCodeResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNotificationChannelVerificationCode(GetNotificationChannelVerificationCodeRequest $request, array $callOptions = []): GetNotificationChannelVerificationCodeResponse + { + return $this->startApiCall('GetNotificationChannelVerificationCode', $request, $callOptions)->wait(); + } + + /** + * Lists the descriptors for supported channel types. The use of descriptors + * makes it possible for new channel types to be dynamically added. + * + * The async variant is + * {@see NotificationChannelServiceClient::listNotificationChannelDescriptorsAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php + * + * @param ListNotificationChannelDescriptorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNotificationChannelDescriptors(ListNotificationChannelDescriptorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNotificationChannelDescriptors', $request, $callOptions); + } + + /** + * Lists the notification channels that have been created for the project. + * To list the types of notification channels that are supported, use + * the `ListNotificationChannelDescriptors` method. + * + * The async variant is + * {@see NotificationChannelServiceClient::listNotificationChannelsAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/list_notification_channels.php + * + * @param ListNotificationChannelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNotificationChannels(ListNotificationChannelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNotificationChannels', $request, $callOptions); + } + + /** + * Causes a verification code to be delivered to the channel. The code + * can then be supplied in `VerifyNotificationChannel` to verify the channel. + * + * The async variant is + * {@see NotificationChannelServiceClient::sendNotificationChannelVerificationCodeAsync()} + * . + * + * @example samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php + * + * @param SendNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function sendNotificationChannelVerificationCode(SendNotificationChannelVerificationCodeRequest $request, array $callOptions = []): void + { + $this->startApiCall('SendNotificationChannelVerificationCode', $request, $callOptions)->wait(); + } + + /** + * Updates a notification channel. Fields not specified in the field mask + * remain unchanged. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * The async variant is + * {@see NotificationChannelServiceClient::updateNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/update_notification_channel.php + * + * @param UpdateNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateNotificationChannel(UpdateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('UpdateNotificationChannel', $request, $callOptions)->wait(); + } + + /** + * Verifies a `NotificationChannel` by proving receipt of the code + * delivered to the channel as a result of calling + * `SendNotificationChannelVerificationCode`. + * + * The async variant is + * {@see NotificationChannelServiceClient::verifyNotificationChannelAsync()} . + * + * @example samples/V3/NotificationChannelServiceClient/verify_notification_channel.php + * + * @param VerifyNotificationChannelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationChannel + * + * @throws ApiException Thrown if the API call fails. + */ + public function verifyNotificationChannel(VerifyNotificationChannelRequest $request, array $callOptions = []): NotificationChannel + { + return $this->startApiCall('VerifyNotificationChannel', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php new file mode 100644 index 00000000000..81a5eab5b18 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php @@ -0,0 +1,193 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Queries time series using Monitoring Query Language. + * + * The async variant is {@see QueryServiceClient::queryTimeSeriesAsync()} . + * + * @example samples/V3/QueryServiceClient/query_time_series.php + * + * @param QueryTimeSeriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function queryTimeSeries(QueryTimeSeriesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('QueryTimeSeries', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php new file mode 100644 index 00000000000..ec9bb443cf7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php @@ -0,0 +1,635 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $service): string + { + return self::getPathTemplate('folderService')->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(string $folder, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('folderServiceServiceLevelObjective')->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(string $organization, string $service): string + { + return self::getPathTemplate('organizationService')->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(string $organization, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('organizationServiceServiceLevelObjective')->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(string $project, string $service): string + { + return self::getPathTemplate('projectService')->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(string $project, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('projectServiceServiceLevelObjective')->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(string $project, string $service): string + { + return self::getPathTemplate('service')->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(string $project, string $service, string $serviceLevelObjective): string + { + return self::getPathTemplate('serviceLevelObjective')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Create a `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::createServiceAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/create_service.php + * + * @param CreateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function createService(CreateServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('CreateService', $request, $callOptions)->wait(); + } + + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::createServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php + * + * @param CreateServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ServiceLevelObjective + * + * @throws ApiException Thrown if the API call fails. + */ + public function createServiceLevelObjective(CreateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective + { + return $this->startApiCall('CreateServiceLevelObjective', $request, $callOptions)->wait(); + } + + /** + * Soft delete this `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::deleteServiceAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/delete_service.php + * + * @param DeleteServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteService(DeleteServiceRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteService', $request, $callOptions)->wait(); + } + + /** + * Delete the given `ServiceLevelObjective`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::deleteServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php + * + * @param DeleteServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteServiceLevelObjective', $request, $callOptions)->wait(); + } + + /** + * Get the named `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::getServiceAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/get_service.php + * + * @param GetServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function getService(GetServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('GetService', $request, $callOptions)->wait(); + } + + /** + * Get a `ServiceLevelObjective` by name. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::getServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php + * + * @param GetServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ServiceLevelObjective + * + * @throws ApiException Thrown if the API call fails. + */ + public function getServiceLevelObjective(GetServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective + { + return $this->startApiCall('GetServiceLevelObjective', $request, $callOptions)->wait(); + } + + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::listServiceLevelObjectivesAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php + * + * @param ListServiceLevelObjectivesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServiceLevelObjectives(ListServiceLevelObjectivesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServiceLevelObjectives', $request, $callOptions); + } + + /** + * List `Service`s for this Metrics Scope. + * + * The async variant is {@see ServiceMonitoringServiceClient::listServicesAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/list_services.php + * + * @param ListServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServices', $request, $callOptions); + } + + /** + * Update this `Service`. + * + * The async variant is {@see ServiceMonitoringServiceClient::updateServiceAsync()} + * . + * + * @example samples/V3/ServiceMonitoringServiceClient/update_service.php + * + * @param UpdateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateService(UpdateServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); + } + + /** + * Update the given `ServiceLevelObjective`. + * + * The async variant is + * {@see ServiceMonitoringServiceClient::updateServiceLevelObjectiveAsync()} . + * + * @example samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php + * + * @param UpdateServiceLevelObjectiveRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ServiceLevelObjective + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective + { + return $this->startApiCall('UpdateServiceLevelObjective', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php new file mode 100644 index 00000000000..e41cf63ae34 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php @@ -0,0 +1,434 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snooze_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('alertPolicy')->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(string $folder, string $alertPolicy): string + { + return self::getPathTemplate('folderAlertPolicy')->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(string $organization, string $alertPolicy): string + { + return self::getPathTemplate('organizationAlertPolicy')->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * 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(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * 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(string $project, string $alertPolicy): string + { + return self::getPathTemplate('projectAlertPolicy')->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a snooze + * resource. + * + * @param string $project + * @param string $snooze + * + * @return string The formatted snooze resource. + */ + public static function snoozeName(string $project, string $snooze): string + { + return self::getPathTemplate('snooze')->render([ + 'project' => $project, + 'snooze' => $snooze, + ]); + } + + /** + * 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(string $project): string + { + return self::getPathTemplate('workspace')->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 + * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - project: projects/{project} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - snooze: projects/{project}/snoozes/{snooze} + * - 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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a `Snooze` that will prevent alerts, which match the provided + * criteria, from being opened. The `Snooze` applies for a specific time + * interval. + * + * The async variant is {@see SnoozeServiceClient::createSnoozeAsync()} . + * + * @example samples/V3/SnoozeServiceClient/create_snooze.php + * + * @param CreateSnoozeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snooze + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSnooze(CreateSnoozeRequest $request, array $callOptions = []): Snooze + { + return $this->startApiCall('CreateSnooze', $request, $callOptions)->wait(); + } + + /** + * Retrieves a `Snooze` by `name`. + * + * The async variant is {@see SnoozeServiceClient::getSnoozeAsync()} . + * + * @example samples/V3/SnoozeServiceClient/get_snooze.php + * + * @param GetSnoozeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snooze + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSnooze(GetSnoozeRequest $request, array $callOptions = []): Snooze + { + return $this->startApiCall('GetSnooze', $request, $callOptions)->wait(); + } + + /** + * Lists the `Snooze`s associated with a project. Can optionally pass in + * `filter`, which specifies predicates to match `Snooze`s. + * + * The async variant is {@see SnoozeServiceClient::listSnoozesAsync()} . + * + * @example samples/V3/SnoozeServiceClient/list_snoozes.php + * + * @param ListSnoozesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSnoozes(ListSnoozesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSnoozes', $request, $callOptions); + } + + /** + * Updates a `Snooze`, identified by its `name`, with the parameters in the + * given `Snooze` object. + * + * The async variant is {@see SnoozeServiceClient::updateSnoozeAsync()} . + * + * @example samples/V3/SnoozeServiceClient/update_snooze.php + * + * @param UpdateSnoozeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snooze + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSnooze(UpdateSnoozeRequest $request, array $callOptions = []): Snooze + { + return $this->startApiCall('UpdateSnooze', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php new file mode 100644 index 00000000000..f80c8f32665 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php @@ -0,0 +1,451 @@ + self::SERVICE_NAME, + 'apiEndpoint' => 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', + ], + ], + ]; + } + + /** + * 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(string $folder, string $uptimeCheckConfig): string + { + return self::getPathTemplate('folderUptimeCheckConfig')->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(string $organization, string $uptimeCheckConfig): string + { + return self::getPathTemplate('organizationUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string + { + return self::getPathTemplate('projectUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string + { + return self::getPathTemplate('uptimeCheckConfig')->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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * 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 + * $apiEndpoint 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new Uptime check configuration. + * + * The async variant is + * {@see UptimeCheckServiceClient::createUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php + * + * @param CreateUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UptimeCheckConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function createUptimeCheckConfig(CreateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig + { + return $this->startApiCall('CreateUptimeCheckConfig', $request, $callOptions)->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. + * + * The async variant is + * {@see UptimeCheckServiceClient::deleteUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php + * + * @param DeleteUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteUptimeCheckConfig', $request, $callOptions)->wait(); + } + + /** + * Gets a single Uptime check configuration. + * + * The async variant is + * {@see UptimeCheckServiceClient::getUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php + * + * @param GetUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UptimeCheckConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getUptimeCheckConfig(GetUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig + { + return $this->startApiCall('GetUptimeCheckConfig', $request, $callOptions)->wait(); + } + + /** + * Lists the existing valid Uptime check configurations for the project + * (leaving out any invalid configurations). + * + * The async variant is + * {@see UptimeCheckServiceClient::listUptimeCheckConfigsAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php + * + * @param ListUptimeCheckConfigsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listUptimeCheckConfigs(ListUptimeCheckConfigsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUptimeCheckConfigs', $request, $callOptions); + } + + /** + * Returns the list of IP addresses that checkers run from + * + * The async variant is {@see UptimeCheckServiceClient::listUptimeCheckIpsAsync()} + * . + * + * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php + * + * @param ListUptimeCheckIpsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listUptimeCheckIps(ListUptimeCheckIpsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUptimeCheckIps', $request, $callOptions); + } + + /** + * 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. + * + * The async variant is + * {@see UptimeCheckServiceClient::updateUptimeCheckConfigAsync()} . + * + * @example samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php + * + * @param UpdateUptimeCheckConfigRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UptimeCheckConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateUptimeCheckConfig(UpdateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig + { + return $this->startApiCall('UpdateUptimeCheckConfig', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php new file mode 100644 index 00000000000..b21dfc9d265 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php @@ -0,0 +1,806 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\AlertPolicyServiceClient}. + */ +class AlertPolicyServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.AlertPolicyService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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 $alertPolicyConditionNameTemplate; + + private static $folderAlertPolicyNameTemplate; + + private static $folderAlertPolicyConditionNameTemplate; + + private static $organizationAlertPolicyNameTemplate; + + private static $organizationAlertPolicyConditionNameTemplate; + + private static $projectAlertPolicyNameTemplate; + + private static $projectAlertPolicyConditionNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => 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 getAlertPolicyConditionNameTemplate() + { + if (self::$alertPolicyConditionNameTemplate == null) { + self::$alertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$alertPolicyConditionNameTemplate; + } + + private static function getFolderAlertPolicyNameTemplate() + { + if (self::$folderAlertPolicyNameTemplate == null) { + self::$folderAlertPolicyNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}'); + } + + return self::$folderAlertPolicyNameTemplate; + } + + private static function getFolderAlertPolicyConditionNameTemplate() + { + if (self::$folderAlertPolicyConditionNameTemplate == null) { + self::$folderAlertPolicyConditionNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$folderAlertPolicyConditionNameTemplate; + } + + private static function getOrganizationAlertPolicyNameTemplate() + { + if (self::$organizationAlertPolicyNameTemplate == null) { + self::$organizationAlertPolicyNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}'); + } + + return self::$organizationAlertPolicyNameTemplate; + } + + private static function getOrganizationAlertPolicyConditionNameTemplate() + { + if (self::$organizationAlertPolicyConditionNameTemplate == null) { + self::$organizationAlertPolicyConditionNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$organizationAlertPolicyConditionNameTemplate; + } + + private static function getProjectAlertPolicyNameTemplate() + { + if (self::$projectAlertPolicyNameTemplate == null) { + self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); + } + + return self::$projectAlertPolicyNameTemplate; + } + + private static function getProjectAlertPolicyConditionNameTemplate() + { + if (self::$projectAlertPolicyConditionNameTemplate == null) { + self::$projectAlertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); + } + + return self::$projectAlertPolicyConditionNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'alertPolicy' => self::getAlertPolicyNameTemplate(), + 'alertPolicyCondition' => self::getAlertPolicyConditionNameTemplate(), + 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), + 'folderAlertPolicyCondition' => self::getFolderAlertPolicyConditionNameTemplate(), + 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), + 'organizationAlertPolicyCondition' => self::getOrganizationAlertPolicyConditionNameTemplate(), + 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), + 'projectAlertPolicyCondition' => self::getProjectAlertPolicyConditionNameTemplate(), + ]; + } + + 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 + * alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted alert_policy_condition resource. + */ + public static function alertPolicyConditionName($project, $alertPolicy, $condition) + { + return self::getAlertPolicyConditionNameTemplate()->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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 + * folder_alert_policy_condition resource. + * + * @param string $folder + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted folder_alert_policy_condition resource. + */ + public static function folderAlertPolicyConditionName($folder, $alertPolicy, $condition) + { + return self::getFolderAlertPolicyConditionNameTemplate()->render([ + 'folder' => $folder, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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 + * organization_alert_policy_condition resource. + * + * @param string $organization + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted organization_alert_policy_condition resource. + */ + public static function organizationAlertPolicyConditionName($organization, $alertPolicy, $condition) + { + return self::getOrganizationAlertPolicyConditionNameTemplate()->render([ + 'organization' => $organization, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_alert_policy_condition resource. + * + * @param string $project + * @param string $alertPolicy + * @param string $condition + * + * @return string The formatted project_alert_policy_condition resource. + */ + public static function projectAlertPolicyConditionName($project, $alertPolicy, $condition) + { + return self::getProjectAlertPolicyConditionNameTemplate()->render([ + 'project' => $project, + 'alert_policy' => $alertPolicy, + 'condition' => $condition, + ]); + } + + /** + * 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} + * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} + * + * 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * 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 Metrics Scope, 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * alerting policies in a single project. This includes calls to + * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..04306c6bc04 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php @@ -0,0 +1,752 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\GroupServiceClient}. + */ +class GroupServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.GroupService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..ca515984779 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php @@ -0,0 +1,1178 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\MetricServiceClient}. + */ +class MetricServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.MetricService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * The metric descriptor is updated if it already exists, + * except that metric labels are never removed. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * This method does not support + * [resource locations constraint of an organization + * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..0661a3c04e3 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php @@ -0,0 +1,1075 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient}. + */ +class NotificationChannelServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.NotificationChannelService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * To list the types of notification channels that are supported, use + * the `ListNotificationChannelDescriptors` method. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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. + * + * Design your application to single-thread API calls that modify the state of + * notification channels in a single project. This includes calls to + * CreateNotificationChannel, DeleteNotificationChannel and + * UpdateNotificationChannel. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..b083925f4ba --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php @@ -0,0 +1,256 @@ +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(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\QueryServiceClient}. + */ +class QueryServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.QueryService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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. + * + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..c7cc9a8589b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php @@ -0,0 +1,1044 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\ServiceMonitoringServiceClient}. + */ +class ServiceMonitoringServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.ServiceMonitoringService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 Metrics Scope. 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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-zA-Z0-9-_:.]+$` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 Metrics Scope. 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 Metrics Scope. + * + * 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 Metrics Scope. 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 supports + * filtering on a particular service-identifier type or one of its attributes. + * + * To filter on a particular service-identifier type, the `identifier_case` + * refers to which option in the `identifier` field is populated. For example, + * the filter `identifier_case = "CUSTOM"` would match all services with a + * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", + * "MESH_ISTIO", and the other options listed at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * + * To filter on an attribute of a service-identifier type, apply the filter + * name by using the snake case of the service-identifier type and the + * attribute of that service-identifier type, and join the two with a period. + * For example, to filter by the `meshUid` field of the `MeshIstio` + * service-identifier type, you must filter on `mesh_istio.mesh_uid = + * "123"` to match all services with mesh UID "123". Service-identifier types + * and their attributes are described at + * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service + * @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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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/SnoozeServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php new file mode 100644 index 00000000000..08c130e17a0 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php @@ -0,0 +1,680 @@ +workspaceName('[PROJECT]'); + * $snooze = new Snooze(); + * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); + * } finally { + * $snoozeServiceClient->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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\SnoozeServiceClient}. + */ +class SnoozeServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.SnoozeService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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 $projectNameTemplate; + + private static $projectAlertPolicyNameTemplate; + + private static $snoozeNameTemplate; + + private static $workspaceNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snooze_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 getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getProjectAlertPolicyNameTemplate() + { + if (self::$projectAlertPolicyNameTemplate == null) { + self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); + } + + return self::$projectAlertPolicyNameTemplate; + } + + private static function getSnoozeNameTemplate() + { + if (self::$snoozeNameTemplate == null) { + self::$snoozeNameTemplate = new PathTemplate('projects/{project}/snoozes/{snooze}'); + } + + return self::$snoozeNameTemplate; + } + + 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 = [ + 'alertPolicy' => self::getAlertPolicyNameTemplate(), + 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), + 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), + 'project' => self::getProjectNameTemplate(), + 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), + 'snooze' => self::getSnoozeNameTemplate(), + 'workspace' => self::getWorkspaceNameTemplate(), + ]; + } + + 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 + * 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_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, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a snooze + * resource. + * + * @param string $project + * @param string $snooze + * + * @return string The formatted snooze resource. + */ + public static function snoozeName($project, $snooze) + { + return self::getSnoozeNameTemplate()->render([ + 'project' => $project, + 'snooze' => $snooze, + ]); + } + + /** + * 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 + * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - project: projects/{project} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} + * - snooze: projects/{project}/snoozes/{snooze} + * - 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 $apiEndpoint + * 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 + * $apiEndpoint 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 `Snooze` that will prevent alerts, which match the provided + * criteria, from being opened. The `Snooze` applies for a specific time + * interval. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); + * $snooze = new Snooze(); + * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which + * a `Snooze` should be created. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be + * filled in by the API. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Snooze + * + * @throws ApiException if the remote call fails + */ + public function createSnooze($parent, $snooze, array $optionalArgs = []) + { + $request = new CreateSnoozeRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setSnooze($snooze); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateSnooze', Snooze::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a `Snooze` by `name`. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $formattedName = $snoozeServiceClient->snoozeName('[PROJECT]', '[SNOOZE]'); + * $response = $snoozeServiceClient->getSnooze($formattedName); + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Snooze + * + * @throws ApiException if the remote call fails + */ + public function getSnooze($name, array $optionalArgs = []) + { + $request = new GetSnoozeRequest(); + $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('GetSnooze', Snooze::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the `Snooze`s associated with a project. Can optionally pass in + * `filter`, which specifies predicates to match `Snooze`s. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); + * // Iterate over pages of elements + * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The + * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose + * `Snooze`s should be listed. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * Optional. Optional filter to restrict results to the given criteria. The + * following fields are supported. + * + * * `interval.start_time` + * * `interval.end_time` + * + * For example: + * + * ``` + * interval.start_time > "2022-03-11T00:00:00-08:00" AND + * interval.end_time < "2022-03-12T00:00:00-08:00" + * ``` + * @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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listSnoozes($parent, array $optionalArgs = []) + { + $request = new ListSnoozesRequest(); + $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('ListSnoozes', $optionalArgs, ListSnoozesResponse::class, $request); + } + + /** + * Updates a `Snooze`, identified by its `name`, with the parameters in the + * given `Snooze` object. + * + * Sample code: + * ``` + * $snoozeServiceClient = new SnoozeServiceClient(); + * try { + * $snooze = new Snooze(); + * $updateMask = new FieldMask(); + * $response = $snoozeServiceClient->updateSnooze($snooze, $updateMask); + * } finally { + * $snoozeServiceClient->close(); + * } + * ``` + * + * @param Snooze $snooze Required. The `Snooze` to update. Must have the name field present. + * @param FieldMask $updateMask Required. The fields to update. + * + * For each field listed in `update_mask`: + * + * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a + * value for that field, the value of the field in the existing `Snooze` + * will be set to the value of the field in the supplied `Snooze`. + * * If the field does not have a value in the supplied `Snooze`, the field + * in the existing `Snooze` is set to its default value. + * + * Fields not listed retain their existing value. + * + * The following are the field names that are accepted in `update_mask`: + * + * * `display_name` + * * `interval.start_time` + * * `interval.end_time` + * + * That said, the start time and end time of the `Snooze` determines which + * fields can legally be updated. Before attempting an update, users should + * consult the documentation for `UpdateSnoozeRequest`, which talks about + * which fields can be updated. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Snooze + * + * @throws ApiException if the remote call fails + */ + public function updateSnooze($snooze, $updateMask, array $optionalArgs = []) + { + $request = new UpdateSnoozeRequest(); + $requestParamHeaders = []; + $request->setSnooze($snooze); + $request->setUpdateMask($updateMask); + $requestParamHeaders['snooze.name'] = $snooze->getName(); + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateSnooze', Snooze::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..5cdb98a3e21 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php @@ -0,0 +1,692 @@ +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. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\UptimeCheckServiceClient}. + */ +class UptimeCheckServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.monitoring.v3.UptimeCheckService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'monitoring.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; + + /** 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, + 'apiEndpoint' => 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 $apiEndpoint + * 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 + * $apiEndpoint 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 string $filter + * If provided, this field specifies the criteria that must be met by + * uptime checks to be included in the response. + * + * For more details, see [Filtering + * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). + * @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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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['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('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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 corresponding 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..c8b5d43074e --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php @@ -0,0 +1,34 @@ + [ + 'google.monitoring.v3.AlertPolicyService' => [ + 'CreateAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAlertPolicies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAlertPolicies', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListAlertPoliciesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateAlertPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', + 'headerParams' => [ + [ + 'keyName' => 'alert_policy.name', + 'fieldAccessors' => [ + 'getAlertPolicy', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'alertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', + 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', + 'folderAlertPolicyCondition' => 'folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}', + 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', + 'organizationAlertPolicyCondition' => 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}', + 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'projectAlertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', + ], + ], + ], +]; 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..bb65ee95b1d --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php @@ -0,0 +1,87 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..dba3498cf7f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php @@ -0,0 +1,123 @@ + [ + 'google.monitoring.v3.GroupService' => [ + 'CreateGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Group', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Group', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGroupMembers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMembers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupMembersResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListGroups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGroup', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Group', + 'headerParams' => [ + [ + 'keyName' => 'group.name', + 'fieldAccessors' => [ + 'getGroup', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'folderGroup' => 'folders/{folder}/groups/{group}', + 'group' => 'projects/{project}/groups/{group}', + 'organizationGroup' => 'organizations/{organization}/groups/{group}', + 'projectGroup' => 'projects/{project}/groups/{group}', + ], + ], + ], +]; 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..1ec3e238ee1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php @@ -0,0 +1,98 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..7b8896801eb --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php @@ -0,0 +1,174 @@ + [ + 'google.monitoring.v3.MetricService' => [ + 'CreateMetricDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\MetricDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateServiceTimeSeries' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateTimeSeries' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMetricDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMetricDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\MetricDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMonitoredResourceDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Api\MonitoredResourceDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListMetricDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMetricDescriptors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListMetricDescriptorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListMonitoredResourceDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResourceDescriptors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTimeSeries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTimeSeries', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListTimeSeriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..0367626add5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php @@ -0,0 +1,156 @@ + [ + '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', + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..6088b2f89bf --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php @@ -0,0 +1,175 @@ + [ + 'google.monitoring.v3.NotificationChannelService' => [ + 'CreateNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannelDescriptor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannelDescriptor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNotificationChannelVerificationCode' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationChannelDescriptors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getChannelDescriptors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListNotificationChannels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNotificationChannels', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SendNotificationChannelVerificationCode' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'notification_channel.name', + 'fieldAccessors' => [ + 'getNotificationChannel', + 'getName', + ], + ], + ], + ], + 'VerifyNotificationChannel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..822c7ebc934 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php @@ -0,0 +1,145 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..4b6dc680ebc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php @@ -0,0 +1,48 @@ + [ + 'google.monitoring.v3.QueryService' => [ + 'QueryTimeSeries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTimeSeriesData', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\QueryTimeSeriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; 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..38b688dbab5 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php @@ -0,0 +1,41 @@ + [ + 'google.monitoring.v3.QueryService' => [ + 'QueryTimeSeries' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries:query', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..739ca870934 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php @@ -0,0 +1,176 @@ + [ + 'google.monitoring.v3.ServiceMonitoringService' => [ + 'CreateService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Service', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Service', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListServiceLevelObjectives' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServiceLevelObjectives', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServices', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListServicesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Service', + 'headerParams' => [ + [ + 'keyName' => 'service.name', + 'fieldAccessors' => [ + 'getService', + 'getName', + ], + ], + ], + ], + 'UpdateServiceLevelObjective' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', + 'headerParams' => [ + [ + 'keyName' => 'service_level_objective.name', + 'fieldAccessors' => [ + 'getServiceLevelObjective', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..f7ca03dded7 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php @@ -0,0 +1,145 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json new file mode 100644 index 00000000000..0acb65e12bd --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.monitoring.v3.SnoozeService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_9_codes": [ + "UNAVAILABLE" + ], + "no_retry_7_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_9_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_7_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": { + "CreateSnooze": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_7_codes", + "retry_params_name": "no_retry_7_params" + }, + "GetSnooze": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_9_codes", + "retry_params_name": "retry_policy_9_params" + }, + "ListSnoozes": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_9_codes", + "retry_params_name": "retry_policy_9_params" + }, + "UpdateSnooze": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_7_codes", + "retry_params_name": "no_retry_7_params" + } + } + } + } +} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php new file mode 100644 index 00000000000..57e5c8ab386 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php @@ -0,0 +1,94 @@ + [ + 'google.monitoring.v3.SnoozeService' => [ + 'CreateSnooze' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetSnooze' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSnoozes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSnoozes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListSnoozesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSnooze' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', + 'headerParams' => [ + [ + 'keyName' => 'snooze.name', + 'fieldAccessors' => [ + 'getSnooze', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', + 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', + 'project' => 'projects/{project}', + 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', + 'snooze' => 'projects/{project}/snoozes/{snooze}', + 'workspace' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php new file mode 100644 index 00000000000..a3b5e3574b8 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php @@ -0,0 +1,79 @@ + [ + 'google.monitoring.v3.SnoozeService' => [ + 'CreateSnooze' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', + 'body' => 'snooze', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetSnooze' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/snoozes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSnoozes' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSnooze' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{snooze.name=projects/*/snoozes/*}', + 'body' => 'snooze', + 'placeholders' => [ + 'snooze.name' => [ + 'getters' => [ + 'getSnooze', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..a9dbc7aa781 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php @@ -0,0 +1,115 @@ + [ + 'google.monitoring.v3.UptimeCheckService' => [ + 'CreateUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListUptimeCheckConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUptimeCheckConfigs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListUptimeCheckIps' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUptimeCheckIps', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckIpsResponse', + ], + 'UpdateUptimeCheckConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', + 'headerParams' => [ + [ + 'keyName' => 'uptime_check_config.name', + 'fieldAccessors' => [ + 'getUptimeCheckConfig', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + '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}', + ], + ], + ], +]; 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..4c50c3cd46b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php @@ -0,0 +1,91 @@ + [ + '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', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; 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..9811f18bd6f --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php @@ -0,0 +1,380 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createAlertPolicy($name, $alertPolicy); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + try { + $gapicClient->deleteAlertPolicy($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + try { + $gapicClient->getAlertPolicy($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listAlertPolicies($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateAlertPolicy($alertPolicy); + // If the $gapicClient 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/Client/AlertPolicyServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php new file mode 100644 index 00000000000..498d9a5be07 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php @@ -0,0 +1,442 @@ +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(); + $gapicClient = $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(); + $request = (new CreateAlertPolicyRequest()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + $response = $gapicClient->createAlertPolicy($request); + $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(); + $gapicClient = $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(); + $request = (new CreateAlertPolicyRequest()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + try { + $gapicClient->createAlertPolicy($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new DeleteAlertPolicyRequest()) + ->setName($formattedName); + $gapicClient->deleteAlertPolicy($request); + $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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new DeleteAlertPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteAlertPolicy($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new GetAlertPolicyRequest()) + ->setName($formattedName); + $response = $gapicClient->getAlertPolicy($request); + $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(); + $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $request = (new GetAlertPolicyRequest()) + ->setName($formattedName); + try { + $gapicClient->getAlertPolicy($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListAlertPoliciesRequest()) + ->setName($name); + $response = $gapicClient->listAlertPolicies($request); + $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(); + $gapicClient = $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'; + $request = (new ListAlertPoliciesRequest()) + ->setName($name); + try { + $gapicClient->listAlertPolicies($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateAlertPolicyRequest()) + ->setAlertPolicy($alertPolicy); + $response = $gapicClient->updateAlertPolicy($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateAlertPolicyRequest()) + ->setAlertPolicy($alertPolicy); + try { + $gapicClient->updateAlertPolicy($request); + // If the $gapicClient 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 createAlertPolicyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateAlertPolicyRequest()) + ->setName($name) + ->setAlertPolicy($alertPolicy); + $response = $gapicClient->createAlertPolicyAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php new file mode 100644 index 00000000000..5e7c3024f3a --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php @@ -0,0 +1,541 @@ +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(); + $gapicClient = $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(); + $request = (new CreateGroupRequest()) + ->setName($name) + ->setGroup($group); + $response = $gapicClient->createGroup($request); + $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(); + $gapicClient = $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(); + $request = (new CreateGroupRequest()) + ->setName($name) + ->setGroup($group); + try { + $gapicClient->createGroup($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new DeleteGroupRequest()) + ->setName($formattedName); + $gapicClient->deleteGroup($request); + $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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new DeleteGroupRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteGroup($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new GetGroupRequest()) + ->setName($formattedName); + $response = $gapicClient->getGroup($request); + $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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new GetGroupRequest()) + ->setName($formattedName); + try { + $gapicClient->getGroup($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new ListGroupMembersRequest()) + ->setName($formattedName); + $response = $gapicClient->listGroupMembers($request); + $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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $request = (new ListGroupMembersRequest()) + ->setName($formattedName); + try { + $gapicClient->listGroupMembers($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListGroupsRequest()) + ->setName($name); + $response = $gapicClient->listGroups($request); + $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(); + $gapicClient = $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'; + $request = (new ListGroupsRequest()) + ->setName($name); + try { + $gapicClient->listGroups($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateGroupRequest()) + ->setGroup($group); + $response = $gapicClient->updateGroup($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateGroupRequest()) + ->setGroup($group); + try { + $gapicClient->updateGroup($request); + // If the $gapicClient 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 createGroupAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateGroupRequest()) + ->setName($name) + ->setGroup($group); + $response = $gapicClient->createGroupAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php new file mode 100644 index 00000000000..8a38d03c86b --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php @@ -0,0 +1,769 @@ +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(); + $gapicClient = $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(); + $request = (new CreateMetricDescriptorRequest()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + $response = $gapicClient->createMetricDescriptor($request); + $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(); + $gapicClient = $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(); + $request = (new CreateMetricDescriptorRequest()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + try { + $gapicClient->createMetricDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + $gapicClient->createServiceTimeSeries($request); + $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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + try { + $gapicClient->createServiceTimeSeries($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + $gapicClient->createTimeSeries($request); + $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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $request = (new CreateTimeSeriesRequest()) + ->setName($formattedName) + ->setTimeSeries($timeSeries); + try { + $gapicClient->createTimeSeries($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new DeleteMetricDescriptorRequest()) + ->setName($formattedName); + $gapicClient->deleteMetricDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new DeleteMetricDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteMetricDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new GetMetricDescriptorRequest()) + ->setName($formattedName); + $response = $gapicClient->getMetricDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $request = (new GetMetricDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->getMetricDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $request = (new GetMonitoredResourceDescriptorRequest()) + ->setName($formattedName); + $response = $gapicClient->getMonitoredResourceDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $request = (new GetMonitoredResourceDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->getMonitoredResourceDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListMetricDescriptorsRequest()) + ->setName($name); + $response = $gapicClient->listMetricDescriptors($request); + $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(); + $gapicClient = $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'; + $request = (new ListMetricDescriptorsRequest()) + ->setName($name); + try { + $gapicClient->listMetricDescriptors($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListMonitoredResourceDescriptorsRequest()) + ->setName($name); + $response = $gapicClient->listMonitoredResourceDescriptors($request); + $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(); + $gapicClient = $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'; + $request = (new ListMonitoredResourceDescriptorsRequest()) + ->setName($name); + try { + $gapicClient->listMonitoredResourceDescriptors($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $request = (new ListTimeSeriesRequest()) + ->setName($formattedName) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + $response = $gapicClient->listTimeSeries($request); + $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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $request = (new ListTimeSeriesRequest()) + ->setName($formattedName) + ->setFilter($filter) + ->setInterval($interval) + ->setView($view); + try { + $gapicClient->listTimeSeries($request); + // If the $gapicClient 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 createMetricDescriptorAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateMetricDescriptorRequest()) + ->setName($name) + ->setMetricDescriptor($metricDescriptor); + $response = $gapicClient->createMetricDescriptorAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php new file mode 100644 index 00000000000..7a0e8fd53b0 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php @@ -0,0 +1,809 @@ +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(); + $gapicClient = $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(); + $request = (new CreateNotificationChannelRequest()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + $response = $gapicClient->createNotificationChannel($request); + $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(); + $gapicClient = $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(); + $request = (new CreateNotificationChannelRequest()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + try { + $gapicClient->createNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new DeleteNotificationChannelRequest()) + ->setName($formattedName); + $gapicClient->deleteNotificationChannel($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new DeleteNotificationChannelRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelRequest()) + ->setName($formattedName); + $response = $gapicClient->getNotificationChannel($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelRequest()) + ->setName($formattedName); + try { + $gapicClient->getNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $request = (new GetNotificationChannelDescriptorRequest()) + ->setName($formattedName); + $response = $gapicClient->getNotificationChannelDescriptor($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $request = (new GetNotificationChannelDescriptorRequest()) + ->setName($formattedName); + try { + $gapicClient->getNotificationChannelDescriptor($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $code = 'code3059181'; + $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); + $expectedResponse->setCode($code); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + $response = $gapicClient->getNotificationChannelVerificationCode($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new GetNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + try { + $gapicClient->getNotificationChannelVerificationCode($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelDescriptorsRequest()) + ->setName($name); + $response = $gapicClient->listNotificationChannelDescriptors($request); + $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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelDescriptorsRequest()) + ->setName($name); + try { + $gapicClient->listNotificationChannelDescriptors($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelsRequest()) + ->setName($name); + $response = $gapicClient->listNotificationChannels($request); + $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(); + $gapicClient = $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'; + $request = (new ListNotificationChannelsRequest()) + ->setName($name); + try { + $gapicClient->listNotificationChannels($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new SendNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + $gapicClient->sendNotificationChannelVerificationCode($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $request = (new SendNotificationChannelVerificationCodeRequest()) + ->setName($formattedName); + try { + $gapicClient->sendNotificationChannelVerificationCode($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateNotificationChannelRequest()) + ->setNotificationChannel($notificationChannel); + $response = $gapicClient->updateNotificationChannel($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateNotificationChannelRequest()) + ->setNotificationChannel($notificationChannel); + try { + $gapicClient->updateNotificationChannel($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + $request = (new VerifyNotificationChannelRequest()) + ->setName($formattedName) + ->setCode($code); + $response = $gapicClient->verifyNotificationChannel($request); + $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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + $request = (new VerifyNotificationChannelRequest()) + ->setName($formattedName) + ->setCode($code); + try { + $gapicClient->verifyNotificationChannel($request); + // If the $gapicClient 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 createNotificationChannelAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateNotificationChannelRequest()) + ->setName($name) + ->setNotificationChannel($notificationChannel); + $response = $gapicClient->createNotificationChannelAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php new file mode 100644 index 00000000000..cd32140b2e9 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php @@ -0,0 +1,182 @@ +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(); + $gapicClient = $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'; + $request = (new QueryTimeSeriesRequest()) + ->setName($name) + ->setQuery($query); + $response = $gapicClient->queryTimeSeries($request); + $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(); + $gapicClient = $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'; + $request = (new QueryTimeSeriesRequest()) + ->setName($name) + ->setQuery($query); + try { + $gapicClient->queryTimeSeries($request); + // If the $gapicClient 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 queryTimeSeriesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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'; + $request = (new QueryTimeSeriesRequest()) + ->setName($name) + ->setQuery($query); + $response = $gapicClient->queryTimeSeriesAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php new file mode 100644 index 00000000000..d679066683c --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php @@ -0,0 +1,790 @@ +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(); + $gapicClient = $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(); + $request = (new CreateServiceRequest()) + ->setParent($parent) + ->setService($service); + $response = $gapicClient->createService($request); + $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(); + $gapicClient = $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(); + $request = (new CreateServiceRequest()) + ->setParent($parent) + ->setService($service); + try { + $gapicClient->createService($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $request = (new CreateServiceLevelObjectiveRequest()) + ->setParent($formattedParent) + ->setServiceLevelObjective($serviceLevelObjective); + $response = $gapicClient->createServiceLevelObjective($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $request = (new CreateServiceLevelObjectiveRequest()) + ->setParent($formattedParent) + ->setServiceLevelObjective($serviceLevelObjective); + try { + $gapicClient->createServiceLevelObjective($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + $gapicClient->deleteService($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteService($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new DeleteServiceLevelObjectiveRequest()) + ->setName($formattedName); + $gapicClient->deleteServiceLevelObjective($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new DeleteServiceLevelObjectiveRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteServiceLevelObjective($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->getService($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->getService($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new GetServiceLevelObjectiveRequest()) + ->setName($formattedName); + $response = $gapicClient->getServiceLevelObjective($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $request = (new GetServiceLevelObjectiveRequest()) + ->setName($formattedName); + try { + $gapicClient->getServiceLevelObjective($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new ListServiceLevelObjectivesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listServiceLevelObjectives($request); + $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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $request = (new ListServiceLevelObjectivesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listServiceLevelObjectives($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListServicesRequest()) + ->setParent($parent); + $response = $gapicClient->listServices($request); + $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(); + $gapicClient = $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'; + $request = (new ListServicesRequest()) + ->setParent($parent); + try { + $gapicClient->listServices($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateServiceRequest()) + ->setService($service); + $response = $gapicClient->updateService($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateServiceRequest()) + ->setService($service); + try { + $gapicClient->updateService($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateServiceLevelObjectiveRequest()) + ->setServiceLevelObjective($serviceLevelObjective); + $response = $gapicClient->updateServiceLevelObjective($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateServiceLevelObjectiveRequest()) + ->setServiceLevelObjective($serviceLevelObjective); + try { + $gapicClient->updateServiceLevelObjective($request); + // If the $gapicClient 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 createServiceAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateServiceRequest()) + ->setParent($parent) + ->setService($service); + $response = $gapicClient->createServiceAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php new file mode 100644 index 00000000000..5eb2436b612 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php @@ -0,0 +1,426 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnoozeServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnoozeServiceClient($options); + } + + /** @test */ + public function createSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + $response = $gapicClient->createSnooze($request); + $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.SnoozeService/CreateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + try { + $gapicClient->createSnooze($request); + // If the $gapicClient 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 getSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + $request = (new GetSnoozeRequest()) + ->setName($formattedName); + $response = $gapicClient->getSnooze($request); + $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.SnoozeService/GetSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + $request = (new GetSnoozeRequest()) + ->setName($formattedName); + try { + $gapicClient->getSnooze($request); + // If the $gapicClient 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 listSnoozesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $snoozesElement = new Snooze(); + $snoozes = [ + $snoozesElement, + ]; + $expectedResponse = new ListSnoozesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSnoozes($snoozes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $request = (new ListSnoozesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSnoozes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSnoozesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $request = (new ListSnoozesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSnoozes($request); + // If the $gapicClient 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 updateSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateSnoozeRequest()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateSnooze($request); + $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.SnoozeService/UpdateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $request = (new UpdateSnoozeRequest()) + ->setSnooze($snooze) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateSnooze($request); + // If the $gapicClient 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 createSnoozeAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $request = (new CreateSnoozeRequest()) + ->setParent($formattedParent) + ->setSnooze($snooze); + $response = $gapicClient->createSnoozeAsync($request)->wait(); + $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.SnoozeService/CreateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php new file mode 100644 index 00000000000..8b1fc5ae653 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php @@ -0,0 +1,517 @@ +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(); + $gapicClient = $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(); + $request = (new CreateUptimeCheckConfigRequest()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + $response = $gapicClient->createUptimeCheckConfig($request); + $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(); + $gapicClient = $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(); + $request = (new CreateUptimeCheckConfigRequest()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + try { + $gapicClient->createUptimeCheckConfig($request); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new DeleteUptimeCheckConfigRequest()) + ->setName($formattedName); + $gapicClient->deleteUptimeCheckConfig($request); + $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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new DeleteUptimeCheckConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteUptimeCheckConfig($request); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new GetUptimeCheckConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getUptimeCheckConfig($request); + $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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $request = (new GetUptimeCheckConfigRequest()) + ->setName($formattedName); + try { + $gapicClient->getUptimeCheckConfig($request); + // If the $gapicClient 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(); + $gapicClient = $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'; + $request = (new ListUptimeCheckConfigsRequest()) + ->setParent($parent); + $response = $gapicClient->listUptimeCheckConfigs($request); + $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(); + $gapicClient = $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'; + $request = (new ListUptimeCheckConfigsRequest()) + ->setParent($parent); + try { + $gapicClient->listUptimeCheckConfigs($request); + // If the $gapicClient 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(); + $gapicClient = $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); + $request = new ListUptimeCheckIpsRequest(); + $response = $gapicClient->listUptimeCheckIps($request); + $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(); + $gapicClient = $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); + $request = new ListUptimeCheckIpsRequest(); + try { + $gapicClient->listUptimeCheckIps($request); + // If the $gapicClient 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(); + $gapicClient = $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(); + $request = (new UpdateUptimeCheckConfigRequest()) + ->setUptimeCheckConfig($uptimeCheckConfig); + $response = $gapicClient->updateUptimeCheckConfig($request); + $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(); + $gapicClient = $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(); + $request = (new UpdateUptimeCheckConfigRequest()) + ->setUptimeCheckConfig($uptimeCheckConfig); + try { + $gapicClient->updateUptimeCheckConfig($request); + // If the $gapicClient 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 createUptimeCheckConfigAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $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(); + $request = (new CreateUptimeCheckConfigRequest()) + ->setParent($parent) + ->setUptimeCheckConfig($uptimeCheckConfig); + $response = $gapicClient->createUptimeCheckConfigAsync($request)->wait(); + $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()); + } +} 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..6ac70404aed --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php @@ -0,0 +1,468 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createGroup($name, $group); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + try { + $gapicClient->deleteGroup($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + try { + $gapicClient->getGroup($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); + try { + $gapicClient->listGroupMembers($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listGroups($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateGroup($group); + // If the $gapicClient 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..443a3f9faf1 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php @@ -0,0 +1,672 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createMetricDescriptor($name, $metricDescriptor); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + try { + $gapicClient->createServiceTimeSeries($formattedName, $timeSeries); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); + $timeSeries = []; + try { + $gapicClient->createTimeSeries($formattedName, $timeSeries); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + try { + $gapicClient->deleteMetricDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + try { + $gapicClient->getMetricDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + try { + $gapicClient->getMonitoredResourceDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listMetricDescriptors($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listMonitoredResourceDescriptors($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + try { + $gapicClient->listTimeSeries($formattedName, $filter, $interval, $view); + // If the $gapicClient 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..9b115e17697 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php @@ -0,0 +1,716 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createNotificationChannel($name, $notificationChannel); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->deleteNotificationChannel($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->getNotificationChannel($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + try { + $gapicClient->getNotificationChannelDescriptor($formattedName); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $code = 'code3059181'; + $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); + $expectedResponse->setCode($code); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->getNotificationChannelVerificationCode($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listNotificationChannelDescriptors($name); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listNotificationChannels($name); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + try { + $gapicClient->sendNotificationChannelVerificationCode($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateNotificationChannel($notificationChannel); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $code = 'code3059181'; + try { + $gapicClient->verifyNotificationChannel($formattedName, $code); + // If the $gapicClient 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..c64caa89013 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php @@ -0,0 +1,134 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->queryTimeSeries($name, $query); + // If the $gapicClient 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..7651f7245bc --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php @@ -0,0 +1,701 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createService($parent, $service); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + try { + $gapicClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + try { + $gapicClient->deleteService($formattedName); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + try { + $gapicClient->deleteServiceLevelObjective($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + try { + $gapicClient->getService($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + try { + $gapicClient->getServiceLevelObjective($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); + try { + $gapicClient->listServiceLevelObjectives($formattedParent); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listServices($parent); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateService($service); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateServiceLevelObjective($serviceLevelObjective); + // If the $gapicClient 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/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php new file mode 100644 index 00000000000..653db774900 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php @@ -0,0 +1,359 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnoozeServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnoozeServiceClient($options); + } + + /** @test */ + public function createSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $response = $gapicClient->createSnooze($formattedParent, $snooze); + $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.SnoozeService/CreateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + try { + $gapicClient->createSnooze($formattedParent, $snooze); + // If the $gapicClient 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 getSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + $response = $gapicClient->getSnooze($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.SnoozeService/GetSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); + try { + $gapicClient->getSnooze($formattedName); + // If the $gapicClient 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 listSnoozesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $snoozesElement = new Snooze(); + $snoozes = [ + $snoozesElement, + ]; + $expectedResponse = new ListSnoozesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSnoozes($snoozes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workspaceName('[PROJECT]'); + $response = $gapicClient->listSnoozes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSnoozesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); + try { + $gapicClient->listSnoozes($formattedParent); + // If the $gapicClient 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 updateSnoozeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Snooze(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + $response = $gapicClient->updateSnooze($snooze, $updateMask); + $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.SnoozeService/UpdateSnooze', $actualFuncCall); + $actualValue = $actualRequestObject->getSnooze(); + $this->assertProtobufEquals($snooze, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSnoozeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $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 + $snooze = new Snooze(); + $snoozeName = 'snoozeName1119820177'; + $snooze->setName($snoozeName); + $snoozeCriteria = new Criteria(); + $snooze->setCriteria($snoozeCriteria); + $snoozeInterval = new TimeInterval(); + $snooze->setInterval($snoozeInterval); + $snoozeDisplayName = 'snoozeDisplayName-1956223833'; + $snooze->setDisplayName($snoozeDisplayName); + $updateMask = new FieldMask(); + try { + $gapicClient->updateSnooze($snooze, $updateMask); + // If the $gapicClient 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..40d14acd439 --- /dev/null +++ b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php @@ -0,0 +1,450 @@ +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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->createUptimeCheckConfig($parent, $uptimeCheckConfig); + // If the $gapicClient 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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $gapicClient->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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + try { + $gapicClient->deleteUptimeCheckConfig($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $response = $gapicClient->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(); + $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + try { + $gapicClient->getUptimeCheckConfig($formattedName); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listUptimeCheckConfigs($parent); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->listUptimeCheckIps(); + // If the $gapicClient 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(); + $gapicClient = $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 = $gapicClient->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(); + $gapicClient = $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 { + $gapicClient->updateUptimeCheckConfig($uptimeCheckConfig); + // If the $gapicClient 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()); + } +} From 0d93442db69db509ab1e6cfe3df9b15a97c142b2 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 13 Apr 2024 00:00:13 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- ...alert_policy_service_descriptor_config.php | 20 + ...lert_policy_service_rest_client_config.php | 20 + .../group_service_descriptor_config.php | 20 + .../group_service_rest_client_config.php | 20 + .../metric_service_descriptor_config.php | 20 + .../metric_service_rest_client_config.php | 20 + ...tion_channel_service_descriptor_config.php | 20 + ...ion_channel_service_rest_client_config.php | 20 + .../query_service_descriptor_config.php | 20 + .../query_service_rest_client_config.php | 20 + ...e_monitoring_service_descriptor_config.php | 20 + ..._monitoring_service_rest_client_config.php | 20 + .../snooze_service_descriptor_config.php | 20 + .../snooze_service_rest_client_config.php | 20 + ...uptime_check_service_descriptor_config.php | 20 + ...ptime_check_service_rest_client_config.php | 20 + .../Google/Monitoring/V3/Alert.php | Bin 5915 -> 0 bytes .../Google/Monitoring/V3/AlertService.php | 64 - .../Google/Monitoring/V3/Common.php | Bin 2532 -> 0 bytes .../Google/Monitoring/V3/DroppedLabels.php | 33 - .../Google/Monitoring/V3/Group.php | 37 - .../Google/Monitoring/V3/GroupService.php | Bin 3723 -> 0 bytes .../Google/Monitoring/V3/Metric.php | Bin 2648 -> 0 bytes .../Google/Monitoring/V3/MetricService.php | Bin 7118 -> 0 bytes .../Google/Monitoring/V3/MutationRecord.php | 32 - .../Google/Monitoring/V3/Notification.php | Bin 2855 -> 0 bytes .../Monitoring/V3/NotificationService.php | 97 -- .../Google/Monitoring/V3/QueryService.php | 32 - .../Google/Monitoring/V3/Service.php | Bin 4653 -> 0 bytes .../Google/Monitoring/V3/ServiceService.php | 95 -- .../Google/Monitoring/V3/Snooze.php | 39 - .../Google/Monitoring/V3/SnoozeService.php | 56 - .../Google/Monitoring/V3/SpanContext.php | 29 - .../Google/Monitoring/V3/Uptime.php | Bin 5190 -> 0 bytes .../Google/Monitoring/V3/UptimeService.php | 72 - .../Cloud/Monitoring/V3/Aggregation.php | 389 ------ .../Monitoring/V3/Aggregation/Aligner.php | 269 ---- .../Monitoring/V3/Aggregation/Reducer.php | 191 --- .../Cloud/Monitoring/V3/AlertPolicy.php | 805 ----------- .../V3/AlertPolicy/AlertStrategy.php | 167 --- .../NotificationChannelStrategy.php | 139 -- .../AlertStrategy/NotificationRateLimit.php | 81 -- .../Monitoring/V3/AlertPolicy/Condition.php | 373 ------ .../Condition/EvaluationMissingData.php | 76 -- .../V3/AlertPolicy/Condition/LogMatch.php | 151 --- .../AlertPolicy/Condition/MetricAbsence.php | 304 ----- .../AlertPolicy/Condition/MetricThreshold.php | 635 --------- .../MetricThreshold/ForecastOptions.php | 101 -- .../MonitoringQueryLanguageCondition.php | 257 ---- .../PrometheusQueryLanguageCondition.php | 433 ------ .../V3/AlertPolicy/Condition/Trigger.php | 118 -- .../V3/AlertPolicy/ConditionCombinerType.php | 81 -- .../V3/AlertPolicy/Documentation.php | 207 --- .../Monitoring/V3/AlertPolicy/Severity.php | 75 -- .../Google/Cloud/Monitoring/V3/BasicSli.php | 269 ---- .../V3/BasicSli/AvailabilityCriteria.php | 36 - .../V3/BasicSli/LatencyCriteria.php | 84 -- .../Cloud/Monitoring/V3/ComparisonType.php | 90 -- .../V3/CreateAlertPolicyRequest.php | 188 --- .../Monitoring/V3/CreateGroupRequest.php | 181 --- .../V3/CreateMetricDescriptorRequest.php | 151 --- .../V3/CreateNotificationChannelRequest.php | 163 --- .../V3/CreateServiceLevelObjectiveRequest.php | 185 --- .../Monitoring/V3/CreateServiceRequest.php | 180 --- .../Monitoring/V3/CreateSnoozeRequest.php | 149 --- .../Monitoring/V3/CreateTimeSeriesError.php | 135 -- .../Monitoring/V3/CreateTimeSeriesRequest.php | 159 --- .../Monitoring/V3/CreateTimeSeriesSummary.php | 135 -- .../V3/CreateTimeSeriesSummary/Error.php | 114 -- .../V3/CreateUptimeCheckConfigRequest.php | 142 -- .../V3/DeleteAlertPolicyRequest.php | 93 -- .../Monitoring/V3/DeleteGroupRequest.php | 130 -- .../V3/DeleteMetricDescriptorRequest.php | 103 -- .../V3/DeleteNotificationChannelRequest.php | 138 -- .../V3/DeleteServiceLevelObjectiveRequest.php | 92 -- .../Monitoring/V3/DeleteServiceRequest.php | 87 -- .../V3/DeleteUptimeCheckConfigRequest.php | 87 -- .../Cloud/Monitoring/V3/DistributionCut.php | 127 -- .../Cloud/Monitoring/V3/DroppedLabels.php | 80 -- .../Monitoring/V3/GetAlertPolicyRequest.php | 87 -- .../Cloud/Monitoring/V3/GetGroupRequest.php | 87 -- .../V3/GetMetricDescriptorRequest.php | 103 -- .../GetMonitoredResourceDescriptorRequest.php | 98 -- ...etNotificationChannelDescriptorRequest.php | 87 -- .../V3/GetNotificationChannelRequest.php | 87 -- ...ficationChannelVerificationCodeRequest.php | 167 --- ...icationChannelVerificationCodeResponse.php | 131 -- .../V3/GetServiceLevelObjectiveRequest.php | 138 -- .../Cloud/Monitoring/V3/GetServiceRequest.php | 87 -- .../Cloud/Monitoring/V3/GetSnoozeRequest.php | 88 -- .../V3/GetUptimeCheckConfigRequest.php | 87 -- .../src/Google/Cloud/Monitoring/V3/Group.php | 257 ---- .../Cloud/Monitoring/V3/GroupResourceType.php | 66 - .../Cloud/Monitoring/V3/InternalChecker.php | 271 ---- .../Monitoring/V3/InternalChecker/State.php | 74 -- .../Google/Cloud/Monitoring/V3/LabelValue.php | 141 -- .../V3/ListAlertPoliciesRequest.php | 294 ---- .../V3/ListAlertPoliciesResponse.php | 147 -- .../Monitoring/V3/ListGroupMembersRequest.php | 277 ---- .../V3/ListGroupMembersResponse.php | 143 -- .../Cloud/Monitoring/V3/ListGroupsRequest.php | 316 ----- .../Monitoring/V3/ListGroupsResponse.php | 109 -- .../V3/ListMetricDescriptorsRequest.php | 238 ---- .../V3/ListMetricDescriptorsResponse.php | 113 -- ...istMonitoredResourceDescriptorsRequest.php | 222 ---- ...stMonitoredResourceDescriptorsResponse.php | 113 -- ...tNotificationChannelDescriptorsRequest.php | 206 --- ...NotificationChannelDescriptorsResponse.php | 117 -- .../V3/ListNotificationChannelsRequest.php | 307 ----- .../V3/ListNotificationChannelsResponse.php | 151 --- .../V3/ListServiceLevelObjectivesRequest.php | 257 ---- .../V3/ListServiceLevelObjectivesResponse.php | 109 -- .../Monitoring/V3/ListServicesRequest.php | 275 ---- .../Monitoring/V3/ListServicesResponse.php | 109 -- .../Monitoring/V3/ListSnoozesRequest.php | 252 ---- .../Monitoring/V3/ListSnoozesResponse.php | 106 -- .../Monitoring/V3/ListTimeSeriesRequest.php | 501 ------- .../ListTimeSeriesRequest/TimeSeriesView.php | 59 - .../Monitoring/V3/ListTimeSeriesResponse.php | 201 --- .../V3/ListUptimeCheckConfigsRequest.php | 230 ---- .../V3/ListUptimeCheckConfigsResponse.php | 155 --- .../V3/ListUptimeCheckIpsRequest.php | 129 -- .../V3/ListUptimeCheckIpsResponse.php | 125 -- .../Cloud/Monitoring/V3/MutationRecord.php | 111 -- .../Monitoring/V3/NotificationChannel.php | 594 --------- .../VerificationStatus.php | 76 -- .../V3/NotificationChannelDescriptor.php | 326 ----- .../src/Google/Cloud/Monitoring/V3/Point.php | 153 --- .../Google/Cloud/Monitoring/V3/QueryError.php | 115 -- .../Cloud/Monitoring/V3/QueryErrorList.php | 105 -- .../Monitoring/V3/QueryTimeSeriesRequest.php | 197 --- .../Monitoring/V3/QueryTimeSeriesResponse.php | 195 --- .../src/Google/Cloud/Monitoring/V3/Range.php | 101 -- .../Cloud/Monitoring/V3/RequestBasedSli.php | 121 -- ...ficationChannelVerificationCodeRequest.php | 81 -- .../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 - .../Cloud/Monitoring/V3/ServiceTier.php | 74 -- .../src/Google/Cloud/Monitoring/V3/Snooze.php | 224 ---- .../Cloud/Monitoring/V3/Snooze/Criteria.php | 88 -- .../Cloud/Monitoring/V3/SpanContext.php | 91 -- .../Cloud/Monitoring/V3/TextLocator.php | 303 ----- .../Monitoring/V3/TextLocator/Position.php | 108 -- .../Cloud/Monitoring/V3/TimeInterval.php | 165 --- .../Google/Cloud/Monitoring/V3/TimeSeries.php | 404 ------ .../Cloud/Monitoring/V3/TimeSeriesData.php | 114 -- .../V3/TimeSeriesData/PointData.php | 116 -- .../Monitoring/V3/TimeSeriesDescriptor.php | 101 -- .../TimeSeriesDescriptor/ValueDescriptor.php | 184 --- .../Cloud/Monitoring/V3/TimeSeriesRatio.php | 180 --- .../Google/Cloud/Monitoring/V3/TypedValue.php | 213 --- .../V3/UpdateAlertPolicyRequest.php | 239 ---- .../Monitoring/V3/UpdateGroupRequest.php | 134 -- .../V3/UpdateNotificationChannelRequest.php | 151 --- .../V3/UpdateServiceLevelObjectiveRequest.php | 139 -- .../Monitoring/V3/UpdateServiceRequest.php | 139 -- .../Monitoring/V3/UpdateSnoozeRequest.php | 227 ---- .../V3/UpdateUptimeCheckConfigRequest.php | 192 --- .../Cloud/Monitoring/V3/UptimeCheckConfig.php | 711 ---------- .../V3/UptimeCheckConfig/CheckerType.php | 69 - .../V3/UptimeCheckConfig/ContentMatcher.php | 158 --- .../ContentMatcher/ContentMatcherOption.php | 107 -- .../ContentMatcher/JsonPathMatcher.php | 114 -- .../JsonPathMatcher/JsonPathMatcherOption.php | 68 - .../V3/UptimeCheckConfig/HttpCheck.php | 678 ---------- .../HttpCheck/BasicAuthentication.php | 107 -- .../HttpCheck/ContentType.php | 67 - .../HttpCheck/RequestMethod.php | 64 - .../HttpCheck/ResponseStatusCode.php | 112 -- .../ResponseStatusCode/StatusClass.php | 92 -- .../V3/UptimeCheckConfig/PingConfig.php | 72 - .../V3/UptimeCheckConfig/ResourceGroup.php | 113 -- .../V3/UptimeCheckConfig/TcpCheck.php | 122 -- .../Cloud/Monitoring/V3/UptimeCheckIp.php | 160 --- .../Cloud/Monitoring/V3/UptimeCheckRegion.php | 102 -- .../V3/VerifyNotificationChannelRequest.php | 147 -- .../Cloud/Monitoring/V3/WindowsBasedSli.php | 236 ---- .../V3/WindowsBasedSli/MetricRange.php | 125 -- .../WindowsBasedSli/PerformanceThreshold.php | 146 -- .../create_alert_policy.php | 88 -- .../delete_alert_policy.php | 77 -- .../get_alert_policy.php | 73 - .../list_alert_policies.php | 85 -- .../update_alert_policy.php | 66 - .../V3/GroupServiceClient/create_group.php | 76 -- .../V3/GroupServiceClient/delete_group.php | 71 - .../V3/GroupServiceClient/get_group.php | 73 - .../GroupServiceClient/list_group_members.php | 78 -- .../V3/GroupServiceClient/list_groups.php | 79 -- .../V3/GroupServiceClient/update_group.php | 60 - .../create_metric_descriptor.php | 81 -- .../create_service_time_series.php | 84 -- .../create_time_series.php | 82 -- .../delete_metric_descriptor.php | 77 -- .../get_metric_descriptor.php | 77 -- .../get_monitored_resource_descriptor.php | 79 -- .../list_metric_descriptors.php | 79 -- .../list_monitored_resource_descriptors.php | 79 -- .../MetricServiceClient/list_time_series.php | 99 -- .../create_notification_channel.php | 87 -- .../delete_notification_channel.php | 79 -- .../get_notification_channel.php | 80 -- .../get_notification_channel_descriptor.php | 77 -- ...notification_channel_verification_code.php | 96 -- .../list_notification_channel_descriptors.php | 86 -- .../list_notification_channels.php | 88 -- ...notification_channel_verification_code.php | 73 - .../update_notification_channel.php | 65 - .../verify_notification_channel.php | 85 -- .../QueryServiceClient/query_time_series.php | 84 -- .../create_service.php | 76 -- .../create_service_level_objective.php | 75 -- .../delete_service.php | 71 - .../delete_service_level_objective.php | 76 -- .../get_service.php | 73 - .../get_service_level_objective.php | 78 -- .../list_service_level_objectives.php | 80 -- .../list_services.php | 80 -- .../update_service.php | 59 - .../update_service_level_objective.php | 59 - .../V3/SnoozeServiceClient/create_snooze.php | 99 -- .../V3/SnoozeServiceClient/get_snooze.php | 73 - .../V3/SnoozeServiceClient/list_snoozes.php | 81 -- .../V3/SnoozeServiceClient/update_snooze.php | 90 -- .../create_uptime_check_config.php | 76 -- .../delete_uptime_check_config.php | 76 -- .../get_uptime_check_config.php | 76 -- .../list_uptime_check_configs.php | 80 -- .../list_uptime_check_ips.php | 62 - .../update_uptime_check_config.php | 62 - .../v3/src/V3/AlertPolicyServiceClient.php | 34 - .../V3/Client/AlertPolicyServiceClient.php | 507 ------- .../v3/src/V3/Client/GroupServiceClient.php | 444 ------- .../v3/src/V3/Client/MetricServiceClient.php | 675 ---------- .../NotificationChannelServiceClient.php | 679 ---------- .../v3/src/V3/Client/QueryServiceClient.php | 193 --- .../Client/ServiceMonitoringServiceClient.php | 635 --------- .../v3/src/V3/Client/SnoozeServiceClient.php | 434 ------ .../V3/Client/UptimeCheckServiceClient.php | 451 ------- .../Gapic/AlertPolicyServiceGapicClient.php | 806 ----------- .../src/V3/Gapic/GroupServiceGapicClient.php | 752 ----------- .../src/V3/Gapic/MetricServiceGapicClient.php | 1178 ----------------- .../NotificationChannelServiceGapicClient.php | 1075 --------------- .../src/V3/Gapic/QueryServiceGapicClient.php | 256 ---- .../ServiceMonitoringServiceGapicClient.php | 1044 --------------- .../src/V3/Gapic/SnoozeServiceGapicClient.php | 680 ---------- .../Gapic/UptimeCheckServiceGapicClient.php | 692 ---------- .../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/SnoozeServiceClient.php | 34 - .../v3/src/V3/UptimeCheckServiceClient.php | 34 - .../Monitoring/v3/src/V3/gapic_metadata.json | 336 ----- .../alert_policy_service_client_config.json | 69 - ...alert_policy_service_descriptor_config.php | 107 -- ...lert_policy_service_rest_client_config.php | 87 -- .../group_service_client_config.json | 86 -- .../group_service_descriptor_config.php | 123 -- .../group_service_rest_client_config.php | 98 -- .../metric_service_client_config.json | 101 -- .../metric_service_descriptor_config.php | 174 --- .../metric_service_rest_client_config.php | 156 --- ...ication_channel_service_client_config.json | 94 -- ...tion_channel_service_descriptor_config.php | 175 --- ...ion_channel_service_rest_client_config.php | 145 -- .../query_service_client_config.json | 27 - .../query_service_descriptor_config.php | 48 - .../query_service_rest_client_config.php | 41 - ...vice_monitoring_service_client_config.json | 94 -- ...e_monitoring_service_descriptor_config.php | 176 --- ..._monitoring_service_rest_client_config.php | 145 -- .../snooze_service_client_config.json | 64 - .../snooze_service_descriptor_config.php | 94 -- .../snooze_service_rest_client_config.php | 79 -- .../uptime_check_service_client_config.json | 74 -- ...uptime_check_service_descriptor_config.php | 115 -- ...ptime_check_service_rest_client_config.php | 91 -- .../Unit/V3/AlertPolicyServiceClientTest.php | 380 ------ .../Client/AlertPolicyServiceClientTest.php | 442 ------- .../Unit/V3/Client/GroupServiceClientTest.php | 541 -------- .../V3/Client/MetricServiceClientTest.php | 769 ----------- .../NotificationChannelServiceClientTest.php | 809 ----------- .../Unit/V3/Client/QueryServiceClientTest.php | 182 --- .../ServiceMonitoringServiceClientTest.php | 790 ----------- .../V3/Client/SnoozeServiceClientTest.php | 426 ------ .../Client/UptimeCheckServiceClientTest.php | 517 -------- .../tests/Unit/V3/GroupServiceClientTest.php | 468 ------- .../tests/Unit/V3/MetricServiceClientTest.php | 672 ---------- .../NotificationChannelServiceClientTest.php | 716 ---------- .../tests/Unit/V3/QueryServiceClientTest.php | 134 -- .../V3/ServiceMonitoringServiceClientTest.php | 701 ---------- .../tests/Unit/V3/SnoozeServiceClientTest.php | 359 ----- .../Unit/V3/UptimeCheckServiceClientTest.php | 450 ------- 304 files changed, 320 insertions(+), 53046 deletions(-) delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Alert.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/UptimeService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php delete mode 100644 owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php delete mode 100644 owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/AlertPolicyServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/MetricServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/NotificationChannelServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/QueryServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/ServiceMonitoringServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/SnoozeServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/UptimeCheckServiceClient.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/gapic_metadata.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php delete mode 100644 owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php diff --git a/Monitoring/src/V3/resources/alert_policy_service_descriptor_config.php b/Monitoring/src/V3/resources/alert_policy_service_descriptor_config.php index bb7fe884827..995f07d7541 100644 --- a/Monitoring/src/V3/resources/alert_policy_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/alert_policy_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/alert_policy_service_rest_client_config.php b/Monitoring/src/V3/resources/alert_policy_service_rest_client_config.php index dffb1c026b4..bb65ee95b1d 100644 --- a/Monitoring/src/V3/resources/alert_policy_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/alert_policy_service_rest_client_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/group_service_descriptor_config.php b/Monitoring/src/V3/resources/group_service_descriptor_config.php index ff6efe326c8..dba3498cf7f 100644 --- a/Monitoring/src/V3/resources/group_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/group_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/group_service_rest_client_config.php b/Monitoring/src/V3/resources/group_service_rest_client_config.php index 2d4763692de..1ec3e238ee1 100644 --- a/Monitoring/src/V3/resources/group_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/group_service_rest_client_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/metric_service_descriptor_config.php b/Monitoring/src/V3/resources/metric_service_descriptor_config.php index 537f2edc969..7b8896801eb 100644 --- a/Monitoring/src/V3/resources/metric_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/metric_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/metric_service_rest_client_config.php b/Monitoring/src/V3/resources/metric_service_rest_client_config.php index 741468a73ec..0367626add5 100644 --- a/Monitoring/src/V3/resources/metric_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/metric_service_rest_client_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/notification_channel_service_descriptor_config.php b/Monitoring/src/V3/resources/notification_channel_service_descriptor_config.php index 212e17ef746..6088b2f89bf 100644 --- a/Monitoring/src/V3/resources/notification_channel_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/notification_channel_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/notification_channel_service_rest_client_config.php b/Monitoring/src/V3/resources/notification_channel_service_rest_client_config.php index 3c782d2b3a6..822c7ebc934 100644 --- a/Monitoring/src/V3/resources/notification_channel_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/notification_channel_service_rest_client_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/query_service_descriptor_config.php b/Monitoring/src/V3/resources/query_service_descriptor_config.php index a3c68187c23..4b6dc680ebc 100644 --- a/Monitoring/src/V3/resources/query_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/query_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/query_service_rest_client_config.php b/Monitoring/src/V3/resources/query_service_rest_client_config.php index f258f2c5638..38b688dbab5 100644 --- a/Monitoring/src/V3/resources/query_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/query_service_rest_client_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/service_monitoring_service_descriptor_config.php b/Monitoring/src/V3/resources/service_monitoring_service_descriptor_config.php index ab57f32e711..739ca870934 100644 --- a/Monitoring/src/V3/resources/service_monitoring_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/service_monitoring_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/service_monitoring_service_rest_client_config.php b/Monitoring/src/V3/resources/service_monitoring_service_rest_client_config.php index ddefc86e0a7..f7ca03dded7 100644 --- a/Monitoring/src/V3/resources/service_monitoring_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/service_monitoring_service_rest_client_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/snooze_service_descriptor_config.php b/Monitoring/src/V3/resources/snooze_service_descriptor_config.php index a476bb04670..57e5c8ab386 100644 --- a/Monitoring/src/V3/resources/snooze_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/snooze_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/snooze_service_rest_client_config.php b/Monitoring/src/V3/resources/snooze_service_rest_client_config.php index de2890fcd30..a3b5e3574b8 100644 --- a/Monitoring/src/V3/resources/snooze_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/snooze_service_rest_client_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/uptime_check_service_descriptor_config.php b/Monitoring/src/V3/resources/uptime_check_service_descriptor_config.php index f69c027e8c7..a9dbc7aa781 100644 --- a/Monitoring/src/V3/resources/uptime_check_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/uptime_check_service_descriptor_config.php @@ -1,4 +1,24 @@ [ diff --git a/Monitoring/src/V3/resources/uptime_check_service_rest_client_config.php b/Monitoring/src/V3/resources/uptime_check_service_rest_client_config.php index 48eea72dceb..4c50c3cd46b 100644 --- a/Monitoring/src/V3/resources/uptime_check_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/uptime_check_service_rest_client_config.php @@ -1,4 +1,24 @@ [ 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 deleted file mode 100644 index 611022bae32b07a433dbc0ce39a6519f97b2cf48..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5915 zcmcgwO>-Mb8II)m>y^LKw(+c}q$W-vPIe=)^1|-Qge_T;9kI4#WZ7Z2R5djkwd8@( z%rGBb6qoPZse&6nfGYk0R}OI6+g>?v%AMlM+ubvxkt0P`iXxZD)BQgE@jlPfZ}(5X zurF+QBp*_fI;uz8a;qZxtjQ=5l8u6Z2A zHP3hV05n5&UAe&G;R`>2l%soDD25=qyYL3{af~_|XbZWHs>4kc! zTTVVdSk(YzTxgvJ`MPz~P-2=ztA`oB{g}hi$39D*W!9-?Iqln{L@6ox$WjD&kI+|+ zYTMLtZy#E>wdN^K*dG(aiSzttdO(vxyB)FO0JX9c<&kCe3Ho>scqrpiou%;Yi(~ToEDY@@!<6UXTmL;mHX4J_!19$)X6d?O?~pwSNw8O~*1_X^F#pI2ooG#*hjuU}jo6nyoa4Ygx&CIz>2YkB2t;HYFdzJT=vp zLEF+jzANbvDNJ2vAFb(JHGE1Q!@?!{B+k4q5#F1Gy)jW4L2_~*HciXZJG#a-rf3(c zX|fGl!IdtO7qF^1R5S_BNWifkhgd_T%?yj3h2Nl@l$s*^5LWnMqPQMAsJeY=lSkiz z44fFJK^Q5(f=e%{!}j8P2(glTHhTVXKAi>;`!oM6B+?aF9wyi-%p);8sM6sq!}D`Q9%7?6BY;j2t~2PI=m$c#+XI&HLOP@RJ;qcgA2=O z^KnzTy~#_7M$6z4?C4q}gm`&}oWa@vTWz^)L2UM^+~?B+7g)STIqc>Dwx@d91#K&a z)s;3l_9xR|A6eaFhJdhF@F)fw8K&|ZpE`XMyV>>CE|u2#AV<>-GB~w*xj+I)bK*l}Yj`EUDeDL%Uq68XT2cb!MNZrzNb$Cz0pPX+P+03&=sv3JDV7}?F=ObLV`j%HNO9(5qWs;Ye&!&+ ztO-c+8FTuctvb4EnbKXH|4MF*&7ms?{kSi0!D=K*1x?qd(kzB2(6AT6vy^*(D)&J+ zm; zPhexzcanmcU(E9(mp5%rEHo&9 znB>ib3~hy=>yKi}pTs&Aksy1p9uqFVU|?c+-7rZ+3DSc(&LX7YbbzA5}Z3GwTRxUk^$&CTGsl8xDR$7rfi$Bw$m9snFCveZfdJZpzeSB@hDv{aHBo9k}468S<&J)g=Z51{nB@Eqj zw_v?kJKnEU%QqxF4>N^o2~|4>$y$9aNghBNKPay%jhD)Cp;3Ivyr5n_t)112<+YjZ zpTk0UjUy6loR-ha^-ANb8?Z~TP{hxbV&Mp}7h$$suXFem%)ctss|bn`|9j$1;cp4} zL97}ZFL9EcQrYD5xMopy@ju@!KJt7jtr8R^u0ujo8Y!)P;FQHv!Lv>hUl&j@emm^R zoUCibUwqNv@X_}&7yD+n_6D0|xBi?=AMyv^Op!wkYKzSI?mxoDW|OxzEgy-|;yRA9gXwTYx61}{AB;H$N&$DBnW_eHXfO-wr0RIIC{HG)U 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 deleted file mode 100644 index 8dcca57c07d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/AlertService.php +++ /dev/null @@ -1,64 +0,0 @@ -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ÚAname‚Óä“%#/v3/{name=projects/*}/alertPolicies– -GetAlertPolicy+.google.monitoring.v3.GetAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"4ÚAname‚Óä“\'%/v3/{name=projects/*/alertPolicies/*}µ -CreateAlertPolicy..google.monitoring.v3.CreateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"MÚAname,alert_policy‚Óä“3"#/v3/{name=projects/*}/alertPolicies: alert_policy‘ -DeleteAlertPolicy..google.monitoring.v3.DeleteAlertPolicyRequest.google.protobuf.Empty"4ÚAname‚Óä“\'*%/v3/{name=projects/*/alertPolicies/*}Ë -UpdateAlertPolicy..google.monitoring.v3.UpdateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"cÚAupdate_mask,alert_policy‚Óä“B22/v3/{alert_policy.name=projects/*/alertPolicies/*}: 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.v3BAlertServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 2164fb3c8760677a8795493e23bb7537bf54f102..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2532 zcmbVO*>2lL6tyI;BQG@LB&yM6;s%Huq;z1_0YcX;XlX1HkSLX+g`f~XP~=D!)pUy6{qrsjG(!utQ9Cvqb!Ud7VdE4b-O_v?H)99rCxqe8 z4ab(LV?WRW_<3&nstLhN%`$(4%+K&dvwRAs4|OM@tp}!K$HA|6Q7apbJu}N z&v2GXKPnyyABlEAJzKLzE$Zu@=|W+BQ04h44Q7-@Nc}Jk8@V$lxSr(5^AD0d!+{sl zVswl>8ibyG8s{B3xSRbqT0oTGnxmHK2c9_&qnda=FDm!3$Z}R!D}-kMKU2ko9tPUA zyEtr2L2{JhN{AJ>d|RD zCu{>TaLcClHMIlPrJm^+F+vfg_xWW z1*9I^Mti#F_N%mSj&Ie8NiD;#t>8+1r>MP7 zi^$9}yM;Cqv@1#sDjbD(Of`4iC4$6k=CPZ-D@kFta{a+om)T|+w3&DtD6JM5GCO(H z*g{q0E5a~&iV1olbOwZ}0UwVN^9xyMDq>Gc^mlVXpU6!jDPo7HZ{ITPV!;XXXrbWb zHM6%+@cM*#%+}Ce5w&7FhYM$vkcJ!#R`{+rt*X;|kIDpPxNrOIViWeej!B7JU z1zB5xvAzdIlRXc06kzinL=r*^zR35?$~`T(MyoG1R2@+7#?+}|!kzvU)doZ!iqKd^ zB=WuVfaf{sxiAo$kRvcNhxcXD6``x;{c^2z{znPbVBc8yu$)(uMI!zJ_Deqqy5)pM zrV3U^Q>VDPz)K9<%gu2CbH}IoTjh>Fl=s{5;=(m!SNZzF4I6)E!qF&}j*8n2tT%s^ sKTC{xK9=)*ZqD<=#&|V;!y7MVpUYRt+ECasKDuGVn#m$?hwc#i8&pH#s{jB1 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 deleted file mode 100644 index f7e45d86002..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/DroppedLabels.php +++ /dev/null @@ -1,33 +0,0 @@ -internalAddGeneratedFile( - ' -— -)google/monitoring/v3/dropped_labels.protogoogle.monitoring.v3"| - DroppedLabels= -label ( 2..google.monitoring.v3.DroppedLabels.LabelEntry, - -LabelEntry -key (  -value ( :8BÍ -com.google.monitoring.v3BDroppedLabelsProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 999b703bd1a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php +++ /dev/null @@ -1,37 +0,0 @@ -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 -GroupProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index a03455b22eaefbdb97cd6bc07b10a02c337b4ce1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3723 zcmb_fL2nyH6vj@IIuoE|)DqXF?Zi!q8-E@PSnn>o zV~0?M12+UhLcQ=4fd9Z9Rh;0K69-QG1Wvq}on5aTJGLcqakTT^oA15%y>DjTe%EVx z=nkn+hx!Jiby7PatVN0EyUaCRo76gu2K9;Qwmr+HzCy_EK6!utkUZFZe7Fp*f!py- zs*sLyN<8*DRCt^Z!Z7G5BJk&RYPMyPfEf&aR;-|E!OoUpTVFyN+oWOG0fhkP zZ5tiOWR~j??y&Eev~Z7vF}dxE=R(@sBm#86D*;u|A3Kctj$!M&G%$V3gDelgR8^al z#r5M~3isr;Je<`ag%G2vo&&i}nBSqv-3jq2>-f%=z|8}k#{cO<%B6Xht~rj&tKd3; zs`hf~g&5_yV_Vc=)A>BKs9i79meI9be>zv$T3UZXC26KYJH1yQm-HRC4dk30a=*7= z;N;FRYoKQj+8#R@?kdQ(@s1^_rPb>(lODpj72@7=Caj`wuc5-EbB3>mmI@>-CsOH_ za!blio-i6%T9!*aJX|3_Sm1;7 zzCc8z#SIxmNC`}3k@Dh(i}~NuXz@KOV4_#S6Z(0F1`OXvm$>3&FOyVZzO1kQrKSJX zmhtT#4kZi zjG3uo?4ql65FF~%4TmM7T$(D%BAWM%Cangbj@emooy8a-@rk*gQ71bm!e!80!?Ho= z@*g3bEM?$Tv($h-1wFkqx3k?i_fU7F<;%jADep{2O{d$e7n{+MwZ z+bX_IkAWQHAOl6S@XHYc1xx4gnqY3Xv*^&$;}DAHEeUaH=w}Zr_e%TVDX476DAX(cZ*Zof?Alu6AciSH+QRKTxa%%h^5;M~ut=i2oI zqW+Wo5AB;&i!m=yi^b#PV+kof=Zy|)!6nG;)HgiaU=7!Aua7hD?KOp|0!LK6{Cf&z z;d(K&Fy+OhYKYt8LF!{ofQuaX)uibrUs#X{%zAe-@y)Ak^&on+U(&gXcvvYrJkLnp z;CZGTm7Yh7x-M4rU;czDug=QK>d3cvf1Cuc_LQ7pZ)U!4W_IWPH^IvQZjeLjQEo-l zA)_-Ay`&`Ie&pM}OGfc{OgXXrX~0~{bwUn~$q&Z^^6=pCU>l*KA9I@;Wa9f1m$s+A z$0DCIZ_+;Pwx=}W%+{qh0MDAzFtBV&4*R_$8d;7NS>~YxnnyFBdD7hluw5$*30k28 z_!$U(f_UUIn}m@S;nz(T4jBexmdk#^%=gIHazl#Hw{6FIOVXtXh%0$oFQ9tcAK1zUAz~)-B zaU=gCB|YQ`Yt_Gv#bI$WFo-f~dQj^7$V9sXWl8ANa_a?BXjMB+eNjsKfK91vGqlv& zP{Oa6){7ECmO#z|>YNC>=HEpC;o&*ujD}hh*44x%F}2hI64q4%V2pCgD+zOb&MIY} zmR$P^%IH+iYJEfIb?cn~j3bS;`%qQc3|}$Nsjnfn)-iYHz;e8^=}MCP9_=*)K#DPp zkZ=96M1S&5u+(IL*4k&V9*8=G^%7Y_@jp&+bN!&JT5ZDR7>|W|8ADW>e-&XXlQc_B zy9-xcF?K^|b{K@H^PGF3vz*Nw?nk&PbD6`bw2Z}REefwoa+%x4Zw0vW#xt!7Yp>{; zEPmw;{X|FAI;-mUKTDS?DvDNV{!)ZmjuM{vsO6^8QdT&XaY?^RK_ykK2asrqUa)#L+7no5nFb`L&?aN_Xl!Mg#m$q=nD-pv;PIWAiO zBfL6>GQO-?`OziqL#U$XyLXbuqHJsU_!?}6coTY)N@!uu*Y3AUGrL|;cwl%aM7Ht>25t%*8*D$QSuP#xq9YOtSKD1~-h8?r2?ZY2BUKefzmuRdSon(yc~XsvYDU&H?@d|07jR diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php deleted file mode 100644 index 5cd56e066aeefad844fdcf1fcff8a8fcad56221e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7118 zcmb_hOLH7o6{clLk?s&hzK-Rw5|eh@j->H;CN+ZtZdt~yheg1O9ocazVT!3%&z(_| zneL_^Qe>4j>|jL|3t$BcR#YWB3X0+fP$`N9*`&0himbfKItz+(AN`!3k;cIrkNTc- z?m6Fi+^=un{+_ezpeynwv52etq$Teh$o?*o9oP14!|uvELAy;{*|2+#*(Gj8me(K1 zZ$Ee}Z>+!d_%f(^cHkOBl{>cG>5^*CwoKo4O{-Jgt5puK< z)%2Ps>}~2@^C<+fBDeLfN5DeAY&)DgBDK;@kajk0-%O6eWo=Li`RkEw^nYKHcD$nAG zI=mi8YnzBt8!5ukwNeGxShIUj(x-PhtvzbMQK>R{{U4LyY1XG}$)0FuaOm)EqvGrX9UQnjTEb;u&}}fiXht zk#B!Utl~HoQ+^?##gqN@92h$UZ=jb$tedT9K6*t-KC@V;H5P=w6>zvR%-0L(C5wFI zHxu44rxhPv+a$xV%R)y3i=ac#2c7b33BAfNU{#otsJp2|)mWm+xHKeD8B5Qb9T#01 z;F!qBcM;}Qo0E@MQ|ZWhG%yE0M)NcW8TktS<_+p{T5$f!r!Oy0lKZWJCu?0^y%$(0Q8K$7YWJ<1tAz6jV`bh*fr()!OU$ z>fl<7P2h9s8Ni~!x6l+j5cc#g>-j=W2@4}(bgy2ah8X<;Nv`@PD(Ib#OFE2qusKzz zUC!6mVnKWto%e`gTP@u^XeKQbAgEJWm_<{z+ahjr=b$)Ak-%GMe9t8N#TVeOnVOpK zL@uN(Fb?t)u)sr0jmIglnH`VQbXTRZfM#NVsXCrQ)Ngd6P}J>92$j# zslu58{w5j^;Kb&qjPe@^UEtjp?-cg7CQ6U@cAb^p4Rqb;+CeLv`#s%)Q^ghgL?;uF znx7EE$7(v%G3M2Yq4KtSiq2;}+n~Wg1!wT1MRc;!v7&@uN0a<~7Tuo%&??9&pXb2x zDCqT|fbm6i)(7g{Z8|nIQq!;l%ZDV=l6eK4^8&*lo|jsrhuH*PLzAiG)WhVY+b$ck z*tWuApTCPHI0#A<3EetB)#p$l=_7MPX`{J!0^%O@=liV4H#IoT+XABr;3nO8}WcC0Zn`?Jr!_|@3Aag9>$ zL&|PffI!pH;8jaU;mtw(q8I1Y!~c-bw}!JnyqxdlaIG-JQ}a`0JsAuz^1NV%#!@Yn zj__Y3e#U2Mj)!acVX$0fcvr{^<_AoV0XiZpZzcm-!i|NzNFXiQP4Vv~bS{Sl;y3a= z&k+q#AIi6sTS*6jQs?>C?;eBq?{MJe^GG}Zt9RGN1BGG&+tFl9%yo zv0&To0{3JSD;B}OmC$VVu*Ns?!^+BqC=5!>onvj5g-iDnM3F^#O*t`2RVv|6BK{%{ zjmHrP|1THs4|1`tRAT6o(>}&dHP{QE@C_WEKbAh#E+*nAat?uvd z3ydSSsR#Zp+%^F%z2S6qziqp{@=4=C{>6xn!&Wz?4XP#Yw=GYRhac6}kbelPPcLWvJZ^d;3aay}k0N&b=N I2pu8xKQr*R@&Et; 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 deleted file mode 100644 index cc7e45493f8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MutationRecord.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile( - ' -ò -*google/monitoring/v3/mutation_record.protogoogle.monitoring.v3"U -MutationRecord/ - mutate_time ( 2.google.protobuf.Timestamp - -mutated_by ( BÎ -com.google.monitoring.v3BMutationRecordProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 2c8d7ae84e61c4a16489fdfe927e4f0b27f488c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2855 zcmbVO-EQMV6vk<{-JNvX#a#&#RG4-vHQS|*NQ40Q2c>OVD$z7*(yTz1qKPv}2ON(z zwu7=&-h_+2;f4p`ArMc}N8kc+Ja!VNP1&%yif7Ju=J-3`H$Hpcy4NmxflsMJ1@UPM zH~ZMXrq~tS=N7kdGibM|z!vYi%%(!e`1k^sFKW1Sd{$crsK*0gQ3H24@7OfgJTB_sk!FwY#H3WwO{G4(9LTzJU}gc?SN`Xlv91XSHow}SnUy@mhn7APCkqUuUM08`w6c+=v z!bOKT?2YsS#3UczFXM5W+by6kcN6`2zbwl3#vhAlbqWc0^f0NFyXuI9a7P{UQXQp{ zI>J7u^Ir~Im1s$?piikF(vDYhe9>3SC>?lIG-9Pambt!}J=Yb0r559SKcLkf6{8Pb z=wUzbv?o$dd$Z@QCz8PB3^~+SXpuUkY15XLhIHwCW|(ehRs9gYIdx(ORNY4_mY`A= zvAwk=3ECWjCV85?Pt^nT?9T1rX-_3LGvPBkD4k>_jplx){rC!aiXQdC8a3&CBlWeC z`2wxnCGs7Rjn_z>!qE%#S-o_5c5-%9testy8`WB|c2#X$m8+G~5iFOEpM9V%BXm`c z!r)l}MLr%qrHp@++v48}+DY*9ZfmOtvl$v}g4dlq@gO|KvYqFELt`XT0=m1`*nD7`h!am2EblEvF0{+#{|30-&2`W zIrZsBGS&I`+gLCBIovc&xoajzLzoS3Q)>~}Fyy{rjNyh+FEkgVK?+-=ulDEBw3Qgn TLZ32g%3vlVqcLiL1_=ENc~HR9 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 deleted file mode 100644 index 8b1e14a465e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php +++ /dev/null @@ -1,97 +0,0 @@ -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/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ÚAname‚Óä“64/v3/{name=projects/*}/notificationChannelDescriptorsÝ - GetNotificationChannelDescriptor=.google.monitoring.v3.GetNotificationChannelDescriptorRequest3.google.monitoring.v3.NotificationChannelDescriptor"EÚAname‚Óä“86/v3/{name=projects/*/notificationChannelDescriptors/*}Ä -ListNotificationChannels5.google.monitoring.v3.ListNotificationChannelsRequest6.google.monitoring.v3.ListNotificationChannelsResponse"9ÚAname‚Óä“,*/v3/{name=projects/*}/notificationChannelsµ -GetNotificationChannel3.google.monitoring.v3.GetNotificationChannelRequest).google.monitoring.v3.NotificationChannel";ÚAname‚Óä“.,/v3/{name=projects/*/notificationChannels/*}ä -CreateNotificationChannel6.google.monitoring.v3.CreateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"dÚAname,notification_channel‚Óä“B"*/v3/{name=projects/*}/notificationChannels:notification_channelƒ -UpdateNotificationChannel6.google.monitoring.v3.UpdateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"‚ÚA update_mask,notification_channel‚Óä“Y2A/v3/{notification_channel.name=projects/*/notificationChannels/*}:notification_channel® -DeleteNotificationChannel6.google.monitoring.v3.DeleteNotificationChannelRequest.google.protobuf.Empty"AÚA -name,force‚Óä“.*,/v3/{name=projects/*/notificationChannels/*}Ü -\'SendNotificationChannelVerificationCodeD.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.google.protobuf.Empty"SÚAname‚Óä“F"A/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode:*‡ -&GetNotificationChannelVerificationCodeC.google.monitoring.v3.GetNotificationChannelVerificationCodeRequestD.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse"RÚAname‚Óä“E"@/v3/{name=projects/*/notificationChannels/*}:getVerificationCode:*Ê -VerifyNotificationChannel6.google.monitoring.v3.VerifyNotificationChannelRequest).google.monitoring.v3.NotificationChannel"JÚA name,code‚Óä“8"3/v3/{name=projects/*/notificationChannels/*}:verify:*©Ê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.v3BNotificationServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index fb4ffd3bc28..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile( - ' -¼ -(google/monitoring/v3/query_service.protogoogle.monitoring.v3google/api/client.proto)google/monitoring/v3/metric_service.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.v3BQueryServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 1627dee4f7a7b671b07fe8db70c22464a26abb42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4653 zcmbVQOLNm!6h?XbI1eKdFs98Y28NJ=T;dMXQ3y=zgy3mH+$4k!;~61K*UoKaN!7zN zFj@6Kbl>TsGhKDnpU|1I>rDSZxBQBpdnMVjG{sSw6R{^R?P0N7lAG$l5`11wc17 z&y)5-4e$;m{O1I9lj@S^Yd-#Wi+U=>5ccWvOI@*vH zLmL(4gpsR~?*=4!x+J;84_s@7+szalcmApkh}4=xYr7;0ywY{3iywsQ__Q8isxcJG zxuN?<4ylzjlURo4R*6e(V=$P<@&02PMQzP6Izf7h^jYk<#hknY|IS1H=d5cAU0LJus#ZN12Z&0_f5EQf&(Y4MgvX=MW*K= z)y?1>Ou1203~M%w;{%xK%afRf;qS;%6vZhRZEI#gvb@BVp)UpHSK-6jF9Iwi`b}8p znnOJqM`2+voJ!(tY(C!--S-ObqQ8#gnTL;}U>}PG+ihwVeao|lFOok80&X^J(;zO2 zhJOqc5|&Dn0MsCsPaBlD`JcvMF0yQkw28S>XSUHc`ABnPRhJUC;9ATMlc9068d#h- z@i=|b%b%TD4gADP3}GiWZO!C~62u}*yS8cKRuDDd>?p6#>#@qXiOcbD!g_v)U9Y!o z^R_#^d?QA&)-LzXCB#*GOL>x)@=A-)&#CyAp=cLh8iNtW{QMt7FcF(2PQw^ZzC+u<{bCr)IXN#T_!As4ZR{zy`Qg}S zB45Fz*48MFJZe(^huy_w={UNsdL+q2$d8hZ1(lktBepOuHxwZKP7~R#ZCSjAHMJ+xF z1pY(&fk#2e|17{vU*^!o49)>V^=%(_7QRGt=&7mOr!9gFnG$c8wSFF@4DOY_OX~q! z!Bsu*BlAyT&w4_-9Qe;JFYCMuY{W3}#^8VKRQuG;Ft};YZ9vsiU4Yp^9*d74 zjqNgy#M#8|s|o6`1z*&qdiI9nc7Ig&MD*Y`$7B{Lt6|el zOz#5DZM+6)FDITk^_6ZJIQ8F#a+~}DMCM-va`z1Rp!hz1S*!84wd5@cUXy$n`ZNS9 p3V*LCUAUqg6zgMru`1r_e0bjrZyyqu6{lWQaLMpa;TVnq{sWYrinternalAddGeneratedFile( - ' -ó -*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";ÚAparent,service‚Óä“$"/v3/{parent=*/*}/services:service~ - -GetService\'.google.monitoring.v3.GetServiceRequest.google.monitoring.v3.Service"(ÚAname‚Óä“/v3/{name=*/*/services/*}‘ - ListServices).google.monitoring.v3.ListServicesRequest*.google.monitoring.v3.ListServicesResponse"*ÚAparent‚Óä“/v3/{parent=*/*}/services˜ - UpdateService*.google.monitoring.v3.UpdateServiceRequest.google.monitoring.v3.Service"<ÚAservice‚Óä“,2!/v3/{service.name=*/*/services/*}:service} - DeleteService*.google.monitoring.v3.DeleteServiceRequest.google.protobuf.Empty"(ÚAname‚Óä“*/v3/{name=*/*/services/*}ú -CreateServiceLevelObjective8.google.monitoring.v3.CreateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"tÚAparent,service_level_objective‚Óä“M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:service_level_objectiveÁ -GetServiceLevelObjective5.google.monitoring.v3.GetServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"AÚAname‚Óä“42/v3/{name=*/*/services/*/serviceLevelObjectives/*}Ô -ListServiceLevelObjectives7.google.monitoring.v3.ListServiceLevelObjectivesRequest8.google.monitoring.v3.ListServiceLevelObjectivesResponse"CÚAparent‚Óä“42/v3/{parent=*/*/services/*}/serviceLevelObjectivesŒ -UpdateServiceLevelObjective8.google.monitoring.v3.UpdateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"…ÚAservice_level_objective‚Óä“e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:service_level_objective² -DeleteServiceLevelObjective8.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.google.protobuf.Empty"AÚAname‚Óä“4*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}©Ê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.v3BServiceMonitoringServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php deleted file mode 100644 index eeb8487aad2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Snooze.php +++ /dev/null @@ -1,39 +0,0 @@ -internalAddGeneratedFile( - ' - -!google/monitoring/v3/snooze.protogoogle.monitoring.v3google/api/resource.proto!google/monitoring/v3/common.proto"Å -Snooze -name ( BàA< -criteria ( 2%.google.monitoring.v3.Snooze.CriteriaBàA9 -interval ( 2".google.monitoring.v3.TimeIntervalBàA - display_name ( BàAH -Criteria< -policies ( B*úA\' -%monitoring.googleapis.com/AlertPolicy:JêAG - monitoring.googleapis.com/Snooze#projects/{project}/snoozes/{snooze}BÆ -com.google.monitoring.v3B SnoozeProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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/SnoozeService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php deleted file mode 100644 index c0b830a5319..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SnoozeService.php +++ /dev/null @@ -1,56 +0,0 @@ -internalAddGeneratedFile( - ' -• -)google/monitoring/v3/snooze_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/snooze.proto google/protobuf/field_mask.proto"‚ -CreateSnoozeRequest8 -parent ( B(àAúA" monitoring.googleapis.com/Snooze1 -snooze ( 2.google.monitoring.v3.SnoozeBàA"” -ListSnoozesRequest8 -parent ( B(àAúA" monitoring.googleapis.com/Snooze -filter ( BàA - page_size (BàA - -page_token ( BàA"] -ListSnoozesResponse- -snoozes ( 2.google.monitoring.v3.Snooze -next_page_token ( "J -GetSnoozeRequest6 -name ( B(àAúA" - monitoring.googleapis.com/Snooze"~ -UpdateSnoozeRequest1 -snooze ( 2.google.monitoring.v3.SnoozeBàA4 - update_mask ( 2.google.protobuf.FieldMaskBàA2˜ - SnoozeService˜ - CreateSnooze).google.monitoring.v3.CreateSnoozeRequest.google.monitoring.v3.Snooze"?ÚA parent,snooze‚Óä“)"/v3/{parent=projects/*}/snoozes:snooze” - ListSnoozes(.google.monitoring.v3.ListSnoozesRequest).google.monitoring.v3.ListSnoozesResponse"0ÚAparent‚Óä“!/v3/{parent=projects/*}/snoozes - GetSnooze&.google.monitoring.v3.GetSnoozeRequest.google.monitoring.v3.Snooze".ÚAname‚Óä“!/v3/{name=projects/*/snoozes/*}¤ - UpdateSnooze).google.monitoring.v3.UpdateSnoozeRequest.google.monitoring.v3.Snooze"KÚAsnooze,update_mask‚Óä“02&/v3/{snooze.name=projects/*/snoozes/*}:snooze©Ê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.v3BSnoozeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index ed30a8928d9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php +++ /dev/null @@ -1,29 +0,0 @@ -internalAddGeneratedFile( - ' -· -\'google/monitoring/v3/span_context.protogoogle.monitoring.v3" - SpanContext - span_name ( BË -com.google.monitoring.v3BSpanContextProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 36ba869253e4af40d3ac4226633f0eec61f3f9e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5190 zcmb_gOLN=S6*ehRqz?6as~qdS0rKz zK=DvV_Gr^z&`tkDr^{};?PT&By6$wcXcz6aGd=eL;M=j3sWu|cz31HX_|D_rUw&o} zZ1|9`6O%ZqM|A$|iuVSDw;ju~G;7G8`RC`v;Wg{RHipD0@O(|;o080nwTAovSzXI_ zG*agKmen7U{R_)9Jj*f6{{CfY-?u&Ef)toE08_mnuB~c>ueU14#8Y+EQ+svB*gGCE z_D)I%0NPM>UB1f%z#HK4&-TxThQ_;|>fyhKhN~EOn4u1h*Qoh3{#+fp1X<_zp8KZe z8J5XY2FcXO-eW$HN%uaqEwuC*AF0x!#-riAhUpQdORP3tG{jow4r-mMwnag1H0zldmxg4!+icR0csZVp<$w1+Yy}z0%&c1GxzWFo zsRzJ?F`4i@vpQY8AL)+qDa^t3@D3-zMiddH?^wRgoRcno95GIXyD+C=Ap&uoGNZsc zz`*ltMWeyWCeVZF;?tW7J48-q{$Y$0Vb#Nc1#)O$(#4dE0vuLJ^ zyOE3tafK+CxF?XLCD!u2Y>J)t9eZ1l(Jag_(^D=~50!M>>?*&6O8z`L;9Z`>5L5o+ zfSqf=8nYD<>0Q|*yT!m)y0Nq%Ib>wz1jx8#h?r)8=wqF5vw+HN6nl@}DX&c^19uP7 ztSJOlJG+V6q$&tht_E9CVF`jmP2XUq|8TMJnM`3)jv(#3XzEZsBSSa4!}vd0%s&sh zF0vjmPSNz7tDFk!Q#j;kwo^dTqz=l&b66h%o%xs6iMKn1!8wviotk?9(85+6CgwJz zZTxZ-&GJo;osr1>a}`!c5awRe)cTE2T!aYm28ck4s*U1jH??vk3X_bn~uAvDi2LWqnto6{s zd!f3olmSt7iUFGIDJ&?-h_J$f`uz5%9R?CvY`G5RMVM(UZmZ0R&u%X@%r}-H@58p{ zyPkD{@e8t;$zDgIwp?x5#Oz%Ff6JJZB$w83fVPOAzduqRP-3OxldtxQ7AE8Xf{rC zRixNBG-3nQ16bw$76)#DYVW~XXg2!H51MiU`@mpCXVWJWvQcc^ROdV?YIyOfxA^A`7 zIr7ht{QIRj^2bR2&pcUZewq14va$~83B2SAur>wzG%UR$S7Gs5heY6Amf_|2FJk#J zEqRkw;XUAvMfp&w%@~}7rMf8N$dQ8Omei3m@jSw5G8xb%@|P`fhK~*~?IT5OR;3ya zFfncm*1H|Ct+d+GNrRH&Sa(xVt7S!qmK|Dd6SIh=dVfE}ev^QWP}!(cV*LxVHgr#~ z2g$GthdBG(b^H0kh8?!P$b z&QQ_gtD}QMQyo}iq-k?|z5kCMg&7S32jn%lyKsTqgNL7Yq^8mmk+@0J#URtT_!aY^j@j7kc zg*QSB>%h6EusJil;8ozeGrf!1Ix*Z~c|$i>zd$!E$Xcudw7fN{N~5KO`#R|E46L2B zs$BSQ~*-Z7+Bc>j!oQnT@A)G zIs@cQEOTR%8aDR{tT=2YW-0jgk#T}6oT0Ia4y|BX3THD8z_1kr2P)wPH`6D7h)v!6 zLS76c;&MKbu$*^00!9>IMeMevmY88+?nqtCLE%_zH>v`H83QhK8Um&!y@6IU%iIP4 zaw-yvm6`}(ypYoGhV)X%tkC`R>!i`HH<}G0lYH`P*qWPyx%;r&7V)fhRa^u=l!@sl z3(cyCDq@NVFFT5OR8fv3p{7)XBf8Sg#4CS|K^8H#uxwS*fh$||?Wh&|m7onRUyrs@ zWcID-u>oiBeFQANk6jigX!hB`7}xgMALF??dm1ZLnW*E@16kpu^i8zb>#^0|internalAddGeneratedFile( - ' -˜ -)google/monitoring/v3/uptime_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto!google/monitoring/v3/uptime.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"› -ListUptimeCheckConfigsRequestC -parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfig -filter (  - 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";ÚAparent‚Óä“,*/v3/{parent=projects/*}/uptimeCheckConfigs­ -GetUptimeCheckConfig1.google.monitoring.v3.GetUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"9ÚAname‚Óä“,*/v3/{name=projects/*/uptimeCheckConfigs/*}Þ -CreateUptimeCheckConfig4.google.monitoring.v3.CreateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"dÚAparent,uptime_check_config‚Óä“A"*/v3/{parent=projects/*}/uptimeCheckConfigs:uptime_check_configë -UpdateUptimeCheckConfig4.google.monitoring.v3.UpdateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"qÚAuptime_check_config‚Óä“U2>/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}:uptime_check_config¢ -DeleteUptimeCheckConfig4.google.monitoring.v3.DeleteUptimeCheckConfigRequest.google.protobuf.Empty"9ÚAname‚Óä“,**/v3/{name=projects/*/uptimeCheckConfigs/*}“ -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.v3BUptimeServiceProtoPZAcloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpbª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 deleted file mode 100644 index 7d97df10e8e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php +++ /dev/null @@ -1,389 +0,0 @@ -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 array|\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 array|\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 deleted file mode 100644 index 9f2767800da..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php +++ /dev/null @@ -1,269 +0,0 @@ -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 deleted file mode 100644 index c5d065c3b4e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Reducer.php +++ /dev/null @@ -1,191 +0,0 @@ -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/AlertPolicy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php deleted file mode 100644 index 64b014d4429..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy.php +++ /dev/null @@ -1,805 +0,0 @@ -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 Cloud 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * - * 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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * - * 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`. - * If `condition_monitoring_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. This field is - * only set when the alert policy is invalid. An invalid 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; - /** - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $severity = 0; - - /** - * 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 Cloud 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * @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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * @type array<\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`. - * If `condition_monitoring_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. This field is - * only set when the alert policy is invalid. An invalid alert policy will not - * generate incidents. - * @type array|\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. - * @type int $severity - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * } - */ - 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 Cloud 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 Cloud 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * - * 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. - * The convention for the display_name of a PrometheusQueryLanguageCondition - * is "{rule group name}/{alert name}", where the {rule group name} and - * {alert name} should be taken from the corresponding Prometheus - * configuration file. This convention is not enforced. - * In any case the display_name is not a unique key of the AlertPolicy. - * - * 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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * - * 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. - * Note that Prometheus {alert name} is a - * [valid Prometheus label - * names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), - * whereas Prometheus {rule group} is an unrestricted UTF-8 string. - * This means that they cannot be stored as-is in user labels, because - * they may contain characters that are not allowed in user-label values. - * - * 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`. - * If `condition_monitoring_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`. - * If `condition_monitoring_query_language` is present, it must be the only - * `condition`. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; - * @param array<\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. This field is - * only set when the alert policy is invalid. An invalid 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. This field is - * only set when the alert policy is invalid. An invalid 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 array|\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; - } - - /** - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSeverity() - { - return $this->severity; - } - - /** - * Optional. The severity of an alert policy indicates how important incidents - * generated by that policy are. The severity level will be displayed on the - * Incident detail page and in notifications. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSeverity($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Severity::class); - $this->severity = $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 deleted file mode 100644 index d5a4cff1ce3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php +++ /dev/null @@ -1,167 +0,0 @@ -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; - /** - * Control how notifications will be sent out, on a per-channel basis. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; - */ - private $notification_channel_strategy; - - /** - * 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 - * @type array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $notification_channel_strategy - * Control how notifications will be sent out, on a per-channel basis. - * } - */ - 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; - } - - /** - * Control how notifications will be sent out, on a per-channel basis. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNotificationChannelStrategy() - { - return $this->notification_channel_strategy; - } - - /** - * Control how notifications will be sent out, on a per-channel basis. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy notification_channel_strategy = 4; - * @param array<\Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNotificationChannelStrategy($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy\NotificationChannelStrategy::class); - $this->notification_channel_strategy = $arr; - - 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/NotificationChannelStrategy.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php deleted file mode 100644 index 3fb4be79589..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationChannelStrategy.php +++ /dev/null @@ -1,139 +0,0 @@ -google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationChannelStrategy - */ -class NotificationChannelStrategy extends \Google\Protobuf\Internal\Message -{ - /** - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channel_names = 1; - */ - private $notification_channel_names; - /** - * The frequency at which to send reminder notifications for open - * incidents. - * - * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; - */ - protected $renotify_interval = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $notification_channel_names - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @type \Google\Protobuf\Duration $renotify_interval - * The frequency at which to send reminder notifications for open - * incidents. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channel_names = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNotificationChannelNames() - { - return $this->notification_channel_names; - } - - /** - * The full REST resource name for the notification channels that these - * settings apply to. Each of these correspond to the name field in one - * of the NotificationChannel objects referenced in the - * notification_channels field of this AlertPolicy. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channel_names = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNotificationChannelNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->notification_channel_names = $arr; - - return $this; - } - - /** - * The frequency at which to send reminder notifications for open - * incidents. - * - * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getRenotifyInterval() - { - return $this->renotify_interval; - } - - public function hasRenotifyInterval() - { - return isset($this->renotify_interval); - } - - public function clearRenotifyInterval() - { - unset($this->renotify_interval); - } - - /** - * The frequency at which to send reminder notifications for open - * incidents. - * - * Generated from protobuf field .google.protobuf.Duration renotify_interval = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRenotifyInterval($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->renotify_interval = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NotificationChannelStrategy::class, \Google\Cloud\Monitoring\V3\AlertPolicy_AlertStrategy_NotificationChannelStrategy::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 deleted file mode 100644 index a487e3fd361..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100644 index c476fb7bd10..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php +++ /dev/null @@ -1,373 +0,0 @@ -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 Cloud 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. Cloud 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 Cloud 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. Cloud 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. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $condition_prometheus_query_language - * A condition that uses the Prometheus 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 Cloud 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. Cloud 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 Cloud 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. Cloud 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; - } - - /** - * A condition that uses the Prometheus query language to define alerts. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition|null - */ - public function getConditionPrometheusQueryLanguage() - { - return $this->readOneof(21); - } - - public function hasConditionPrometheusQueryLanguage() - { - return $this->hasOneof(21); - } - - /** - * A condition that uses the Prometheus query language to define alerts. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition $var - * @return $this - */ - public function setConditionPrometheusQueryLanguage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\PrometheusQueryLanguageCondition::class); - $this->writeOneof(21, $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/EvaluationMissingData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php deleted file mode 100644 index 6fc5a47b481..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/EvaluationMissingData.php +++ /dev/null @@ -1,76 +0,0 @@ -google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData - */ -class EvaluationMissingData -{ - /** - * An unspecified evaluation missing data option. Equivalent to - * EVALUATION_MISSING_DATA_NO_OP. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_UNSPECIFIED = 0; - */ - const EVALUATION_MISSING_DATA_UNSPECIFIED = 0; - /** - * If there is no data to evaluate the condition, then evaluate the - * condition as false. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_INACTIVE = 1; - */ - const EVALUATION_MISSING_DATA_INACTIVE = 1; - /** - * If there is no data to evaluate the condition, then evaluate the - * condition as true. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_ACTIVE = 2; - */ - const EVALUATION_MISSING_DATA_ACTIVE = 2; - /** - * Do not evaluate the condition to any value if there is no data. - * - * Generated from protobuf enum EVALUATION_MISSING_DATA_NO_OP = 3; - */ - const EVALUATION_MISSING_DATA_NO_OP = 3; - - private static $valueToName = [ - self::EVALUATION_MISSING_DATA_UNSPECIFIED => 'EVALUATION_MISSING_DATA_UNSPECIFIED', - self::EVALUATION_MISSING_DATA_INACTIVE => 'EVALUATION_MISSING_DATA_INACTIVE', - self::EVALUATION_MISSING_DATA_ACTIVE => 'EVALUATION_MISSING_DATA_ACTIVE', - self::EVALUATION_MISSING_DATA_NO_OP => 'EVALUATION_MISSING_DATA_NO_OP', - ]; - - 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(EvaluationMissingData::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_EvaluationMissingData::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 deleted file mode 100644 index cd52e655a01..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php +++ /dev/null @@ -1,151 +0,0 @@ -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 deleted file mode 100644 index fc6aad1dfc4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php +++ /dev/null @@ -1,304 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 74e9099f57f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php +++ /dev/null @@ -1,635 +0,0 @@ -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; - /** - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; - */ - protected $forecast_options = null; - /** - * 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; - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - */ - protected $evaluation_missing_data = 0; - - /** - * 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 array<\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 array<\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 \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $forecast_options - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * @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. - * @type int $evaluation_missing_data - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * } - */ - 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 array<\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 array<\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; - } - - /** - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions|null - */ - public function getForecastOptions() - { - return $this->forecast_options; - } - - public function hasForecastOptions() - { - return isset($this->forecast_options); - } - - public function clearForecastOptions() - { - unset($this->forecast_options); - } - - /** - * When this field is present, the `MetricThreshold` condition forecasts - * whether the time series is predicted to violate the threshold within - * the `forecast_horizon`. When this field is not set, the - * `MetricThreshold` tests the current value of the timeseries against the - * threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions forecast_options = 12; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions $var - * @return $this - */ - public function setForecastOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold\ForecastOptions::class); - $this->forecast_options = $var; - - 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; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * @return int - */ - public function getEvaluationMissingData() - { - return $this->evaluation_missing_data; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. To use this control, the value - * of the `duration` field must be greater than or equal to 60 seconds. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 11; - * @param int $var - * @return $this - */ - public function setEvaluationMissingData($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); - $this->evaluation_missing_data = $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/MetricThreshold/ForecastOptions.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php deleted file mode 100644 index 5b730b5b812..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold/ForecastOptions.php +++ /dev/null @@ -1,101 +0,0 @@ -google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.ForecastOptions - */ -class ForecastOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * - * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $forecast_horizon = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Duration $forecast_horizon - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * - * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Duration|null - */ - public function getForecastHorizon() - { - return $this->forecast_horizon; - } - - public function hasForecastHorizon() - { - return isset($this->forecast_horizon); - } - - public function clearForecastHorizon() - { - unset($this->forecast_horizon); - } - - /** - * Required. The length of time into the future to forecast whether a - * time series will violate the threshold. If the predicted value is - * found to violate the threshold, and the violation is observed in all - * forecasts made for the configured `duration`, then the time series is - * considered to be failing. - * The forecast horizon can range from 1 hour to 60 hours. - * - * Generated from protobuf field .google.protobuf.Duration forecast_horizon = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setForecastHorizon($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->forecast_horizon = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ForecastOptions::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold_ForecastOptions::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 deleted file mode 100644 index 4752ce7876d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php +++ /dev/null @@ -1,257 +0,0 @@ -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; - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - */ - protected $evaluation_missing_data = 0; - - /** - * 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. - * @type int $evaluation_missing_data - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * } - */ - 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; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * @return int - */ - public function getEvaluationMissingData() - { - return $this->evaluation_missing_data; - } - - /** - * A condition control that determines how metric-threshold conditions - * are evaluated when data stops arriving. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.EvaluationMissingData evaluation_missing_data = 4; - * @param int $var - * @return $this - */ - public function setEvaluationMissingData($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\EvaluationMissingData::class); - $this->evaluation_missing_data = $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/PrometheusQueryLanguageCondition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php deleted file mode 100644 index 6db9f2637a4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/PrometheusQueryLanguageCondition.php +++ /dev/null @@ -1,433 +0,0 @@ -google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition - */ -class PrometheusQueryLanguageCondition extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query = ''; - /** - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $duration = null; - /** - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * - * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $evaluation_interval = null; - /** - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $rule_group = ''; - /** - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $alert_rule = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * @type \Google\Protobuf\Duration $duration - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * @type \Google\Protobuf\Duration $evaluation_interval - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * @type string $rule_group - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * @type string $alert_rule - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. The PromQL expression to evaluate. Every evaluation cycle - * this expression is evaluated at the current time, and all resultant - * time series become pending/firing alerts. This field must not be empty. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Optional. Alerts are considered firing once their PromQL expression was - * evaluated to be "true" for this long. - * Alerts whose PromQL expression was not evaluated to be "true" for - * long enough are considered pending. - * Must be a non-negative duration or missing. - * This field is optional. Its default value is zero. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * - * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Duration|null - */ - public function getEvaluationInterval() - { - return $this->evaluation_interval; - } - - public function hasEvaluationInterval() - { - return isset($this->evaluation_interval); - } - - public function clearEvaluationInterval() - { - unset($this->evaluation_interval); - } - - /** - * Optional. How often this rule should be evaluated. - * Must be a positive multiple of 30 seconds or missing. - * This field is optional. Its default value is 30 seconds. - * If this PrometheusQueryLanguageCondition was generated from a - * Prometheus alerting rule, then this value should be taken from the - * enclosing rule group. - * - * Generated from protobuf field .google.protobuf.Duration evaluation_interval = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setEvaluationInterval($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->evaluation_interval = $var; - - return $this; - } - - /** - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Labels to add to or overwrite in the PromQL query result. - * Label names [must be - * valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * Label values can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * The only available variable names are the names of the labels in the - * PromQL result, including "__name__" and "value". "labels" may be empty. - * - * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @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; - } - - /** - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRuleGroup() - { - return $this->rule_group; - } - - /** - * Optional. The rule group name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must - * contain a valid UTF-8 string. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string rule_group = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRuleGroup($var) - { - GPBUtil::checkString($var, True); - $this->rule_group = $var; - - return $this; - } - - /** - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAlertRule() - { - return $this->alert_rule; - } - - /** - * Optional. The alerting rule name of this alert in the corresponding - * Prometheus configuration file. - * Some external tools may require this field to be populated correctly - * in order to refer to the original Prometheus configuration file. - * The rule group name and the alert name are necessary to update the - * relevant AlertPolicies in case the definition of the rule group changes - * in the future. - * This field is optional. If this field is not empty, then it must be a - * [valid Prometheus label - * name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string alert_rule = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAlertRule($var) - { - GPBUtil::checkString($var, True); - $this->alert_rule = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PrometheusQueryLanguageCondition::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_PrometheusQueryLanguageCondition::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 deleted file mode 100644 index 8daaca29380..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/Trigger.php +++ /dev/null @@ -1,118 +0,0 @@ -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 deleted file mode 100644 index bb9e016f4bd..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php +++ /dev/null @@ -1,81 +0,0 @@ -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 => 'AND', - self::PBOR => 'OR', - 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)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - 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 deleted file mode 100644 index 7df7159cc1b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php +++ /dev/null @@ -1,207 +0,0 @@ -google.monitoring.v3.AlertPolicy.Documentation - */ -class Documentation extends \Google\Protobuf\Internal\Message -{ - /** - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * - * 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 = ''; - /** - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * - * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $subject = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * @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. - * @type string $subject - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * - * Generated from protobuf field string content = 1; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * The body 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. This text can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * - * 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; - } - - /** - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * - * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSubject() - { - return $this->subject; - } - - /** - * Optional. The subject line of the notification. The subject line may not - * exceed 10,240 bytes. In notifications generated by this policy, the - * contents of the subject line after variable expansion will be truncated - * to 255 bytes or shorter at the latest UTF-8 character boundary. The - * 255-byte limit is recommended by [this - * thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). - * It is both the limit imposed by some third-party ticketing products and - * it is common to define textual fields in databases as VARCHAR(255). - * The contents of the subject line can be [templatized by using - * variables](https://cloud.google.com/monitoring/alerts/doc-variables). - * If this field is missing or empty, a default subject line will be - * generated. - * - * Generated from protobuf field string subject = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSubject($var) - { - GPBUtil::checkString($var, True); - $this->subject = $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/AlertPolicy/Severity.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php deleted file mode 100644 index 76e47474924..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Severity.php +++ /dev/null @@ -1,75 +0,0 @@ -google.monitoring.v3.AlertPolicy.Severity - */ -class Severity -{ - /** - * No severity is specified. This is the default value. - * - * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; - */ - const SEVERITY_UNSPECIFIED = 0; - /** - * This is the highest severity level. Use this if the problem could - * cause significant damage or downtime. - * - * Generated from protobuf enum CRITICAL = 1; - */ - const CRITICAL = 1; - /** - * This is the medium severity level. Use this if the problem could - * cause minor damage or downtime. - * - * Generated from protobuf enum ERROR = 2; - */ - const ERROR = 2; - /** - * This is the lowest severity level. Use this if the problem is not causing - * any damage or downtime, but could potentially lead to a problem in the - * future. - * - * Generated from protobuf enum WARNING = 3; - */ - const WARNING = 3; - - private static $valueToName = [ - self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', - self::CRITICAL => 'CRITICAL', - self::ERROR => 'ERROR', - self::WARNING => 'WARNING', - ]; - - 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(Severity::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Severity::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php deleted file mode 100644 index 5becfda99f4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli.php +++ /dev/null @@ -1,269 +0,0 @@ -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 array|\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 array|\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 array|\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 array|\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 array|\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 array|\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 deleted file mode 100644 index 39790b19ee0..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100644 index 331b6b6e46f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/LatencyCriteria.php +++ /dev/null @@ -1,84 +0,0 @@ -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/ComparisonType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php deleted file mode 100644 index d86a3fbc2cd..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ComparisonType.php +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100644 index 6c9c18ef40f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php +++ /dev/null @@ -1,188 +0,0 @@ -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 Metrics Scope, 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; - - /** - * @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 Metrics Scope, 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 \Google\Cloud\Monitoring\V3\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. - * - * @return \Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self - { - return (new self()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - } - - /** - * 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 Metrics Scope, 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 Metrics Scope, 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 Metrics Scope, 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 deleted file mode 100644 index bad7c64edac..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php +++ /dev/null @@ -1,181 +0,0 @@ -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; - - /** - * @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 \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. - * - * @return \Google\Cloud\Monitoring\V3\CreateGroupRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Monitoring\V3\Group $group): self - { - return (new self()) - ->setName($name) - ->setGroup($group); - } - - /** - * 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 deleted file mode 100644 index 45d737e63e8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -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; - - /** - * @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 \Google\Api\MetricDescriptor $metricDescriptor Required. The new [custom - * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. - * - * @return \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest - * - * @experimental - */ - public static function build(string $name, \Google\Api\MetricDescriptor $metricDescriptor): self - { - return (new self()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - } - - /** - * 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 deleted file mode 100644 index 2a528898beb..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php +++ /dev/null @@ -1,163 +0,0 @@ -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; - - /** - * @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 \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel Required. The definition of the `NotificationChannel` to create. - * - * @return \Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self - { - return (new self()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - } - - /** - * 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 deleted file mode 100644 index 151f66b7a84..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -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-zA-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; - - /** - * @param string $parent Required. Resource name of the parent `Service`. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * - * @return \Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self - { - return (new self()) - ->setParent($parent) - ->setServiceLevelObjective($serviceLevelObjective); - } - - /** - * 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-zA-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-zA-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-zA-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 deleted file mode 100644 index 7d9425e30c5..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php +++ /dev/null @@ -1,180 +0,0 @@ -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 Metrics Scope. 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; - - /** - * @param string $parent Required. Resource - * [name](https://cloud.google.com/monitoring/api/v3#project_name) of the - * parent Metrics Scope. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to create. - * - * @return \Google\Cloud\Monitoring\V3\CreateServiceRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\Service $service): self - { - return (new self()) - ->setParent($parent) - ->setService($service); - } - - /** - * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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/CreateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php deleted file mode 100644 index c03b63fbc9d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateSnoozeRequest.php +++ /dev/null @@ -1,149 +0,0 @@ -google.monitoring.v3.CreateSnoozeRequest - */ -class CreateSnoozeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $snooze = null; - - /** - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. - * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * @return \Google\Cloud\Monitoring\V3\CreateSnoozeRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\Snooze $snooze): self - { - return (new self()) - ->setParent($parent) - ->setSnooze($snooze); - } - - /** - * 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 - * a `Snooze` should be created. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type \Google\Cloud\Monitoring\V3\Snooze $snooze - * Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. 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 - * a `Snooze` should be created. 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 `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Snooze|null - */ - public function getSnooze() - { - return $this->snooze; - } - - public function hasSnooze() - { - return isset($this->snooze); - } - - public function clearSnooze() - { - unset($this->snooze); - } - - /** - * Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Snooze $var - * @return $this - */ - public function setSnooze($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); - $this->snooze = $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 deleted file mode 100644 index 556d57d6608..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100644 index 66cb39cd93a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -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; - - /** - * @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] - * Please see {@see MetricServiceClient::projectName()} for help formatting this field. - * @param \Google\Cloud\Monitoring\V3\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. - * - * @return \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest - * - * @experimental - */ - public static function build(string $name, array $timeSeries): self - { - return (new self()) - ->setName($name) - ->setTimeSeries($timeSeries); - } - - /** - * 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 array<\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 array<\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 deleted file mode 100644 index 8fb4fe1f025..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php +++ /dev/null @@ -1,135 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 5bd917825b9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php +++ /dev/null @@ -1,114 +0,0 @@ -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/CreateUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php deleted file mode 100644 index 991e2028b3a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateUptimeCheckConfigRequest.php +++ /dev/null @@ -1,142 +0,0 @@ -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; - - /** - * @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 \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. - * - * @return \Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self - { - return (new self()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - } - - /** - * 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 deleted file mode 100644 index 2333c3a4691..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php +++ /dev/null @@ -1,93 +0,0 @@ -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 = ''; - - /** - * @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]. Please see - * {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index b63a0bdb79f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php +++ /dev/null @@ -1,130 +0,0 @@ -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; - - /** - * @param string $name Required. The group to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * Please see {@see GroupServiceClient::groupName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteGroupRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 3d57dd66af3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -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 = ''; - - /** - * @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"`. Please see - * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 56e0316342e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php +++ /dev/null @@ -1,138 +0,0 @@ -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; - - /** - * @param string $name Required. The channel for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * @param 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. - * - * @return \Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name, bool $force): self - { - return (new self()) - ->setName($name) - ->setForce($force); - } - - /** - * 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 deleted file mode 100644 index 8771b8fb4ab..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -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 = ''; - - /** - * @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] - * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 378fecd0724..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. Resource name of the `Service` to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index dfda97aa016..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The Uptime check configuration to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index cffd93e1651..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DistributionCut.php +++ /dev/null @@ -1,127 +0,0 @@ -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 deleted file mode 100644 index 4fb73d3bdd7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DroppedLabels.php +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100644 index 573ae71a8ad..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The alerting policy to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * Please see {@see AlertPolicyServiceClient::alertPolicyName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetAlertPolicyRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index da9c56f0a13..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The group to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * Please see {@see GroupServiceClient::groupName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetGroupRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 360bdfac4cc..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -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 = ''; - - /** - * @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"`. Please see - * {@see MetricServiceClient::metricDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 82d4800c5e1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php +++ /dev/null @@ -1,98 +0,0 @@ -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 = ''; - - /** - * @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`. Please see - * {@see MetricServiceClient::monitoredResourceDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index f7ff869b729..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The channel type for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] - * Please see {@see NotificationChannelServiceClient::notificationChannelDescriptorName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 708a1446cd9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The channel for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * Please see {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index acb10877c21..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -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; - - /** - * @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. Please see - * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index b62d064177a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeResponse.php +++ /dev/null @@ -1,131 +0,0 @@ -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 deleted file mode 100644 index c22d24403f6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,138 +0,0 @@ -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; - - /** - * @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] - * Please see {@see ServiceMonitoringServiceClient::serviceLevelObjectiveName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 6113d513f42..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. Resource name of the `Service`. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetServiceRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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/GetSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php deleted file mode 100644 index 83b9da5e20f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetSnoozeRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.monitoring.v3.GetSnoozeRequest - */ -class GetSnoozeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * Please see {@see SnoozeServiceClient::snoozeName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetSnoozeRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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 ID of the `Snooze` to retrieve. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_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 deleted file mode 100644 index 83b9a3f2eaa..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The Uptime check configuration to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * Please see {@see UptimeCheckServiceClient::uptimeCheckConfigName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index 4a768d02d74..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Group.php +++ /dev/null @@ -1,257 +0,0 @@ -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 deleted file mode 100644 index ddf9d0eee1a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupResourceType.php +++ /dev/null @@ -1,66 +0,0 @@ -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/InternalChecker.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php deleted file mode 100644 index 19273fdc3f2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php +++ /dev/null @@ -1,271 +0,0 @@ -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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Cloud Monitoring Metrics Scope 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 Metrics Scope 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 Metrics Scope 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 deleted file mode 100644 index d006a60c773..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php +++ /dev/null @@ -1,74 +0,0 @@ -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/LabelValue.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php deleted file mode 100644 index 3a66a26a435..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/LabelValue.php +++ /dev/null @@ -1,141 +0,0 @@ -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 deleted file mode 100644 index cda153f70a1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php +++ /dev/null @@ -1,294 +0,0 @@ -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 = ''; - - /** - * @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. - * - * @return \Google\Cloud\Monitoring\V3\ListAlertPoliciesRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 45d31688ec1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesResponse.php +++ /dev/null @@ -1,147 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 876c5364c1a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php +++ /dev/null @@ -1,277 +0,0 @@ -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; - - /** - * @param string $name Required. The group whose members are listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * Please see {@see GroupServiceClient::groupName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\ListGroupMembersRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 8cfc0e8fcd3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersResponse.php +++ /dev/null @@ -1,143 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 7203ea37100..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php +++ /dev/null @@ -1,316 +0,0 @@ -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; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListGroupsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 98e3257f20a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 800b557691f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php +++ /dev/null @@ -1,238 +0,0 @@ -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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * - * 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 = ''; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * @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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * - * 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. The - * default and maximum value is 10,000. If a page_size <= 0 or > 10,000 is - * submitted, will instead return a maximum of 10,000 results. - * - * 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 deleted file mode 100644 index 4ea2039e212..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 14696bd981c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php +++ /dev/null @@ -1,222 +0,0 @@ -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 = ''; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 07992037c86..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index ef7d9522e6f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php +++ /dev/null @@ -1,206 +0,0 @@ -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 = ''; - - /** - * @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. - * - * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 93034ae1599..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsResponse.php +++ /dev/null @@ -1,117 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 6bced117ff1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php +++ /dev/null @@ -1,307 +0,0 @@ -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 = ''; - - /** - * @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. - * - * @return \Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * 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 deleted file mode 100644 index 28dc01fb0af..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsResponse.php +++ /dev/null @@ -1,151 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 19128d58f56..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php +++ /dev/null @@ -1,257 +0,0 @@ -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 Metrics Scope. 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; - - /** - * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Metrics Scope. The formats are: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * Please see {@see ServiceMonitoringServiceClient::serviceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 Metrics Scope. 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 Metrics Scope. 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 Metrics Scope. 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 deleted file mode 100644 index 8e9d2ead1ab..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 795a4e8e34e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php +++ /dev/null @@ -1,275 +0,0 @@ -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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * 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 = ''; - - /** - * @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 Metrics Scope. The formats are: - * - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * - * @return \Google\Cloud\Monitoring\V3\ListServicesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * @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 Metrics Scope. 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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * 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 deleted file mode 100644 index 4359a2689b2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -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 array<\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 array<\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/ListSnoozesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php deleted file mode 100644 index ff92a8e233f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesRequest.php +++ /dev/null @@ -1,252 +0,0 @@ -google.monitoring.v3.ListSnoozesRequest - */ -class ListSnoozesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be 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 = ''; - /** - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * Please see {@see SnoozeServiceClient::workspaceName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\ListSnoozesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 - * `Snooze`s should be listed. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type string $filter - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * @type int $page_size - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * @type string $page_token - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be 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 - * `Snooze`s should be 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; - } - - /** - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * * `interval.start_time` - * * `interval.end_time` - * For example: - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of results to return for a single query. The - * server may further constrain the maximum number of results returned in a - * single page. The value should be in the range [1, 1000]. If the value given - * is outside this range, the server will decide the number of results to be - * returned. - * - * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The `next_page_token` from a previous call to - * `ListSnoozesRequest` to get the next page of results. - * - * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @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/ListSnoozesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php deleted file mode 100644 index e22e8db840e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListSnoozesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.monitoring.v3.ListSnoozesResponse - */ -class ListSnoozesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * `Snooze`s matching this list call. - * - * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; - */ - private $snoozes; - /** - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * - * 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 array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $snoozes - * `Snooze`s matching this list call. - * @type string $next_page_token - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * `Snooze`s matching this list call. - * - * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSnoozes() - { - return $this->snoozes; - } - - /** - * `Snooze`s matching this list call. - * - * Generated from protobuf field repeated .google.monitoring.v3.Snooze snoozes = 1; - * @param array<\Google\Cloud\Monitoring\V3\Snooze>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSnoozes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Snooze::class); - $this->snoozes = $arr; - - return $this; - } - - /** - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Page token for repeated calls to `ListSnoozes`, to fetch additional pages - * of results. If this is empty or missing, there are no more pages. - * - * 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 deleted file mode 100644 index 0b123db098c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php +++ /dev/null @@ -1,501 +0,0 @@ -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 = ''; - - /** - * @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] - * Please see {@see MetricServiceClient::workspaceName()} for help formatting this field. - * @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 \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. - * @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} - * - * @return \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest - * - * @experimental - */ - public static function build(string $name, string $filter, \Google\Cloud\Monitoring\V3\TimeInterval $interval, int $view): self - { - return (new self()) - ->setName($name) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - } - - /** - * 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 deleted file mode 100644 index cd4d2c1bcc5..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest/TimeSeriesView.php +++ /dev/null @@ -1,59 +0,0 @@ -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/ListTimeSeriesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php deleted file mode 100644 index f2d874bd347..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesResponse.php +++ /dev/null @@ -1,201 +0,0 @@ -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 array<\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 array<\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 array<\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 array<\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 deleted file mode 100644 index 0718e498334..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php +++ /dev/null @@ -1,230 +0,0 @@ -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 = ''; - /** - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * 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 = ''; - - /** - * @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] - * - * @return \Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * 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 string $filter - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * @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; - } - - /** - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * - * 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; - } - - /** - * 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 deleted file mode 100644 index f12354762fe..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php +++ /dev/null @@ -1,155 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index f2d106e8898..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -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 deleted file mode 100644 index 26da2fcdd61..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsResponse.php +++ /dev/null @@ -1,125 +0,0 @@ -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 array<\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 array<\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/MutationRecord.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php deleted file mode 100644 index 73a1f82bce8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100644 index 0ef18788e23..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php +++ /dev/null @@ -1,594 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 2b70fa84287..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100644 index f9e6c8c2714..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelDescriptor.php +++ /dev/null @@ -1,326 +0,0 @@ -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 array<\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 array|\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 array<\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 array|\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/Point.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php deleted file mode 100644 index 5db4ed6c5b7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Point.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 8ff8ad79a2a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryError.php +++ /dev/null @@ -1,115 +0,0 @@ -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 deleted file mode 100644 index 95542afd49b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryErrorList.php +++ /dev/null @@ -1,105 +0,0 @@ -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 array<\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 array<\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/QueryTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php deleted file mode 100644 index 05eb26d2f95..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -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 deleted file mode 100644 index 79b8487cb24..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesResponse.php +++ /dev/null @@ -1,195 +0,0 @@ -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 array<\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 array<\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 array<\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 array<\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 deleted file mode 100644 index 3dd0db9c39f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100644 index e4820f273c2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/RequestBasedSli.php +++ /dev/null @@ -1,121 +0,0 @@ -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 deleted file mode 100644 index efa0e97e35b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php +++ /dev/null @@ -1,81 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The notification channel to which to send a verification code. Please see - * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * - * @return \Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($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 deleted file mode 100644 index a07a1f621e8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service.php +++ /dev/null @@ -1,420 +0,0 @@ -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 deleted file mode 100644 index 8f04ef19e93..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/AppEngine.php +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100644 index 24cc957f7c8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/CloudEndpoints.php +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100644 index bcbab5c1818..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/ClusterIstio.php +++ /dev/null @@ -1,198 +0,0 @@ -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 deleted file mode 100644 index 08ba22af9c2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Custom.php +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100644 index 0feb3f3aaa8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php +++ /dev/null @@ -1,171 +0,0 @@ -= - * 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 deleted file mode 100644 index e90ac6f8b63..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/MeshIstio.php +++ /dev/null @@ -1,151 +0,0 @@ -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 deleted file mode 100644 index 6bb4bd89086..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/Telemetry.php +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100644 index a1d08a4e348..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelIndicator.php +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100644 index 82a234459a4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective.php +++ /dev/null @@ -1,338 +0,0 @@ -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 deleted file mode 100644 index a21fbcb2596..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective/View.php +++ /dev/null @@ -1,71 +0,0 @@ -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/ServiceTier.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php deleted file mode 100644 index 90668230848..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php +++ /dev/null @@ -1,74 +0,0 @@ -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 Cloud Monitoring 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 Cloud Monitoring Premium tier, a higher, more expensive tier of service - * that provides access to all Cloud Monitoring features, lets you use Cloud - * Monitoring 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/Snooze.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php deleted file mode 100644 index 972f136cc0c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze.php +++ /dev/null @@ -1,224 +0,0 @@ -google.monitoring.v3.Snooze - */ -class Snooze extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * - * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $criteria = null; - /** - * Required. The `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * - * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $interval = null; - /** - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * @type \Google\Cloud\Monitoring\V3\Snooze\Criteria $criteria - * Required. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * @type \Google\Cloud\Monitoring\V3\TimeInterval $interval - * Required. The `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * @type string $display_name - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the `Snooze`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * The ID of the `Snooze` will be generated by the system. - * - * 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. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * - * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Snooze\Criteria|null - */ - public function getCriteria() - { - return $this->criteria; - } - - public function hasCriteria() - { - return isset($this->criteria); - } - - public function clearCriteria() - { - unset($this->criteria); - } - - /** - * Required. This defines the criteria for applying the `Snooze`. See - * `Criteria` for more information. - * - * Generated from protobuf field .google.monitoring.v3.Snooze.Criteria criteria = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Snooze\Criteria $var - * @return $this - */ - public function setCriteria($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze\Criteria::class); - $this->criteria = $var; - - return $this; - } - - /** - * Required. The `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * - * 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 `Snooze` will be active from `interval.start_time` through - * `interval.end_time`. - * `interval.start_time` cannot be in the past. There is a 15 second clock - * skew to account for the time it takes for a request to reach the API from - * the UI. - * - * 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; - } - - /** - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. A display name for the `Snooze`. This can be, at most, 512 - * unicode characters. - * - * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php deleted file mode 100644 index 13e62c6c185..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Snooze/Criteria.php +++ /dev/null @@ -1,88 +0,0 @@ -google.monitoring.v3.Snooze.Criteria - */ -class Criteria extends \Google\Protobuf\Internal\Message -{ - /** - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * - * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { - */ - private $policies; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $policies - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Snooze::initOnce(); - parent::__construct($data); - } - - /** - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * - * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPolicies() - { - return $this->policies; - } - - /** - * The specific `AlertPolicy` names for the alert that should be snoozed. - * The format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] - * There is a limit of 16 policies per snooze. This limit is checked during - * snooze creation. - * - * Generated from protobuf field repeated string policies = 1 [(.google.api.resource_reference) = { - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->policies = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Criteria::class, \Google\Cloud\Monitoring\V3\Snooze_Criteria::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php deleted file mode 100644 index cfeb31ba834..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SpanContext.php +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100644 index 6c6c82460c6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator.php +++ /dev/null @@ -1,303 +0,0 @@ -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 deleted file mode 100644 index bd81e7bff71..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator/Position.php +++ /dev/null @@ -1,108 +0,0 @@ -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/TimeInterval.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php deleted file mode 100644 index 1869cd41c8a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeInterval.php +++ /dev/null @@ -1,165 +0,0 @@ -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 deleted file mode 100644 index 884802d3cdc..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeries.php +++ /dev/null @@ -1,404 +0,0 @@ -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 array<\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 array<\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 deleted file mode 100644 index 4c91cd6c80a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php +++ /dev/null @@ -1,114 +0,0 @@ -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 array<\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 array<\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 array<\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 array<\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 deleted file mode 100644 index 9aa86421aa7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php +++ /dev/null @@ -1,116 +0,0 @@ -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 array<\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 array<\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/TimeSeriesDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php deleted file mode 100644 index ec714c4abc2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor.php +++ /dev/null @@ -1,101 +0,0 @@ -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 array<\Google\Api\LabelDescriptor>|\Google\Protobuf\Internal\RepeatedField $label_descriptors - * Descriptors for the labels. - * @type array<\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 array<\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 array<\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 deleted file mode 100644 index ac5dbc3a79e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php +++ /dev/null @@ -1,184 +0,0 @@ -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/TimeSeriesRatio.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php deleted file mode 100644 index bbd4edb9bac..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesRatio.php +++ /dev/null @@ -1,180 +0,0 @@ -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 deleted file mode 100644 index 866bd8da016..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TypedValue.php +++ /dev/null @@ -1,213 +0,0 @@ -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 deleted file mode 100644 index 2e02f8c2541..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php +++ /dev/null @@ -1,239 +0,0 @@ -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; - - /** - * @param \Google\Protobuf\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. - * @param \Google\Cloud\Monitoring\V3\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. - * - * @return \Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest - * - * @experimental - */ - public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\AlertPolicy $alertPolicy): self - { - return (new self()) - ->setUpdateMask($updateMask) - ->setAlertPolicy($alertPolicy); - } - - /** - * 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 deleted file mode 100644 index 1acaca5a69d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php +++ /dev/null @@ -1,134 +0,0 @@ -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; - - /** - * @param \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. - * - * @return \Google\Cloud\Monitoring\V3\UpdateGroupRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\Group $group): self - { - return (new self()) - ->setGroup($group); - } - - /** - * 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 deleted file mode 100644 index 6528f4c7e50..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -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; - - /** - * @param \Google\Protobuf\FieldMask $updateMask The fields to update. - * @param \Google\Cloud\Monitoring\V3\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`. - * - * @return \Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest - * - * @experimental - */ - public static function build(\Google\Protobuf\FieldMask $updateMask, \Google\Cloud\Monitoring\V3\NotificationChannel $notificationChannel): self - { - return (new self()) - ->setUpdateMask($updateMask) - ->setNotificationChannel($notificationChannel); - } - - /** - * 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 deleted file mode 100644 index c6521c3f2a3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -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; - - /** - * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. - * The given `name` specifies the resource to update. - * - * @return \Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\ServiceLevelObjective $serviceLevelObjective): self - { - return (new self()) - ->setServiceLevelObjective($serviceLevelObjective); - } - - /** - * 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 deleted file mode 100644 index c672ae081a8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -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; - - /** - * @param \Google\Cloud\Monitoring\V3\Service $service Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * - * @return \Google\Cloud\Monitoring\V3\UpdateServiceRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\Service $service): self - { - return (new self()) - ->setService($service); - } - - /** - * 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/UpdateSnoozeRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php deleted file mode 100644 index d3091d8bda9..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateSnoozeRequest.php +++ /dev/null @@ -1,227 +0,0 @@ -google.monitoring.v3.UpdateSnoozeRequest - */ -class UpdateSnoozeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `Snooze` to update. Must have the name field present. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $snooze = null; - /** - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Monitoring\V3\Snooze $snooze Required. The `Snooze` to update. Must have the name field present. - * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to update. - * - * For each field listed in `update_mask`: - * - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * - * Fields not listed retain their existing value. - * - * The following are the field names that are accepted in `update_mask`: - * - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * @return \Google\Cloud\Monitoring\V3\UpdateSnoozeRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\Snooze $snooze, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Monitoring\V3\Snooze $snooze - * Required. The `Snooze` to update. Must have the name field present. - * @type \Google\Protobuf\FieldMask $update_mask - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\SnoozeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `Snooze` to update. Must have the name field present. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Snooze|null - */ - public function getSnooze() - { - return $this->snooze; - } - - public function hasSnooze() - { - return isset($this->snooze); - } - - public function clearSnooze() - { - unset($this->snooze); - } - - /** - * Required. The `Snooze` to update. Must have the name field present. - * - * Generated from protobuf field .google.monitoring.v3.Snooze snooze = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Snooze $var - * @return $this - */ - public function setSnooze($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Snooze::class); - $this->snooze = $var; - - return $this; - } - - /** - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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); - } - - /** - * Required. The fields to update. - * For each field listed in `update_mask`: - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * Fields not listed retain their existing value. - * The following are the field names that are accepted in `update_mask`: - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @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 deleted file mode 100644 index 151f4486915..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php +++ /dev/null @@ -1,192 +0,0 @@ -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 corresponding 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; - - /** - * @param \Google\Cloud\Monitoring\V3\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 corresponding 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`. - * - * @return \Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptimeCheckConfig): self - { - return (new self()) - ->setUptimeCheckConfig($uptimeCheckConfig); - } - - /** - * 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 corresponding 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 corresponding 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 corresponding 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 deleted file mode 100644 index 10904aecc43..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php +++ /dev/null @@ -1,711 +0,0 @@ -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 Cloud Monitoring 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 type of checkers to use to execute the Uptime check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; - */ - protected $checker_type = 0; - /** - * 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; - /** - * User-supplied key/value data to be used for organizing and - * identifying the `UptimeCheckConfig` 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 = 20; - */ - private $user_labels; - 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 Cloud Monitoring 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` - * `servicedirectory_service` - * `cloud_run_revision` - * @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 array<\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 $checker_type - * The type of checkers to use to execute the Uptime check. - * @type array|\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 array<\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`. - * @type array|\Google\Protobuf\Internal\MapField $user_labels - * User-supplied key/value data to be used for organizing and - * identifying the `UptimeCheckConfig` 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. - * } - */ - 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 Cloud Monitoring 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 Cloud Monitoring 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` - * `servicedirectory_service` - * `cloud_run_revision` - * - * 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` - * `servicedirectory_service` - * `cloud_run_revision` - * - * 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 array<\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 type of checkers to use to execute the Uptime check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; - * @return int - */ - public function getCheckerType() - { - return $this->checker_type; - } - - /** - * The type of checkers to use to execute the Uptime check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.CheckerType checker_type = 17; - * @param int $var - * @return $this - */ - public function setCheckerType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\CheckerType::class); - $this->checker_type = $var; - - 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 array|\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 array<\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; - } - - /** - * User-supplied key/value data to be used for organizing and - * identifying the `UptimeCheckConfig` 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 = 20; - * @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 `UptimeCheckConfig` 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 = 20; - * @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 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/CheckerType.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php deleted file mode 100644 index e97a33453e2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/CheckerType.php +++ /dev/null @@ -1,69 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.CheckerType - */ -class CheckerType -{ - /** - * The default checker type. Currently converted to `STATIC_IP_CHECKERS` - * on creation, the default conversion behavior may change in the future. - * - * Generated from protobuf enum CHECKER_TYPE_UNSPECIFIED = 0; - */ - const CHECKER_TYPE_UNSPECIFIED = 0; - /** - * `STATIC_IP_CHECKERS` are used for uptime checks that perform egress - * across the public internet. `STATIC_IP_CHECKERS` use the static IP - * addresses returned by `ListUptimeCheckIps`. - * - * Generated from protobuf enum STATIC_IP_CHECKERS = 1; - */ - const STATIC_IP_CHECKERS = 1; - /** - * `VPC_CHECKERS` are used for uptime checks that perform egress using - * Service Directory and private network access. When using `VPC_CHECKERS`, - * the monitored resource type must be `servicedirectory_service`. - * - * Generated from protobuf enum VPC_CHECKERS = 3; - */ - const VPC_CHECKERS = 3; - - private static $valueToName = [ - self::CHECKER_TYPE_UNSPECIFIED => 'CHECKER_TYPE_UNSPECIFIED', - self::STATIC_IP_CHECKERS => 'STATIC_IP_CHECKERS', - self::VPC_CHECKERS => 'VPC_CHECKERS', - ]; - - 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(CheckerType::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_CheckerType::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 deleted file mode 100644 index 6c5646dbef8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php +++ /dev/null @@ -1,158 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.ContentMatcher - */ -class ContentMatcher extends \Google\Protobuf\Internal\Message -{ - /** - * String, regex or JSON 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; - protected $additional_matcher_info; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * String, regex or JSON 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. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $json_path_matcher - * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * String, regex or JSON 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, regex or JSON 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; - } - - /** - * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher|null - */ - public function getJsonPathMatcher() - { - return $this->readOneof(3); - } - - public function hasJsonPathMatcher() - { - return $this->hasOneof(3); - } - - /** - * Matcher information for `MATCHES_JSON_PATH` and `NOT_MATCHES_JSON_PATH` - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher json_path_matcher = 3; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher $var - * @return $this - */ - public function setJsonPathMatcher($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getAdditionalMatcherInfo() - { - return $this->whichOneof("additional_matcher_info"); - } - -} - -// 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 deleted file mode 100644 index 3dffeaa7586..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php +++ /dev/null @@ -1,107 +0,0 @@ -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 if 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; - /** - * Selects JSONPath matching. See `JsonPathMatcher` for details on when - * the match succeeds. JSONPath matching is only supported for HTTP/HTTPS - * checks. - * - * Generated from protobuf enum MATCHES_JSON_PATH = 5; - */ - const MATCHES_JSON_PATH = 5; - /** - * Selects JSONPath matching. See `JsonPathMatcher` for details on when - * the match succeeds. Succeeds when output does _NOT_ match as specified. - * JSONPath is only supported for HTTP/HTTPS checks. - * - * Generated from protobuf enum NOT_MATCHES_JSON_PATH = 6; - */ - const NOT_MATCHES_JSON_PATH = 6; - - 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', - self::MATCHES_JSON_PATH => 'MATCHES_JSON_PATH', - self::NOT_MATCHES_JSON_PATH => 'NOT_MATCHES_JSON_PATH', - ]; - - 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/ContentMatcher/JsonPathMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php deleted file mode 100644 index 04e6f363bfa..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher.php +++ /dev/null @@ -1,114 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher - */ -class JsonPathMatcher extends \Google\Protobuf\Internal\Message -{ - /** - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * - * Generated from protobuf field string json_path = 1; - */ - protected $json_path = ''; - /** - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; - */ - protected $json_matcher = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $json_path - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * @type int $json_matcher - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * - * Generated from protobuf field string json_path = 1; - * @return string - */ - public function getJsonPath() - { - return $this->json_path; - } - - /** - * JSONPath within the response output pointing to the expected - * `ContentMatcher::content` to match against. - * - * Generated from protobuf field string json_path = 1; - * @param string $var - * @return $this - */ - public function setJsonPath($var) - { - GPBUtil::checkString($var, True); - $this->json_path = $var; - - return $this; - } - - /** - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; - * @return int - */ - public function getJsonMatcher() - { - return $this->json_matcher; - } - - /** - * The type of JSONPath match that will be applied to the JSON output - * (`ContentMatcher.content`) - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption json_matcher = 2; - * @param int $var - * @return $this - */ - public function setJsonMatcher($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\JsonPathMatcher\JsonPathMatcherOption::class); - $this->json_matcher = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(JsonPathMatcher::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php deleted file mode 100644 index 965725688ee..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/JsonPathMatcher/JsonPathMatcherOption.php +++ /dev/null @@ -1,68 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.ContentMatcher.JsonPathMatcher.JsonPathMatcherOption - */ -class JsonPathMatcherOption -{ - /** - * No JSONPath matcher type specified (not valid). - * - * Generated from protobuf enum JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; - */ - const JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0; - /** - * Selects 'exact string' matching. The match succeeds if the content at - * the `json_path` within the output is exactly the same as the - * `content` string. - * - * Generated from protobuf enum EXACT_MATCH = 1; - */ - const EXACT_MATCH = 1; - /** - * Selects regular-expression matching. The match succeeds if the - * content at the `json_path` within the output matches the regular - * expression specified in the `content` string. - * - * Generated from protobuf enum REGEX_MATCH = 2; - */ - const REGEX_MATCH = 2; - - private static $valueToName = [ - self::JSON_PATH_MATCHER_OPTION_UNSPECIFIED => 'JSON_PATH_MATCHER_OPTION_UNSPECIFIED', - self::EXACT_MATCH => 'EXACT_MATCH', - self::REGEX_MATCH => 'REGEX_MATCH', - ]; - - 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(JsonPathMatcherOption::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_JsonPathMatcher_JsonPathMatcherOption::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 deleted file mode 100644 index e158f367c01..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php +++ /dev/null @@ -1,678 +0,0 @@ -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; - /** - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * - * Generated from protobuf field string custom_content_type = 13; - */ - protected $custom_content_type = ''; - /** - * 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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * - * Generated from protobuf field bytes body = 10; - */ - protected $body = ''; - /** - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; - */ - private $accepted_response_status_codes; - /** - * Contains information needed to add pings to an HTTP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; - */ - protected $ping_config = null; - - /** - * 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 string $custom_content_type - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * @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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * @type array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $accepted_response_status_codes - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config - * Contains information needed to add pings to an HTTP check. - * } - */ - 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; - } - - /** - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * - * Generated from protobuf field string custom_content_type = 13; - * @return string - */ - public function getCustomContentType() - { - return $this->custom_content_type; - } - - /** - * A user provided content type header to use for the check. The invalid - * configurations outlined in the `content_type` field apply to - * `custom_content_type`, as well as the following: - * 1. `content_type` is `URL_ENCODED` and `custom_content_type` is set. - * 2. `content_type` is `USER_PROVIDED` and `custom_content_type` is not - * set. - * - * Generated from protobuf field string custom_content_type = 13; - * @param string $var - * @return $this - */ - public function setCustomContentType($var) - { - GPBUtil::checkString($var, True); - $this->custom_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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * - * 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: If client libraries aren't used (which performs the conversion - * automatically) base64 encode your `body` data since the field is of - * `bytes` type. - * - * 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; - } - - /** - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAcceptedResponseStatusCodes() - { - return $this->accepted_response_status_codes; - } - - /** - * If present, the check will only pass if the HTTP response status code is - * in this set of status codes. If empty, the HTTP status code will only - * pass if the HTTP status code is 200-299. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode accepted_response_status_codes = 11; - * @param array<\Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAcceptedResponseStatusCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode::class); - $this->accepted_response_status_codes = $arr; - - return $this; - } - - /** - * Contains information needed to add pings to an HTTP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null - */ - public function getPingConfig() - { - return $this->ping_config; - } - - public function hasPingConfig() - { - return isset($this->ping_config); - } - - public function clearPingConfig() - { - unset($this->ping_config); - } - - /** - * Contains information needed to add pings to an HTTP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 12; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var - * @return $this - */ - public function setPingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); - $this->ping_config = $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 deleted file mode 100644 index d193ecd51c7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100644 index 7eeb5f3ad04..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php +++ /dev/null @@ -1,67 +0,0 @@ -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; - /** - * `body` is in `custom_content_type` form. Equivalent to setting the - * `Content-Type` to the contents of `custom_content_type` in the HTTP - * request. - * - * Generated from protobuf enum USER_PROVIDED = 2; - */ - const USER_PROVIDED = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::URL_ENCODED => 'URL_ENCODED', - self::USER_PROVIDED => 'USER_PROVIDED', - ]; - - 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 deleted file mode 100644 index 981e2cbc372..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php +++ /dev/null @@ -1,64 +0,0 @@ -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/HttpCheck/ResponseStatusCode.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php deleted file mode 100644 index 61fe31c3dab..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode.php +++ /dev/null @@ -1,112 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode - */ -class ResponseStatusCode extends \Google\Protobuf\Internal\Message -{ - protected $status_code; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $status_value - * A status code to accept. - * @type int $status_class - * A class of status codes to accept. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * A status code to accept. - * - * Generated from protobuf field int32 status_value = 1; - * @return int - */ - public function getStatusValue() - { - return $this->readOneof(1); - } - - public function hasStatusValue() - { - return $this->hasOneof(1); - } - - /** - * A status code to accept. - * - * Generated from protobuf field int32 status_value = 1; - * @param int $var - * @return $this - */ - public function setStatusValue($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A class of status codes to accept. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; - * @return int - */ - public function getStatusClass() - { - return $this->readOneof(2); - } - - public function hasStatusClass() - { - return $this->hasOneof(2); - } - - /** - * A class of status codes to accept. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass status_class = 2; - * @param int $var - * @return $this - */ - public function setStatusClass($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ResponseStatusCode\StatusClass::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getStatusCode() - { - return $this->whichOneof("status_code"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResponseStatusCode::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php deleted file mode 100644 index ec9ccc03c04..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ResponseStatusCode/StatusClass.php +++ /dev/null @@ -1,92 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.HttpCheck.ResponseStatusCode.StatusClass - */ -class StatusClass -{ - /** - * Default value that matches no status codes. - * - * Generated from protobuf enum STATUS_CLASS_UNSPECIFIED = 0; - */ - const STATUS_CLASS_UNSPECIFIED = 0; - /** - * The class of status codes between 100 and 199. - * - * Generated from protobuf enum STATUS_CLASS_1XX = 100; - */ - const STATUS_CLASS_1XX = 100; - /** - * The class of status codes between 200 and 299. - * - * Generated from protobuf enum STATUS_CLASS_2XX = 200; - */ - const STATUS_CLASS_2XX = 200; - /** - * The class of status codes between 300 and 399. - * - * Generated from protobuf enum STATUS_CLASS_3XX = 300; - */ - const STATUS_CLASS_3XX = 300; - /** - * The class of status codes between 400 and 499. - * - * Generated from protobuf enum STATUS_CLASS_4XX = 400; - */ - const STATUS_CLASS_4XX = 400; - /** - * The class of status codes between 500 and 599. - * - * Generated from protobuf enum STATUS_CLASS_5XX = 500; - */ - const STATUS_CLASS_5XX = 500; - /** - * The class of all status codes. - * - * Generated from protobuf enum STATUS_CLASS_ANY = 1000; - */ - const STATUS_CLASS_ANY = 1000; - - private static $valueToName = [ - self::STATUS_CLASS_UNSPECIFIED => 'STATUS_CLASS_UNSPECIFIED', - self::STATUS_CLASS_1XX => 'STATUS_CLASS_1XX', - self::STATUS_CLASS_2XX => 'STATUS_CLASS_2XX', - self::STATUS_CLASS_3XX => 'STATUS_CLASS_3XX', - self::STATUS_CLASS_4XX => 'STATUS_CLASS_4XX', - self::STATUS_CLASS_5XX => 'STATUS_CLASS_5XX', - self::STATUS_CLASS_ANY => 'STATUS_CLASS_ANY', - ]; - - 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(StatusClass::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php deleted file mode 100644 index ae85d7f1047..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/PingConfig.php +++ /dev/null @@ -1,72 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.PingConfig - */ -class PingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * - * Generated from protobuf field int32 pings_count = 1; - */ - protected $pings_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $pings_count - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * - * Generated from protobuf field int32 pings_count = 1; - * @return int - */ - public function getPingsCount() - { - return $this->pings_count; - } - - /** - * Number of ICMP pings. A maximum of 3 ICMP pings is currently supported. - * - * Generated from protobuf field int32 pings_count = 1; - * @param int $var - * @return $this - */ - public function setPingsCount($var) - { - GPBUtil::checkInt32($var); - $this->pings_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PingConfig::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_PingConfig::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 deleted file mode 100644 index 25ef6cb80c6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ResourceGroup.php +++ /dev/null @@ -1,113 +0,0 @@ -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 deleted file mode 100644 index 09c0668c3b3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php +++ /dev/null @@ -1,122 +0,0 @@ -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; - /** - * Contains information needed to add pings to a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; - */ - protected $ping_config = null; - - /** - * 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. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $ping_config - * Contains information needed to add pings to a TCP check. - * } - */ - 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; - } - - /** - * Contains information needed to add pings to a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig|null - */ - public function getPingConfig() - { - return $this->ping_config; - } - - public function hasPingConfig() - { - return isset($this->ping_config); - } - - public function clearPingConfig() - { - unset($this->ping_config); - } - - /** - * Contains information needed to add pings to a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.PingConfig ping_config = 2; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig $var - * @return $this - */ - public function setPingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\PingConfig::class); - $this->ping_config = $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/UptimeCheckIp.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php deleted file mode 100644 index 8eb3b2a696b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckIp.php +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100644 index 8524b68cf0f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php +++ /dev/null @@ -1,102 +0,0 @@ -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; - /** - * Allows checks to run from locations within the western United States of - * America - * - * Generated from protobuf enum USA_OREGON = 5; - */ - const USA_OREGON = 5; - /** - * Allows checks to run from locations within the central United States of - * America - * - * Generated from protobuf enum USA_IOWA = 6; - */ - const USA_IOWA = 6; - /** - * Allows checks to run from locations within the eastern United States of - * America - * - * Generated from protobuf enum USA_VIRGINIA = 7; - */ - const USA_VIRGINIA = 7; - - private static $valueToName = [ - self::REGION_UNSPECIFIED => 'REGION_UNSPECIFIED', - self::USA => 'USA', - self::EUROPE => 'EUROPE', - self::SOUTH_AMERICA => 'SOUTH_AMERICA', - self::ASIA_PACIFIC => 'ASIA_PACIFIC', - self::USA_OREGON => 'USA_OREGON', - self::USA_IOWA => 'USA_IOWA', - self::USA_VIRGINIA => 'USA_VIRGINIA', - ]; - - 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/VerifyNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php deleted file mode 100644 index 95410209d06..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -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 = ''; - - /** - * @param string $name Required. The notification channel to verify. Please see - * {@see NotificationChannelServiceClient::notificationChannelName()} for help formatting this field. - * @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). - * - * @return \Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest - * - * @experimental - */ - public static function build(string $name, string $code): self - { - return (new self()) - ->setName($name) - ->setCode($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 deleted file mode 100644 index f049ead8c43..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli.php +++ /dev/null @@ -1,236 +0,0 @@ -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 deleted file mode 100644 index 2a86a24e4ea..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/MetricRange.php +++ /dev/null @@ -1,125 +0,0 @@ -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 deleted file mode 100644 index 7ff22f3a677..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli/PerformanceThreshold.php +++ /dev/null @@ -1,146 +0,0 @@ -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/samples/V3/AlertPolicyServiceClient/create_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php deleted file mode 100644 index 8da94f5c6a8..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/create_alert_policy.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($name) - ->setAlertPolicy($alertPolicy); - - // Call the API and handle any network failures. - try { - /** @var AlertPolicy $response */ - $response = $alertPolicyServiceClient->createAlertPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_alert_policy_sample($name); -} -// [END monitoring_v3_generated_AlertPolicyService_CreateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php deleted file mode 100644 index 20341bb9ced..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/delete_alert_policy.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $alertPolicyServiceClient->deleteAlertPolicy($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - - delete_alert_policy_sample($formattedName); -} -// [END monitoring_v3_generated_AlertPolicyService_DeleteAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php deleted file mode 100644 index a6b8ef21ad6..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/get_alert_policy.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var AlertPolicy $response */ - $response = $alertPolicyServiceClient->getAlertPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = AlertPolicyServiceClient::alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - - get_alert_policy_sample($formattedName); -} -// [END monitoring_v3_generated_AlertPolicyService_GetAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php deleted file mode 100644 index dc60fddad14..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/list_alert_policies.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $alertPolicyServiceClient->listAlertPolicies($request); - - /** @var AlertPolicy $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_alert_policies_sample($name); -} -// [END monitoring_v3_generated_AlertPolicyService_ListAlertPolicies_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php b/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php deleted file mode 100644 index d4f9c5060ec..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/AlertPolicyServiceClient/update_alert_policy.php +++ /dev/null @@ -1,66 +0,0 @@ -setAlertPolicy($alertPolicy); - - // Call the API and handle any network failures. - try { - /** @var AlertPolicy $response */ - $response = $alertPolicyServiceClient->updateAlertPolicy($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_AlertPolicyService_UpdateAlertPolicy_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php deleted file mode 100644 index 5662f185f72..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/create_group.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($name) - ->setGroup($group); - - // Call the API and handle any network failures. - try { - /** @var Group $response */ - $response = $groupServiceClient->createGroup($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_group_sample($name); -} -// [END monitoring_v3_generated_GroupService_CreateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php deleted file mode 100644 index 2b0b5d393b3..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/delete_group.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $groupServiceClient->deleteGroup($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); - - delete_group_sample($formattedName); -} -// [END monitoring_v3_generated_GroupService_DeleteGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php deleted file mode 100644 index 59d00116484..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/get_group.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Group $response */ - $response = $groupServiceClient->getGroup($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); - - get_group_sample($formattedName); -} -// [END monitoring_v3_generated_GroupService_GetGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php deleted file mode 100644 index 810ef1fb51c..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_group_members.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $groupServiceClient->listGroupMembers($request); - - /** @var MonitoredResource $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = GroupServiceClient::groupName('[PROJECT]', '[GROUP]'); - - list_group_members_sample($formattedName); -} -// [END monitoring_v3_generated_GroupService_ListGroupMembers_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php deleted file mode 100644 index 073f54a6f17..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/list_groups.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $groupServiceClient->listGroups($request); - - /** @var Group $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_groups_sample($name); -} -// [END monitoring_v3_generated_GroupService_ListGroups_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php b/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php deleted file mode 100644 index 58d8ed1e52b..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/GroupServiceClient/update_group.php +++ /dev/null @@ -1,60 +0,0 @@ -setGroup($group); - - // Call the API and handle any network failures. - try { - /** @var Group $response */ - $response = $groupServiceClient->updateGroup($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_GroupService_UpdateGroup_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php deleted file mode 100644 index c54f10ba5a8..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_metric_descriptor.php +++ /dev/null @@ -1,81 +0,0 @@ -setName($name) - ->setMetricDescriptor($metricDescriptor); - - // Call the API and handle any network failures. - try { - /** @var MetricDescriptor $response */ - $response = $metricServiceClient->createMetricDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_metric_descriptor_sample($name); -} -// [END monitoring_v3_generated_MetricService_CreateMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php deleted file mode 100644 index 3676da8a884..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_service_time_series.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName) - ->setTimeSeries($timeSeries); - - // Call the API and handle any network failures. - try { - $metricServiceClient->createServiceTimeSeries($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::projectName('[PROJECT]'); - - create_service_time_series_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_CreateServiceTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php deleted file mode 100644 index 943e3d74156..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/create_time_series.php +++ /dev/null @@ -1,82 +0,0 @@ -setName($formattedName) - ->setTimeSeries($timeSeries); - - // Call the API and handle any network failures. - try { - $metricServiceClient->createTimeSeries($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::projectName('[PROJECT]'); - - create_time_series_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_CreateTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php deleted file mode 100644 index 5be71ec658a..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/delete_metric_descriptor.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $metricServiceClient->deleteMetricDescriptor($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - - delete_metric_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_DeleteMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php deleted file mode 100644 index f1733d7ebcf..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_metric_descriptor.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var MetricDescriptor $response */ - $response = $metricServiceClient->getMetricDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - - get_metric_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_GetMetricDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php deleted file mode 100644 index b80928f31d4..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var MonitoredResourceDescriptor $response */ - $response = $metricServiceClient->getMonitoredResourceDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::monitoredResourceDescriptorName( - '[PROJECT]', - '[MONITORED_RESOURCE_DESCRIPTOR]' - ); - - get_monitored_resource_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_MetricService_GetMonitoredResourceDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php deleted file mode 100644 index 2a60d376cdf..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_metric_descriptors.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $metricServiceClient->listMetricDescriptors($request); - - /** @var MetricDescriptor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_metric_descriptors_sample($name); -} -// [END monitoring_v3_generated_MetricService_ListMetricDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php deleted file mode 100644 index 8594af87cfc..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $metricServiceClient->listMonitoredResourceDescriptors($request); - - /** @var MonitoredResourceDescriptor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_monitored_resource_descriptors_sample($name); -} -// [END monitoring_v3_generated_MetricService_ListMonitoredResourceDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php deleted file mode 100644 index 2d408169cc2..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/MetricServiceClient/list_time_series.php +++ /dev/null @@ -1,99 +0,0 @@ -setName($formattedName) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $metricServiceClient->listTimeSeries($request); - - /** @var TimeSeries $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = MetricServiceClient::workspaceName('[PROJECT]'); - $filter = '[FILTER]'; - $view = TimeSeriesView::FULL; - - list_time_series_sample($formattedName, $filter, $view); -} -// [END monitoring_v3_generated_MetricService_ListTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php deleted file mode 100644 index 4e2647ee023..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/create_notification_channel.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($name) - ->setNotificationChannel($notificationChannel); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->createNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - create_notification_channel_sample($name); -} -// [END monitoring_v3_generated_NotificationChannelService_CreateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php deleted file mode 100644 index 1af1aacc41e..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/delete_notification_channel.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $notificationChannelServiceClient->deleteNotificationChannel($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - delete_notification_channel_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_DeleteNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php deleted file mode 100644 index a1efeebeec4..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->getNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - get_notification_channel_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php deleted file mode 100644 index 3f4bc0a7731..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannelDescriptor $response */ - $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelDescriptorName( - '[PROJECT]', - '[CHANNEL_DESCRIPTOR]' - ); - - get_notification_channel_descriptor_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelDescriptor_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php deleted file mode 100644 index a63472001e2..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php +++ /dev/null @@ -1,96 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var GetNotificationChannelVerificationCodeResponse $response */ - $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - get_notification_channel_verification_code_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php deleted file mode 100644 index 0382fad734f..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $notificationChannelServiceClient->listNotificationChannelDescriptors($request); - - /** @var NotificationChannelDescriptor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_notification_channel_descriptors_sample($name); -} -// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannelDescriptors_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php deleted file mode 100644 index 4a236f89c3a..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/list_notification_channels.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $notificationChannelServiceClient->listNotificationChannels($request); - - /** @var NotificationChannel $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - list_notification_channels_sample($name); -} -// [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannels_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php deleted file mode 100644 index b8810b7a301..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $notificationChannelServiceClient->sendNotificationChannelVerificationCode($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - - send_notification_channel_verification_code_sample($formattedName); -} -// [END monitoring_v3_generated_NotificationChannelService_SendNotificationChannelVerificationCode_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php deleted file mode 100644 index ad79286eff6..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/update_notification_channel.php +++ /dev/null @@ -1,65 +0,0 @@ -setNotificationChannel($notificationChannel); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->updateNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_NotificationChannelService_UpdateNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php b/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php deleted file mode 100644 index 7603415aff5..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/NotificationChannelServiceClient/verify_notification_channel.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName) - ->setCode($code); - - // Call the API and handle any network failures. - try { - /** @var NotificationChannel $response */ - $response = $notificationChannelServiceClient->verifyNotificationChannel($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = NotificationChannelServiceClient::notificationChannelName( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - $code = '[CODE]'; - - verify_notification_channel_sample($formattedName, $code); -} -// [END monitoring_v3_generated_NotificationChannelService_VerifyNotificationChannel_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php b/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php deleted file mode 100644 index c9e9a6166ae..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/QueryServiceClient/query_time_series.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($name) - ->setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $queryServiceClient->queryTimeSeries($request); - - /** @var TimeSeriesData $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - $query = '[QUERY]'; - - query_time_series_sample($name, $query); -} -// [END monitoring_v3_generated_QueryService_QueryTimeSeries_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php deleted file mode 100644 index f1cd6dae994..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($parent) - ->setService($service); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $serviceMonitoringServiceClient->createService($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - create_service_sample($parent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_CreateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php deleted file mode 100644 index 2559795e52e..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php +++ /dev/null @@ -1,75 +0,0 @@ -setParent($formattedParent) - ->setServiceLevelObjective($serviceLevelObjective); - - // Call the API and handle any network failures. - try { - /** @var ServiceLevelObjective $response */ - $response = $serviceMonitoringServiceClient->createServiceLevelObjective($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - create_service_level_objective_sample($formattedParent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php deleted file mode 100644 index dd319f9e610..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $serviceMonitoringServiceClient->deleteService($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - delete_service_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_DeleteService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php deleted file mode 100644 index ca3c8187246..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $serviceMonitoringServiceClient->deleteServiceLevelObjective($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - - delete_service_level_objective_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_DeleteServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php deleted file mode 100644 index cb12b2fcac7..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $serviceMonitoringServiceClient->getService($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - get_service_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_GetService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php deleted file mode 100644 index 7bc8c814262..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ServiceLevelObjective $response */ - $response = $serviceMonitoringServiceClient->getServiceLevelObjective($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = ServiceMonitoringServiceClient::serviceLevelObjectiveName( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - - get_service_level_objective_sample($formattedName); -} -// [END monitoring_v3_generated_ServiceMonitoringService_GetServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php deleted file mode 100644 index 4476bfaaafd..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $serviceMonitoringServiceClient->listServiceLevelObjectives($request); - - /** @var ServiceLevelObjective $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = ServiceMonitoringServiceClient::serviceName('[PROJECT]', '[SERVICE]'); - - list_service_level_objectives_sample($formattedParent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_ListServiceLevelObjectives_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php deleted file mode 100644 index f1495ce77ad..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/list_services.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $serviceMonitoringServiceClient->listServices($request); - - /** @var Service $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_services_sample($parent); -} -// [END monitoring_v3_generated_ServiceMonitoringService_ListServices_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php deleted file mode 100644 index 1a9fbecdfd9..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service.php +++ /dev/null @@ -1,59 +0,0 @@ -setService($service); - - // Call the API and handle any network failures. - try { - /** @var Service $response */ - $response = $serviceMonitoringServiceClient->updateService($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_ServiceMonitoringService_UpdateService_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php b/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php deleted file mode 100644 index 30611bd57c1..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php +++ /dev/null @@ -1,59 +0,0 @@ -setServiceLevelObjective($serviceLevelObjective); - - // Call the API and handle any network failures. - try { - /** @var ServiceLevelObjective $response */ - $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_ServiceMonitoringService_UpdateServiceLevelObjective_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php deleted file mode 100644 index f16d2759dbb..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/create_snooze.php +++ /dev/null @@ -1,99 +0,0 @@ -setName($snoozeName) - ->setCriteria($snoozeCriteria) - ->setInterval($snoozeInterval) - ->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - - // Call the API and handle any network failures. - try { - /** @var Snooze $response */ - $response = $snoozeServiceClient->createSnooze($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); - $snoozeName = '[NAME]'; - $snoozeDisplayName = '[DISPLAY_NAME]'; - - create_snooze_sample($formattedParent, $snoozeName, $snoozeDisplayName); -} -// [END monitoring_v3_generated_SnoozeService_CreateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php deleted file mode 100644 index cf467e5c3c3..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/get_snooze.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Snooze $response */ - $response = $snoozeServiceClient->getSnooze($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = SnoozeServiceClient::snoozeName('[PROJECT]', '[SNOOZE]'); - - get_snooze_sample($formattedName); -} -// [END monitoring_v3_generated_SnoozeService_GetSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php deleted file mode 100644 index f0fb94d6601..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/list_snoozes.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $snoozeServiceClient->listSnoozes($request); - - /** @var Snooze $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = SnoozeServiceClient::workspaceName('[PROJECT]'); - - list_snoozes_sample($formattedParent); -} -// [END monitoring_v3_generated_SnoozeService_ListSnoozes_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php b/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php deleted file mode 100644 index 2fa14b61a73..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/SnoozeServiceClient/update_snooze.php +++ /dev/null @@ -1,90 +0,0 @@ -setName($snoozeName) - ->setCriteria($snoozeCriteria) - ->setInterval($snoozeInterval) - ->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $request = (new UpdateSnoozeRequest()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Snooze $response */ - $response = $snoozeServiceClient->updateSnooze($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $snoozeName = '[NAME]'; - $snoozeDisplayName = '[DISPLAY_NAME]'; - - update_snooze_sample($snoozeName, $snoozeDisplayName); -} -// [END monitoring_v3_generated_SnoozeService_UpdateSnooze_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php deleted file mode 100644 index 6ad37bedcda..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - - // Call the API and handle any network failures. - try { - /** @var UptimeCheckConfig $response */ - $response = $uptimeCheckServiceClient->createUptimeCheckConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - create_uptime_check_config_sample($parent); -} -// [END monitoring_v3_generated_UptimeCheckService_CreateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php deleted file mode 100644 index d33f28aec3e..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $uptimeCheckServiceClient->deleteUptimeCheckConfig($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - - delete_uptime_check_config_sample($formattedName); -} -// [END monitoring_v3_generated_UptimeCheckService_DeleteUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php deleted file mode 100644 index a3dbc0e2c41..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var UptimeCheckConfig $response */ - $response = $uptimeCheckServiceClient->getUptimeCheckConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = UptimeCheckServiceClient::uptimeCheckConfigName( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - - get_uptime_check_config_sample($formattedName); -} -// [END monitoring_v3_generated_UptimeCheckService_GetUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php deleted file mode 100644 index 7a681db4527..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $uptimeCheckServiceClient->listUptimeCheckConfigs($request); - - /** @var UptimeCheckConfig $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_uptime_check_configs_sample($parent); -} -// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckConfigs_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php deleted file mode 100644 index 9d96322e41f..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php +++ /dev/null @@ -1,62 +0,0 @@ -listUptimeCheckIps($request); - - /** @var UptimeCheckIp $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckIps_sync] diff --git a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php b/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php deleted file mode 100644 index cdef12857a2..00000000000 --- a/owl-bot-staging/Monitoring/v3/samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php +++ /dev/null @@ -1,62 +0,0 @@ -setUptimeCheckConfig($uptimeCheckConfig); - - // Call the API and handle any network failures. - try { - /** @var UptimeCheckConfig $response */ - $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END monitoring_v3_generated_UptimeCheckService_UpdateUptimeCheckConfig_sync] diff --git a/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php deleted file mode 100644 index 66d3410ff0c..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/AlertPolicyServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('alertPolicy')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted alert_policy_condition resource. - */ - public static function alertPolicyConditionName(string $project, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('alertPolicyCondition')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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(string $folder, string $alertPolicy): string - { - return self::getPathTemplate('folderAlertPolicy')->render([ - 'folder' => $folder, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_alert_policy_condition resource. - * - * @param string $folder - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted folder_alert_policy_condition resource. - */ - public static function folderAlertPolicyConditionName(string $folder, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('folderAlertPolicyCondition')->render([ - 'folder' => $folder, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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(string $organization, string $alertPolicy): string - { - return self::getPathTemplate('organizationAlertPolicy')->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_alert_policy_condition resource. - * - * @param string $organization - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted organization_alert_policy_condition resource. - */ - public static function organizationAlertPolicyConditionName(string $organization, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('organizationAlertPolicyCondition')->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('projectAlertPolicy')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted project_alert_policy_condition resource. - */ - public static function projectAlertPolicyConditionName(string $project, string $alertPolicy, string $condition): string - { - return self::getPathTemplate('projectAlertPolicyCondition')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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} - * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - * 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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new alerting policy. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * The async variant is {@see AlertPolicyServiceClient::createAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/create_alert_policy.php - * - * @param CreateAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AlertPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function createAlertPolicy(CreateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy - { - return $this->startApiCall('CreateAlertPolicy', $request, $callOptions)->wait(); - } - - /** - * Deletes an alerting policy. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * The async variant is {@see AlertPolicyServiceClient::deleteAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/delete_alert_policy.php - * - * @param DeleteAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteAlertPolicy(DeleteAlertPolicyRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteAlertPolicy', $request, $callOptions)->wait(); - } - - /** - * Gets a single alerting policy. - * - * The async variant is {@see AlertPolicyServiceClient::getAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/get_alert_policy.php - * - * @param GetAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AlertPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function getAlertPolicy(GetAlertPolicyRequest $request, array $callOptions = []): AlertPolicy - { - return $this->startApiCall('GetAlertPolicy', $request, $callOptions)->wait(); - } - - /** - * Lists the existing alerting policies for the workspace. - * - * The async variant is {@see AlertPolicyServiceClient::listAlertPoliciesAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/list_alert_policies.php - * - * @param ListAlertPoliciesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listAlertPolicies(ListAlertPoliciesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListAlertPolicies', $request, $callOptions); - } - - /** - * 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * The async variant is {@see AlertPolicyServiceClient::updateAlertPolicyAsync()} . - * - * @example samples/V3/AlertPolicyServiceClient/update_alert_policy.php - * - * @param UpdateAlertPolicyRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AlertPolicy - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateAlertPolicy(UpdateAlertPolicyRequest $request, array $callOptions = []): AlertPolicy - { - return $this->startApiCall('UpdateAlertPolicy', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php deleted file mode 100644 index 2f50d564b82..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/GroupServiceClient.php +++ /dev/null @@ -1,444 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $group): string - { - return self::getPathTemplate('folderGroup')->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(string $project, string $group): string - { - return self::getPathTemplate('group')->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(string $organization, string $group): string - { - return self::getPathTemplate('organizationGroup')->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(string $project, string $group): string - { - return self::getPathTemplate('projectGroup')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new group. - * - * The async variant is {@see GroupServiceClient::createGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/create_group.php - * - * @param CreateGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Group - * - * @throws ApiException Thrown if the API call fails. - */ - public function createGroup(CreateGroupRequest $request, array $callOptions = []): Group - { - return $this->startApiCall('CreateGroup', $request, $callOptions)->wait(); - } - - /** - * Deletes an existing group. - * - * The async variant is {@see GroupServiceClient::deleteGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/delete_group.php - * - * @param DeleteGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteGroup(DeleteGroupRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteGroup', $request, $callOptions)->wait(); - } - - /** - * Gets a single group. - * - * The async variant is {@see GroupServiceClient::getGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/get_group.php - * - * @param GetGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Group - * - * @throws ApiException Thrown if the API call fails. - */ - public function getGroup(GetGroupRequest $request, array $callOptions = []): Group - { - return $this->startApiCall('GetGroup', $request, $callOptions)->wait(); - } - - /** - * Lists the monitored resources that are members of a group. - * - * The async variant is {@see GroupServiceClient::listGroupMembersAsync()} . - * - * @example samples/V3/GroupServiceClient/list_group_members.php - * - * @param ListGroupMembersRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listGroupMembers(ListGroupMembersRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListGroupMembers', $request, $callOptions); - } - - /** - * Lists the existing groups. - * - * The async variant is {@see GroupServiceClient::listGroupsAsync()} . - * - * @example samples/V3/GroupServiceClient/list_groups.php - * - * @param ListGroupsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listGroups(ListGroupsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListGroups', $request, $callOptions); - } - - /** - * Updates an existing group. - * You can change any group attributes except `name`. - * - * The async variant is {@see GroupServiceClient::updateGroupAsync()} . - * - * @example samples/V3/GroupServiceClient/update_group.php - * - * @param UpdateGroupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Group - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateGroup(UpdateGroupRequest $request, array $callOptions = []): Group - { - return $this->startApiCall('UpdateGroup', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php deleted file mode 100644 index 84d12bcedab..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/MetricServiceClient.php +++ /dev/null @@ -1,675 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder): string - { - return self::getPathTemplate('folder')->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(string $folder, string $metricDescriptor): string - { - return self::getPathTemplate('folderMetricDescriptor')->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(string $folder, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('folderMonitoredResourceDescriptor')->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(string $project, string $metricDescriptor): string - { - return self::getPathTemplate('metricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('monitoredResourceDescriptor')->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(string $organization): string - { - return self::getPathTemplate('organization')->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(string $organization, string $metricDescriptor): string - { - return self::getPathTemplate('organizationMetricDescriptor')->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(string $organization, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('organizationMonitoredResourceDescriptor')->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(string $project): string - { - return self::getPathTemplate('project')->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(string $project, string $metricDescriptor): string - { - return self::getPathTemplate('projectMetricDescriptor')->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(string $project, string $monitoredResourceDescriptor): string - { - return self::getPathTemplate('projectMonitoredResourceDescriptor')->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(string $project): string - { - return self::getPathTemplate('workspace')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new metric descriptor. - * The creation is executed asynchronously. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - * The metric descriptor is updated if it already exists, - * except that metric labels are never removed. - * - * The async variant is {@see MetricServiceClient::createMetricDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/create_metric_descriptor.php - * - * @param CreateMetricDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return MetricDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function createMetricDescriptor(CreateMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor - { - return $this->startApiCall('CreateMetricDescriptor', $request, $callOptions)->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. - * - * The async variant is {@see MetricServiceClient::createServiceTimeSeriesAsync()} - * . - * - * @example samples/V3/MetricServiceClient/create_service_time_series.php - * - * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function createServiceTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void - { - $this->startApiCall('CreateServiceTimeSeries', $request, $callOptions)->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. - * This method does not support - * [resource locations constraint of an organization - * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - * - * The async variant is {@see MetricServiceClient::createTimeSeriesAsync()} . - * - * @example samples/V3/MetricServiceClient/create_time_series.php - * - * @param CreateTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function createTimeSeries(CreateTimeSeriesRequest $request, array $callOptions = []): void - { - $this->startApiCall('CreateTimeSeries', $request, $callOptions)->wait(); - } - - /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - * deleted. - * - * The async variant is {@see MetricServiceClient::deleteMetricDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/delete_metric_descriptor.php - * - * @param DeleteMetricDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteMetricDescriptor(DeleteMetricDescriptorRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteMetricDescriptor', $request, $callOptions)->wait(); - } - - /** - * Gets a single metric descriptor. - * - * The async variant is {@see MetricServiceClient::getMetricDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/get_metric_descriptor.php - * - * @param GetMetricDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return MetricDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function getMetricDescriptor(GetMetricDescriptorRequest $request, array $callOptions = []): MetricDescriptor - { - return $this->startApiCall('GetMetricDescriptor', $request, $callOptions)->wait(); - } - - /** - * Gets a single monitored resource descriptor. - * - * The async variant is - * {@see MetricServiceClient::getMonitoredResourceDescriptorAsync()} . - * - * @example samples/V3/MetricServiceClient/get_monitored_resource_descriptor.php - * - * @param GetMonitoredResourceDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return MonitoredResourceDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function getMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest $request, array $callOptions = []): MonitoredResourceDescriptor - { - return $this->startApiCall('GetMonitoredResourceDescriptor', $request, $callOptions)->wait(); - } - - /** - * Lists metric descriptors that match a filter. - * - * The async variant is {@see MetricServiceClient::listMetricDescriptorsAsync()} . - * - * @example samples/V3/MetricServiceClient/list_metric_descriptors.php - * - * @param ListMetricDescriptorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listMetricDescriptors(ListMetricDescriptorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListMetricDescriptors', $request, $callOptions); - } - - /** - * Lists monitored resource descriptors that match a filter. - * - * The async variant is - * {@see MetricServiceClient::listMonitoredResourceDescriptorsAsync()} . - * - * @example samples/V3/MetricServiceClient/list_monitored_resource_descriptors.php - * - * @param ListMonitoredResourceDescriptorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListMonitoredResourceDescriptors', $request, $callOptions); - } - - /** - * Lists time series that match a filter. - * - * The async variant is {@see MetricServiceClient::listTimeSeriesAsync()} . - * - * @example samples/V3/MetricServiceClient/list_time_series.php - * - * @param ListTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listTimeSeries(ListTimeSeriesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListTimeSeries', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php deleted file mode 100644 index 20f4631ad33..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/NotificationChannelServiceClient.php +++ /dev/null @@ -1,679 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $channelDescriptor): string - { - return self::getPathTemplate('folderChannelDescriptor')->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(string $folder, string $notificationChannel): string - { - return self::getPathTemplate('folderNotificationChannel')->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(string $project, string $notificationChannel): string - { - return self::getPathTemplate('notificationChannel')->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(string $project, string $channelDescriptor): string - { - return self::getPathTemplate('notificationChannelDescriptor')->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(string $organization, string $channelDescriptor): string - { - return self::getPathTemplate('organizationChannelDescriptor')->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(string $organization, string $notificationChannel): string - { - return self::getPathTemplate('organizationNotificationChannel')->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(string $project, string $channelDescriptor): string - { - return self::getPathTemplate('projectChannelDescriptor')->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(string $project, string $notificationChannel): string - { - return self::getPathTemplate('projectNotificationChannel')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new notification channel, representing a single notification - * endpoint such as an email address, SMS number, or PagerDuty service. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * The async variant is - * {@see NotificationChannelServiceClient::createNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/create_notification_channel.php - * - * @param CreateNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function createNotificationChannel(CreateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('CreateNotificationChannel', $request, $callOptions)->wait(); - } - - /** - * Deletes a notification channel. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * The async variant is - * {@see NotificationChannelServiceClient::deleteNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/delete_notification_channel.php - * - * @param DeleteNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteNotificationChannel(DeleteNotificationChannelRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteNotificationChannel', $request, $callOptions)->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. - * - * The async variant is - * {@see NotificationChannelServiceClient::getNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/get_notification_channel.php - * - * @param GetNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNotificationChannel(GetNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('GetNotificationChannel', $request, $callOptions)->wait(); - } - - /** - * Gets a single channel descriptor. The descriptor indicates which fields - * are expected / permitted for a notification channel of the given type. - * - * The async variant is - * {@see NotificationChannelServiceClient::getNotificationChannelDescriptorAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_descriptor.php - * - * @param GetNotificationChannelDescriptorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannelDescriptor - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNotificationChannelDescriptor(GetNotificationChannelDescriptorRequest $request, array $callOptions = []): NotificationChannelDescriptor - { - return $this->startApiCall('GetNotificationChannelDescriptor', $request, $callOptions)->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. - * - * The async variant is - * {@see NotificationChannelServiceClient::getNotificationChannelVerificationCodeAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/get_notification_channel_verification_code.php - * - * @param GetNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return GetNotificationChannelVerificationCodeResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function getNotificationChannelVerificationCode(GetNotificationChannelVerificationCodeRequest $request, array $callOptions = []): GetNotificationChannelVerificationCodeResponse - { - return $this->startApiCall('GetNotificationChannelVerificationCode', $request, $callOptions)->wait(); - } - - /** - * Lists the descriptors for supported channel types. The use of descriptors - * makes it possible for new channel types to be dynamically added. - * - * The async variant is - * {@see NotificationChannelServiceClient::listNotificationChannelDescriptorsAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/list_notification_channel_descriptors.php - * - * @param ListNotificationChannelDescriptorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listNotificationChannelDescriptors(ListNotificationChannelDescriptorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListNotificationChannelDescriptors', $request, $callOptions); - } - - /** - * Lists the notification channels that have been created for the project. - * To list the types of notification channels that are supported, use - * the `ListNotificationChannelDescriptors` method. - * - * The async variant is - * {@see NotificationChannelServiceClient::listNotificationChannelsAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/list_notification_channels.php - * - * @param ListNotificationChannelsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listNotificationChannels(ListNotificationChannelsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListNotificationChannels', $request, $callOptions); - } - - /** - * Causes a verification code to be delivered to the channel. The code - * can then be supplied in `VerifyNotificationChannel` to verify the channel. - * - * The async variant is - * {@see NotificationChannelServiceClient::sendNotificationChannelVerificationCodeAsync()} - * . - * - * @example samples/V3/NotificationChannelServiceClient/send_notification_channel_verification_code.php - * - * @param SendNotificationChannelVerificationCodeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function sendNotificationChannelVerificationCode(SendNotificationChannelVerificationCodeRequest $request, array $callOptions = []): void - { - $this->startApiCall('SendNotificationChannelVerificationCode', $request, $callOptions)->wait(); - } - - /** - * Updates a notification channel. Fields not specified in the field mask - * remain unchanged. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * The async variant is - * {@see NotificationChannelServiceClient::updateNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/update_notification_channel.php - * - * @param UpdateNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateNotificationChannel(UpdateNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('UpdateNotificationChannel', $request, $callOptions)->wait(); - } - - /** - * Verifies a `NotificationChannel` by proving receipt of the code - * delivered to the channel as a result of calling - * `SendNotificationChannelVerificationCode`. - * - * The async variant is - * {@see NotificationChannelServiceClient::verifyNotificationChannelAsync()} . - * - * @example samples/V3/NotificationChannelServiceClient/verify_notification_channel.php - * - * @param VerifyNotificationChannelRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return NotificationChannel - * - * @throws ApiException Thrown if the API call fails. - */ - public function verifyNotificationChannel(VerifyNotificationChannelRequest $request, array $callOptions = []): NotificationChannel - { - return $this->startApiCall('VerifyNotificationChannel', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php deleted file mode 100644 index 81a5eab5b18..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/QueryServiceClient.php +++ /dev/null @@ -1,193 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Queries time series using Monitoring Query Language. - * - * The async variant is {@see QueryServiceClient::queryTimeSeriesAsync()} . - * - * @example samples/V3/QueryServiceClient/query_time_series.php - * - * @param QueryTimeSeriesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function queryTimeSeries(QueryTimeSeriesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('QueryTimeSeries', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php deleted file mode 100644 index ec9bb443cf7..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/ServiceMonitoringServiceClient.php +++ /dev/null @@ -1,635 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $service): string - { - return self::getPathTemplate('folderService')->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(string $folder, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('folderServiceServiceLevelObjective')->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(string $organization, string $service): string - { - return self::getPathTemplate('organizationService')->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(string $organization, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('organizationServiceServiceLevelObjective')->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(string $project, string $service): string - { - return self::getPathTemplate('projectService')->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(string $project, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('projectServiceServiceLevelObjective')->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(string $project, string $service): string - { - return self::getPathTemplate('service')->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(string $project, string $service, string $serviceLevelObjective): string - { - return self::getPathTemplate('serviceLevelObjective')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Create a `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::createServiceAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/create_service.php - * - * @param CreateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function createService(CreateServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('CreateService', $request, $callOptions)->wait(); - } - - /** - * Create a `ServiceLevelObjective` for the given `Service`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::createServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/create_service_level_objective.php - * - * @param CreateServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ServiceLevelObjective - * - * @throws ApiException Thrown if the API call fails. - */ - public function createServiceLevelObjective(CreateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective - { - return $this->startApiCall('CreateServiceLevelObjective', $request, $callOptions)->wait(); - } - - /** - * Soft delete this `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::deleteServiceAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/delete_service.php - * - * @param DeleteServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteService(DeleteServiceRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteService', $request, $callOptions)->wait(); - } - - /** - * Delete the given `ServiceLevelObjective`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::deleteServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/delete_service_level_objective.php - * - * @param DeleteServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteServiceLevelObjective', $request, $callOptions)->wait(); - } - - /** - * Get the named `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::getServiceAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/get_service.php - * - * @param GetServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function getService(GetServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('GetService', $request, $callOptions)->wait(); - } - - /** - * Get a `ServiceLevelObjective` by name. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::getServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/get_service_level_objective.php - * - * @param GetServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ServiceLevelObjective - * - * @throws ApiException Thrown if the API call fails. - */ - public function getServiceLevelObjective(GetServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective - { - return $this->startApiCall('GetServiceLevelObjective', $request, $callOptions)->wait(); - } - - /** - * List the `ServiceLevelObjective`s for the given `Service`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::listServiceLevelObjectivesAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/list_service_level_objectives.php - * - * @param ListServiceLevelObjectivesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listServiceLevelObjectives(ListServiceLevelObjectivesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListServiceLevelObjectives', $request, $callOptions); - } - - /** - * List `Service`s for this Metrics Scope. - * - * The async variant is {@see ServiceMonitoringServiceClient::listServicesAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/list_services.php - * - * @param ListServicesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListServices', $request, $callOptions); - } - - /** - * Update this `Service`. - * - * The async variant is {@see ServiceMonitoringServiceClient::updateServiceAsync()} - * . - * - * @example samples/V3/ServiceMonitoringServiceClient/update_service.php - * - * @param UpdateServiceRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Service - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateService(UpdateServiceRequest $request, array $callOptions = []): Service - { - return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); - } - - /** - * Update the given `ServiceLevelObjective`. - * - * The async variant is - * {@see ServiceMonitoringServiceClient::updateServiceLevelObjectiveAsync()} . - * - * @example samples/V3/ServiceMonitoringServiceClient/update_service_level_objective.php - * - * @param UpdateServiceLevelObjectiveRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ServiceLevelObjective - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest $request, array $callOptions = []): ServiceLevelObjective - { - return $this->startApiCall('UpdateServiceLevelObjective', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php deleted file mode 100644 index e41cf63ae34..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/SnoozeServiceClient.php +++ /dev/null @@ -1,434 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/snooze_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('alertPolicy')->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(string $folder, string $alertPolicy): string - { - return self::getPathTemplate('folderAlertPolicy')->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(string $organization, string $alertPolicy): string - { - return self::getPathTemplate('organizationAlertPolicy')->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * 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(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * 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(string $project, string $alertPolicy): string - { - return self::getPathTemplate('projectAlertPolicy')->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a snooze - * resource. - * - * @param string $project - * @param string $snooze - * - * @return string The formatted snooze resource. - */ - public static function snoozeName(string $project, string $snooze): string - { - return self::getPathTemplate('snooze')->render([ - 'project' => $project, - 'snooze' => $snooze, - ]); - } - - /** - * 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(string $project): string - { - return self::getPathTemplate('workspace')->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 - * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - project: projects/{project} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - snooze: projects/{project}/snoozes/{snooze} - * - 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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a `Snooze` that will prevent alerts, which match the provided - * criteria, from being opened. The `Snooze` applies for a specific time - * interval. - * - * The async variant is {@see SnoozeServiceClient::createSnoozeAsync()} . - * - * @example samples/V3/SnoozeServiceClient/create_snooze.php - * - * @param CreateSnoozeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Snooze - * - * @throws ApiException Thrown if the API call fails. - */ - public function createSnooze(CreateSnoozeRequest $request, array $callOptions = []): Snooze - { - return $this->startApiCall('CreateSnooze', $request, $callOptions)->wait(); - } - - /** - * Retrieves a `Snooze` by `name`. - * - * The async variant is {@see SnoozeServiceClient::getSnoozeAsync()} . - * - * @example samples/V3/SnoozeServiceClient/get_snooze.php - * - * @param GetSnoozeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Snooze - * - * @throws ApiException Thrown if the API call fails. - */ - public function getSnooze(GetSnoozeRequest $request, array $callOptions = []): Snooze - { - return $this->startApiCall('GetSnooze', $request, $callOptions)->wait(); - } - - /** - * Lists the `Snooze`s associated with a project. Can optionally pass in - * `filter`, which specifies predicates to match `Snooze`s. - * - * The async variant is {@see SnoozeServiceClient::listSnoozesAsync()} . - * - * @example samples/V3/SnoozeServiceClient/list_snoozes.php - * - * @param ListSnoozesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listSnoozes(ListSnoozesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListSnoozes', $request, $callOptions); - } - - /** - * Updates a `Snooze`, identified by its `name`, with the parameters in the - * given `Snooze` object. - * - * The async variant is {@see SnoozeServiceClient::updateSnoozeAsync()} . - * - * @example samples/V3/SnoozeServiceClient/update_snooze.php - * - * @param UpdateSnoozeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Snooze - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateSnooze(UpdateSnoozeRequest $request, array $callOptions = []): Snooze - { - return $this->startApiCall('UpdateSnooze', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php deleted file mode 100644 index f80c8f32665..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Client/UptimeCheckServiceClient.php +++ /dev/null @@ -1,451 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => 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', - ], - ], - ]; - } - - /** - * 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(string $folder, string $uptimeCheckConfig): string - { - return self::getPathTemplate('folderUptimeCheckConfig')->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(string $organization, string $uptimeCheckConfig): string - { - return self::getPathTemplate('organizationUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string - { - return self::getPathTemplate('projectUptimeCheckConfig')->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(string $project, string $uptimeCheckConfig): string - { - return self::getPathTemplate('uptimeCheckConfig')->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(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * 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 - * $apiEndpoint 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); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new Uptime check configuration. - * - * The async variant is - * {@see UptimeCheckServiceClient::createUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/create_uptime_check_config.php - * - * @param CreateUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return UptimeCheckConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function createUptimeCheckConfig(CreateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig - { - return $this->startApiCall('CreateUptimeCheckConfig', $request, $callOptions)->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. - * - * The async variant is - * {@see UptimeCheckServiceClient::deleteUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/delete_uptime_check_config.php - * - * @param DeleteUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteUptimeCheckConfig', $request, $callOptions)->wait(); - } - - /** - * Gets a single Uptime check configuration. - * - * The async variant is - * {@see UptimeCheckServiceClient::getUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/get_uptime_check_config.php - * - * @param GetUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return UptimeCheckConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function getUptimeCheckConfig(GetUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig - { - return $this->startApiCall('GetUptimeCheckConfig', $request, $callOptions)->wait(); - } - - /** - * Lists the existing valid Uptime check configurations for the project - * (leaving out any invalid configurations). - * - * The async variant is - * {@see UptimeCheckServiceClient::listUptimeCheckConfigsAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_configs.php - * - * @param ListUptimeCheckConfigsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listUptimeCheckConfigs(ListUptimeCheckConfigsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListUptimeCheckConfigs', $request, $callOptions); - } - - /** - * Returns the list of IP addresses that checkers run from - * - * The async variant is {@see UptimeCheckServiceClient::listUptimeCheckIpsAsync()} - * . - * - * @example samples/V3/UptimeCheckServiceClient/list_uptime_check_ips.php - * - * @param ListUptimeCheckIpsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listUptimeCheckIps(ListUptimeCheckIpsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListUptimeCheckIps', $request, $callOptions); - } - - /** - * 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. - * - * The async variant is - * {@see UptimeCheckServiceClient::updateUptimeCheckConfigAsync()} . - * - * @example samples/V3/UptimeCheckServiceClient/update_uptime_check_config.php - * - * @param UpdateUptimeCheckConfigRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return UptimeCheckConfig - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateUptimeCheckConfig(UpdateUptimeCheckConfigRequest $request, array $callOptions = []): UptimeCheckConfig - { - return $this->startApiCall('UpdateUptimeCheckConfig', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php deleted file mode 100644 index b21dfc9d265..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/AlertPolicyServiceGapicClient.php +++ /dev/null @@ -1,806 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\AlertPolicyServiceClient}. - */ -class AlertPolicyServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.AlertPolicyService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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 $alertPolicyConditionNameTemplate; - - private static $folderAlertPolicyNameTemplate; - - private static $folderAlertPolicyConditionNameTemplate; - - private static $organizationAlertPolicyNameTemplate; - - private static $organizationAlertPolicyConditionNameTemplate; - - private static $projectAlertPolicyNameTemplate; - - private static $projectAlertPolicyConditionNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => 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 getAlertPolicyConditionNameTemplate() - { - if (self::$alertPolicyConditionNameTemplate == null) { - self::$alertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$alertPolicyConditionNameTemplate; - } - - private static function getFolderAlertPolicyNameTemplate() - { - if (self::$folderAlertPolicyNameTemplate == null) { - self::$folderAlertPolicyNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}'); - } - - return self::$folderAlertPolicyNameTemplate; - } - - private static function getFolderAlertPolicyConditionNameTemplate() - { - if (self::$folderAlertPolicyConditionNameTemplate == null) { - self::$folderAlertPolicyConditionNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$folderAlertPolicyConditionNameTemplate; - } - - private static function getOrganizationAlertPolicyNameTemplate() - { - if (self::$organizationAlertPolicyNameTemplate == null) { - self::$organizationAlertPolicyNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}'); - } - - return self::$organizationAlertPolicyNameTemplate; - } - - private static function getOrganizationAlertPolicyConditionNameTemplate() - { - if (self::$organizationAlertPolicyConditionNameTemplate == null) { - self::$organizationAlertPolicyConditionNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$organizationAlertPolicyConditionNameTemplate; - } - - private static function getProjectAlertPolicyNameTemplate() - { - if (self::$projectAlertPolicyNameTemplate == null) { - self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); - } - - return self::$projectAlertPolicyNameTemplate; - } - - private static function getProjectAlertPolicyConditionNameTemplate() - { - if (self::$projectAlertPolicyConditionNameTemplate == null) { - self::$projectAlertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); - } - - return self::$projectAlertPolicyConditionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'alertPolicy' => self::getAlertPolicyNameTemplate(), - 'alertPolicyCondition' => self::getAlertPolicyConditionNameTemplate(), - 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), - 'folderAlertPolicyCondition' => self::getFolderAlertPolicyConditionNameTemplate(), - 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), - 'organizationAlertPolicyCondition' => self::getOrganizationAlertPolicyConditionNameTemplate(), - 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), - 'projectAlertPolicyCondition' => self::getProjectAlertPolicyConditionNameTemplate(), - ]; - } - - 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 - * alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted alert_policy_condition resource. - */ - public static function alertPolicyConditionName($project, $alertPolicy, $condition) - { - return self::getAlertPolicyConditionNameTemplate()->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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 - * folder_alert_policy_condition resource. - * - * @param string $folder - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted folder_alert_policy_condition resource. - */ - public static function folderAlertPolicyConditionName($folder, $alertPolicy, $condition) - { - return self::getFolderAlertPolicyConditionNameTemplate()->render([ - 'folder' => $folder, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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 - * organization_alert_policy_condition resource. - * - * @param string $organization - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted organization_alert_policy_condition resource. - */ - public static function organizationAlertPolicyConditionName($organization, $alertPolicy, $condition) - { - return self::getOrganizationAlertPolicyConditionNameTemplate()->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_alert_policy_condition resource. - * - * @param string $project - * @param string $alertPolicy - * @param string $condition - * - * @return string The formatted project_alert_policy_condition resource. - */ - public static function projectAlertPolicyConditionName($project, $alertPolicy, $condition) - { - return self::getProjectAlertPolicyConditionNameTemplate()->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - 'condition' => $condition, - ]); - } - - /** - * 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} - * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - folderAlertPolicyCondition: folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - organizationAlertPolicyCondition: organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - projectAlertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - * 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * 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 Metrics Scope, 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * alerting policies in a single project. This includes calls to - * CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index 04306c6bc04..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php +++ /dev/null @@ -1,752 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\GroupServiceClient}. - */ -class GroupServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.GroupService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index ca515984779..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php +++ /dev/null @@ -1,1178 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\MetricServiceClient}. - */ -class MetricServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.MetricService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - * The metric descriptor is updated if it already exists, - * except that metric labels are never removed. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * This method does not support - * [resource locations constraint of an organization - * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index 0661a3c04e3..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php +++ /dev/null @@ -1,1075 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient}. - */ -class NotificationChannelServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.NotificationChannelService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * To list the types of notification channels that are supported, use - * the `ListNotificationChannelDescriptors` method. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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. - * - * Design your application to single-thread API calls that modify the state of - * notification channels in a single project. This includes calls to - * CreateNotificationChannel, DeleteNotificationChannel and - * UpdateNotificationChannel. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index b083925f4ba..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php +++ /dev/null @@ -1,256 +0,0 @@ -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(); - * } - * ``` - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\QueryServiceClient}. - */ -class QueryServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.QueryService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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. - * - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index c7cc9a8589b..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php +++ /dev/null @@ -1,1044 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\ServiceMonitoringServiceClient}. - */ -class ServiceMonitoringServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.ServiceMonitoringService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 Metrics Scope. 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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-zA-Z0-9-_:.]+$` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 Metrics Scope. 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 Metrics Scope. - * - * 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 Metrics Scope. 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 supports - * filtering on a particular service-identifier type or one of its attributes. - * - * To filter on a particular service-identifier type, the `identifier_case` - * refers to which option in the `identifier` field is populated. For example, - * the filter `identifier_case = "CUSTOM"` would match all services with a - * value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", - * "MESH_ISTIO", and the other options listed at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * - * To filter on an attribute of a service-identifier type, apply the filter - * name by using the snake case of the service-identifier type and the - * attribute of that service-identifier type, and join the two with a period. - * For example, to filter by the `meshUid` field of the `MeshIstio` - * service-identifier type, you must filter on `mesh_istio.mesh_uid = - * "123"` to match all services with mesh UID "123". Service-identifier types - * and their attributes are described at - * https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service - * @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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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/SnoozeServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php deleted file mode 100644 index 08c130e17a0..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/SnoozeServiceGapicClient.php +++ /dev/null @@ -1,680 +0,0 @@ -workspaceName('[PROJECT]'); - * $snooze = new Snooze(); - * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); - * } finally { - * $snoozeServiceClient->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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\SnoozeServiceClient}. - */ -class SnoozeServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.SnoozeService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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 $projectNameTemplate; - - private static $projectAlertPolicyNameTemplate; - - private static $snoozeNameTemplate; - - private static $workspaceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/snooze_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/snooze_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/snooze_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/snooze_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 getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectAlertPolicyNameTemplate() - { - if (self::$projectAlertPolicyNameTemplate == null) { - self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); - } - - return self::$projectAlertPolicyNameTemplate; - } - - private static function getSnoozeNameTemplate() - { - if (self::$snoozeNameTemplate == null) { - self::$snoozeNameTemplate = new PathTemplate('projects/{project}/snoozes/{snooze}'); - } - - return self::$snoozeNameTemplate; - } - - 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 = [ - 'alertPolicy' => self::getAlertPolicyNameTemplate(), - 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), - 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), - 'snooze' => self::getSnoozeNameTemplate(), - 'workspace' => self::getWorkspaceNameTemplate(), - ]; - } - - 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 - * 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_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, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a snooze - * resource. - * - * @param string $project - * @param string $snooze - * - * @return string The formatted snooze resource. - */ - public static function snoozeName($project, $snooze) - { - return self::getSnoozeNameTemplate()->render([ - 'project' => $project, - 'snooze' => $snooze, - ]); - } - - /** - * 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 - * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - project: projects/{project} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - snooze: projects/{project}/snoozes/{snooze} - * - 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 $apiEndpoint - * 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 - * $apiEndpoint 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 `Snooze` that will prevent alerts, which match the provided - * criteria, from being opened. The `Snooze` applies for a specific time - * interval. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); - * $snooze = new Snooze(); - * $response = $snoozeServiceClient->createSnooze($formattedParent, $snooze); - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) in which - * a `Snooze` should be created. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param Snooze $snooze Required. The `Snooze` to create. Omit the `name` field, as it will be - * filled in by the API. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Snooze - * - * @throws ApiException if the remote call fails - */ - public function createSnooze($parent, $snooze, array $optionalArgs = []) - { - $request = new CreateSnoozeRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setSnooze($snooze); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateSnooze', Snooze::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a `Snooze` by `name`. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $formattedName = $snoozeServiceClient->snoozeName('[PROJECT]', '[SNOOZE]'); - * $response = $snoozeServiceClient->getSnooze($formattedName); - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The ID of the `Snooze` to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Snooze - * - * @throws ApiException if the remote call fails - */ - public function getSnooze($name, array $optionalArgs = []) - { - $request = new GetSnoozeRequest(); - $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('GetSnooze', Snooze::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the `Snooze`s associated with a project. Can optionally pass in - * `filter`, which specifies predicates to match `Snooze`s. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $formattedParent = $snoozeServiceClient->workspaceName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $snoozeServiceClient->listSnoozes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The - * [project](https://cloud.google.com/monitoring/api/v3#project_name) whose - * `Snooze`s should be listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Optional. Optional filter to restrict results to the given criteria. The - * following fields are supported. - * - * * `interval.start_time` - * * `interval.end_time` - * - * For example: - * - * ``` - * interval.start_time > "2022-03-11T00:00:00-08:00" AND - * interval.end_time < "2022-03-12T00:00:00-08:00" - * ``` - * @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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSnoozes($parent, array $optionalArgs = []) - { - $request = new ListSnoozesRequest(); - $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('ListSnoozes', $optionalArgs, ListSnoozesResponse::class, $request); - } - - /** - * Updates a `Snooze`, identified by its `name`, with the parameters in the - * given `Snooze` object. - * - * Sample code: - * ``` - * $snoozeServiceClient = new SnoozeServiceClient(); - * try { - * $snooze = new Snooze(); - * $updateMask = new FieldMask(); - * $response = $snoozeServiceClient->updateSnooze($snooze, $updateMask); - * } finally { - * $snoozeServiceClient->close(); - * } - * ``` - * - * @param Snooze $snooze Required. The `Snooze` to update. Must have the name field present. - * @param FieldMask $updateMask Required. The fields to update. - * - * For each field listed in `update_mask`: - * - * * If the `Snooze` object supplied in the `UpdateSnoozeRequest` has a - * value for that field, the value of the field in the existing `Snooze` - * will be set to the value of the field in the supplied `Snooze`. - * * If the field does not have a value in the supplied `Snooze`, the field - * in the existing `Snooze` is set to its default value. - * - * Fields not listed retain their existing value. - * - * The following are the field names that are accepted in `update_mask`: - * - * * `display_name` - * * `interval.start_time` - * * `interval.end_time` - * - * That said, the start time and end time of the `Snooze` determines which - * fields can legally be updated. Before attempting an update, users should - * consult the documentation for `UpdateSnoozeRequest`, which talks about - * which fields can be updated. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Snooze - * - * @throws ApiException if the remote call fails - */ - public function updateSnooze($snooze, $updateMask, array $optionalArgs = []) - { - $request = new UpdateSnoozeRequest(); - $requestParamHeaders = []; - $request->setSnooze($snooze); - $request->setUpdateMask($updateMask); - $requestParamHeaders['snooze.name'] = $snooze->getName(); - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateSnooze', Snooze::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 deleted file mode 100644 index 5cdb98a3e21..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php +++ /dev/null @@ -1,692 +0,0 @@ -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. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Monitoring\V3\Client\UptimeCheckServiceClient}. - */ -class UptimeCheckServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.monitoring.v3.UptimeCheckService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'monitoring.UNIVERSE_DOMAIN'; - - /** 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, - 'apiEndpoint' => 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 $apiEndpoint - * 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 - * $apiEndpoint 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 string $filter - * If provided, this field specifies the criteria that must be met by - * uptime checks to be included in the response. - * - * For more details, see [Filtering - * syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). - * @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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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['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('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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 corresponding 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 deleted file mode 100644 index c8b5d43074e..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.monitoring.v3.AlertPolicyService' => [ - 'CreateAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListAlertPolicies' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getAlertPolicies', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListAlertPoliciesResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateAlertPolicy' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\AlertPolicy', - 'headerParams' => [ - [ - 'keyName' => 'alert_policy.name', - 'fieldAccessors' => [ - 'getAlertPolicy', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'alertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', - 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', - 'folderAlertPolicyCondition' => 'folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}', - 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', - 'organizationAlertPolicyCondition' => 'organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}', - 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'projectAlertPolicyCondition' => 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}', - ], - ], - ], -]; 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 deleted file mode 100644 index bb65ee95b1d..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php +++ /dev/null @@ -1,87 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 3701e6baf28..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_client_config.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "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 deleted file mode 100644 index dba3498cf7f..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php +++ /dev/null @@ -1,123 +0,0 @@ - [ - 'google.monitoring.v3.GroupService' => [ - 'CreateGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Group', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Group', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListGroupMembers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMembers', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupMembersResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListGroups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getGroup', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListGroupsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateGroup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Group', - 'headerParams' => [ - [ - 'keyName' => 'group.name', - 'fieldAccessors' => [ - 'getGroup', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'folderGroup' => 'folders/{folder}/groups/{group}', - 'group' => 'projects/{project}/groups/{group}', - 'organizationGroup' => 'organizations/{organization}/groups/{group}', - 'projectGroup' => 'projects/{project}/groups/{group}', - ], - ], - ], -]; 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 deleted file mode 100644 index 1ec3e238ee1..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php +++ /dev/null @@ -1,98 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 37d238c0584..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_client_config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "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 deleted file mode 100644 index 7b8896801eb..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php +++ /dev/null @@ -1,174 +0,0 @@ - [ - 'google.monitoring.v3.MetricService' => [ - 'CreateMetricDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\MetricDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateServiceTimeSeries' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateTimeSeries' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteMetricDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetMetricDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\MetricDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetMonitoredResourceDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Api\MonitoredResourceDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListMetricDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetricDescriptors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListMetricDescriptorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListMonitoredResourceDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResourceDescriptors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListTimeSeries' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTimeSeries', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListTimeSeriesResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index 0367626add5..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php +++ /dev/null @@ -1,156 +0,0 @@ - [ - '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', - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 90437e7f64c..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_client_config.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "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 deleted file mode 100644 index 6088b2f89bf..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php +++ /dev/null @@ -1,175 +0,0 @@ - [ - 'google.monitoring.v3.NotificationChannelService' => [ - 'CreateNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetNotificationChannelDescriptor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannelDescriptor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetNotificationChannelVerificationCode' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListNotificationChannelDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getChannelDescriptors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListNotificationChannels' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getNotificationChannels', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListNotificationChannelsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'SendNotificationChannelVerificationCode' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'notification_channel.name', - 'fieldAccessors' => [ - 'getNotificationChannel', - 'getName', - ], - ], - ], - ], - 'VerifyNotificationChannel' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\NotificationChannel', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index 822c7ebc934..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php +++ /dev/null @@ -1,145 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index c20408d0ece..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "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 deleted file mode 100644 index 4b6dc680ebc..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php +++ /dev/null @@ -1,48 +0,0 @@ - [ - 'google.monitoring.v3.QueryService' => [ - 'QueryTimeSeries' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTimeSeriesData', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\QueryTimeSeriesResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; 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 deleted file mode 100644 index 38b688dbab5..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'google.monitoring.v3.QueryService' => [ - 'QueryTimeSeries' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}/timeSeries:query', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index daae71bdd45..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_client_config.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "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 deleted file mode 100644 index 739ca870934..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php +++ /dev/null @@ -1,176 +0,0 @@ - [ - 'google.monitoring.v3.ServiceMonitoringService' => [ - 'CreateService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Service', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Service', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListServiceLevelObjectives' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServiceLevelObjectives', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListServicesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateService' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Service', - 'headerParams' => [ - [ - 'keyName' => 'service.name', - 'fieldAccessors' => [ - 'getService', - 'getName', - ], - ], - ], - ], - 'UpdateServiceLevelObjective' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ServiceLevelObjective', - 'headerParams' => [ - [ - 'keyName' => 'service_level_objective.name', - 'fieldAccessors' => [ - 'getServiceLevelObjective', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index f7ca03dded7..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php +++ /dev/null @@ -1,145 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json deleted file mode 100644 index 0acb65e12bd..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_client_config.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "interfaces": { - "google.monitoring.v3.SnoozeService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_9_codes": [ - "UNAVAILABLE" - ], - "no_retry_7_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_9_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_7_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": { - "CreateSnooze": { - "timeout_millis": 30000, - "retry_codes_name": "no_retry_7_codes", - "retry_params_name": "no_retry_7_params" - }, - "GetSnooze": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_9_codes", - "retry_params_name": "retry_policy_9_params" - }, - "ListSnoozes": { - "timeout_millis": 30000, - "retry_codes_name": "retry_policy_9_codes", - "retry_params_name": "retry_policy_9_params" - }, - "UpdateSnooze": { - "timeout_millis": 30000, - "retry_codes_name": "no_retry_7_codes", - "retry_params_name": "no_retry_7_params" - } - } - } - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php deleted file mode 100644 index 57e5c8ab386..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_descriptor_config.php +++ /dev/null @@ -1,94 +0,0 @@ - [ - 'google.monitoring.v3.SnoozeService' => [ - 'CreateSnooze' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetSnooze' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListSnoozes' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getSnoozes', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListSnoozesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateSnooze' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\Snooze', - 'headerParams' => [ - [ - 'keyName' => 'snooze.name', - 'fieldAccessors' => [ - 'getSnooze', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'alertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'folderAlertPolicy' => 'folders/{folder}/alertPolicies/{alert_policy}', - 'organizationAlertPolicy' => 'organizations/{organization}/alertPolicies/{alert_policy}', - 'project' => 'projects/{project}', - 'projectAlertPolicy' => 'projects/{project}/alertPolicies/{alert_policy}', - 'snooze' => 'projects/{project}/snoozes/{snooze}', - 'workspace' => 'projects/{project}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php deleted file mode 100644 index a3b5e3574b8..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/snooze_service_rest_client_config.php +++ /dev/null @@ -1,79 +0,0 @@ - [ - 'google.monitoring.v3.SnoozeService' => [ - 'CreateSnooze' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', - 'body' => 'snooze', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetSnooze' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*/snoozes/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListSnoozes' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{parent=projects/*}/snoozes', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateSnooze' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{snooze.name=projects/*/snoozes/*}', - 'body' => 'snooze', - 'placeholders' => [ - 'snooze.name' => [ - 'getters' => [ - 'getSnooze', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - ], - 'numericEnums' => true, -]; 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 deleted file mode 100644 index 4e19af23389..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_client_config.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "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 deleted file mode 100644 index a9dbc7aa781..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php +++ /dev/null @@ -1,115 +0,0 @@ - [ - 'google.monitoring.v3.UptimeCheckService' => [ - 'CreateUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListUptimeCheckConfigs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUptimeCheckConfigs', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListUptimeCheckIps' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUptimeCheckIps', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\ListUptimeCheckIpsResponse', - ], - 'UpdateUptimeCheckConfig' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Monitoring\V3\UptimeCheckConfig', - 'headerParams' => [ - [ - 'keyName' => 'uptime_check_config.name', - 'fieldAccessors' => [ - 'getUptimeCheckConfig', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - '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}', - ], - ], - ], -]; 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 deleted file mode 100644 index 4c50c3cd46b..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php +++ /dev/null @@ -1,91 +0,0 @@ - [ - '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', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php deleted file mode 100644 index 9811f18bd6f..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php +++ /dev/null @@ -1,380 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createAlertPolicy($name, $alertPolicy); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - try { - $gapicClient->deleteAlertPolicy($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - try { - $gapicClient->getAlertPolicy($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listAlertPolicies($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateAlertPolicy($alertPolicy); - // If the $gapicClient 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/Client/AlertPolicyServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php deleted file mode 100644 index 498d9a5be07..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/AlertPolicyServiceClientTest.php +++ /dev/null @@ -1,442 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateAlertPolicyRequest()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - $response = $gapicClient->createAlertPolicy($request); - $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(); - $gapicClient = $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(); - $request = (new CreateAlertPolicyRequest()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - try { - $gapicClient->createAlertPolicy($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new DeleteAlertPolicyRequest()) - ->setName($formattedName); - $gapicClient->deleteAlertPolicy($request); - $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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new DeleteAlertPolicyRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteAlertPolicy($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new GetAlertPolicyRequest()) - ->setName($formattedName); - $response = $gapicClient->getAlertPolicy($request); - $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(); - $gapicClient = $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 = $gapicClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $request = (new GetAlertPolicyRequest()) - ->setName($formattedName); - try { - $gapicClient->getAlertPolicy($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListAlertPoliciesRequest()) - ->setName($name); - $response = $gapicClient->listAlertPolicies($request); - $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(); - $gapicClient = $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'; - $request = (new ListAlertPoliciesRequest()) - ->setName($name); - try { - $gapicClient->listAlertPolicies($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateAlertPolicyRequest()) - ->setAlertPolicy($alertPolicy); - $response = $gapicClient->updateAlertPolicy($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateAlertPolicyRequest()) - ->setAlertPolicy($alertPolicy); - try { - $gapicClient->updateAlertPolicy($request); - // If the $gapicClient 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 createAlertPolicyAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateAlertPolicyRequest()) - ->setName($name) - ->setAlertPolicy($alertPolicy); - $response = $gapicClient->createAlertPolicyAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php deleted file mode 100644 index 5e7c3024f3a..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/GroupServiceClientTest.php +++ /dev/null @@ -1,541 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateGroupRequest()) - ->setName($name) - ->setGroup($group); - $response = $gapicClient->createGroup($request); - $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(); - $gapicClient = $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(); - $request = (new CreateGroupRequest()) - ->setName($name) - ->setGroup($group); - try { - $gapicClient->createGroup($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new DeleteGroupRequest()) - ->setName($formattedName); - $gapicClient->deleteGroup($request); - $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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new DeleteGroupRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteGroup($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new GetGroupRequest()) - ->setName($formattedName); - $response = $gapicClient->getGroup($request); - $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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new GetGroupRequest()) - ->setName($formattedName); - try { - $gapicClient->getGroup($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new ListGroupMembersRequest()) - ->setName($formattedName); - $response = $gapicClient->listGroupMembers($request); - $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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $request = (new ListGroupMembersRequest()) - ->setName($formattedName); - try { - $gapicClient->listGroupMembers($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListGroupsRequest()) - ->setName($name); - $response = $gapicClient->listGroups($request); - $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(); - $gapicClient = $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'; - $request = (new ListGroupsRequest()) - ->setName($name); - try { - $gapicClient->listGroups($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateGroupRequest()) - ->setGroup($group); - $response = $gapicClient->updateGroup($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateGroupRequest()) - ->setGroup($group); - try { - $gapicClient->updateGroup($request); - // If the $gapicClient 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 createGroupAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateGroupRequest()) - ->setName($name) - ->setGroup($group); - $response = $gapicClient->createGroupAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php deleted file mode 100644 index 8a38d03c86b..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/MetricServiceClientTest.php +++ /dev/null @@ -1,769 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateMetricDescriptorRequest()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - $response = $gapicClient->createMetricDescriptor($request); - $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(); - $gapicClient = $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(); - $request = (new CreateMetricDescriptorRequest()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - try { - $gapicClient->createMetricDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - $gapicClient->createServiceTimeSeries($request); - $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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - try { - $gapicClient->createServiceTimeSeries($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - $gapicClient->createTimeSeries($request); - $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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $request = (new CreateTimeSeriesRequest()) - ->setName($formattedName) - ->setTimeSeries($timeSeries); - try { - $gapicClient->createTimeSeries($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new DeleteMetricDescriptorRequest()) - ->setName($formattedName); - $gapicClient->deleteMetricDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new DeleteMetricDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteMetricDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new GetMetricDescriptorRequest()) - ->setName($formattedName); - $response = $gapicClient->getMetricDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $request = (new GetMetricDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->getMetricDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - $request = (new GetMonitoredResourceDescriptorRequest()) - ->setName($formattedName); - $response = $gapicClient->getMonitoredResourceDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - $request = (new GetMonitoredResourceDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->getMonitoredResourceDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListMetricDescriptorsRequest()) - ->setName($name); - $response = $gapicClient->listMetricDescriptors($request); - $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(); - $gapicClient = $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'; - $request = (new ListMetricDescriptorsRequest()) - ->setName($name); - try { - $gapicClient->listMetricDescriptors($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListMonitoredResourceDescriptorsRequest()) - ->setName($name); - $response = $gapicClient->listMonitoredResourceDescriptors($request); - $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(); - $gapicClient = $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'; - $request = (new ListMonitoredResourceDescriptorsRequest()) - ->setName($name); - try { - $gapicClient->listMonitoredResourceDescriptors($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - $request = (new ListTimeSeriesRequest()) - ->setName($formattedName) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - $response = $gapicClient->listTimeSeries($request); - $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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - $request = (new ListTimeSeriesRequest()) - ->setName($formattedName) - ->setFilter($filter) - ->setInterval($interval) - ->setView($view); - try { - $gapicClient->listTimeSeries($request); - // If the $gapicClient 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 createMetricDescriptorAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateMetricDescriptorRequest()) - ->setName($name) - ->setMetricDescriptor($metricDescriptor); - $response = $gapicClient->createMetricDescriptorAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php deleted file mode 100644 index 7a0e8fd53b0..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/NotificationChannelServiceClientTest.php +++ /dev/null @@ -1,809 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateNotificationChannelRequest()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - $response = $gapicClient->createNotificationChannel($request); - $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(); - $gapicClient = $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(); - $request = (new CreateNotificationChannelRequest()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - try { - $gapicClient->createNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new DeleteNotificationChannelRequest()) - ->setName($formattedName); - $gapicClient->deleteNotificationChannel($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new DeleteNotificationChannelRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelRequest()) - ->setName($formattedName); - $response = $gapicClient->getNotificationChannel($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelRequest()) - ->setName($formattedName); - try { - $gapicClient->getNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - $request = (new GetNotificationChannelDescriptorRequest()) - ->setName($formattedName); - $response = $gapicClient->getNotificationChannelDescriptor($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - $request = (new GetNotificationChannelDescriptorRequest()) - ->setName($formattedName); - try { - $gapicClient->getNotificationChannelDescriptor($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $code = 'code3059181'; - $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); - $expectedResponse->setCode($code); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - $response = $gapicClient->getNotificationChannelVerificationCode($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new GetNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - try { - $gapicClient->getNotificationChannelVerificationCode($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelDescriptorsRequest()) - ->setName($name); - $response = $gapicClient->listNotificationChannelDescriptors($request); - $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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelDescriptorsRequest()) - ->setName($name); - try { - $gapicClient->listNotificationChannelDescriptors($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelsRequest()) - ->setName($name); - $response = $gapicClient->listNotificationChannels($request); - $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(); - $gapicClient = $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'; - $request = (new ListNotificationChannelsRequest()) - ->setName($name); - try { - $gapicClient->listNotificationChannels($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new SendNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - $gapicClient->sendNotificationChannelVerificationCode($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $request = (new SendNotificationChannelVerificationCodeRequest()) - ->setName($formattedName); - try { - $gapicClient->sendNotificationChannelVerificationCode($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateNotificationChannelRequest()) - ->setNotificationChannel($notificationChannel); - $response = $gapicClient->updateNotificationChannel($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateNotificationChannelRequest()) - ->setNotificationChannel($notificationChannel); - try { - $gapicClient->updateNotificationChannel($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - $request = (new VerifyNotificationChannelRequest()) - ->setName($formattedName) - ->setCode($code); - $response = $gapicClient->verifyNotificationChannel($request); - $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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - $request = (new VerifyNotificationChannelRequest()) - ->setName($formattedName) - ->setCode($code); - try { - $gapicClient->verifyNotificationChannel($request); - // If the $gapicClient 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 createNotificationChannelAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateNotificationChannelRequest()) - ->setName($name) - ->setNotificationChannel($notificationChannel); - $response = $gapicClient->createNotificationChannelAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php deleted file mode 100644 index cd32140b2e9..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/QueryServiceClientTest.php +++ /dev/null @@ -1,182 +0,0 @@ -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(); - $gapicClient = $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'; - $request = (new QueryTimeSeriesRequest()) - ->setName($name) - ->setQuery($query); - $response = $gapicClient->queryTimeSeries($request); - $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(); - $gapicClient = $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'; - $request = (new QueryTimeSeriesRequest()) - ->setName($name) - ->setQuery($query); - try { - $gapicClient->queryTimeSeries($request); - // If the $gapicClient 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 queryTimeSeriesAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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'; - $request = (new QueryTimeSeriesRequest()) - ->setName($name) - ->setQuery($query); - $response = $gapicClient->queryTimeSeriesAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php deleted file mode 100644 index d679066683c..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/ServiceMonitoringServiceClientTest.php +++ /dev/null @@ -1,790 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateServiceRequest()) - ->setParent($parent) - ->setService($service); - $response = $gapicClient->createService($request); - $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(); - $gapicClient = $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(); - $request = (new CreateServiceRequest()) - ->setParent($parent) - ->setService($service); - try { - $gapicClient->createService($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - $request = (new CreateServiceLevelObjectiveRequest()) - ->setParent($formattedParent) - ->setServiceLevelObjective($serviceLevelObjective); - $response = $gapicClient->createServiceLevelObjective($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - $request = (new CreateServiceLevelObjectiveRequest()) - ->setParent($formattedParent) - ->setServiceLevelObjective($serviceLevelObjective); - try { - $gapicClient->createServiceLevelObjective($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - $gapicClient->deleteService($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new DeleteServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteService($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new DeleteServiceLevelObjectiveRequest()) - ->setName($formattedName); - $gapicClient->deleteServiceLevelObjective($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new DeleteServiceLevelObjectiveRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteServiceLevelObjective($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - $response = $gapicClient->getService($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new GetServiceRequest()) - ->setName($formattedName); - try { - $gapicClient->getService($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new GetServiceLevelObjectiveRequest()) - ->setName($formattedName); - $response = $gapicClient->getServiceLevelObjective($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $request = (new GetServiceLevelObjectiveRequest()) - ->setName($formattedName); - try { - $gapicClient->getServiceLevelObjective($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new ListServiceLevelObjectivesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listServiceLevelObjectives($request); - $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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $request = (new ListServiceLevelObjectivesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listServiceLevelObjectives($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListServicesRequest()) - ->setParent($parent); - $response = $gapicClient->listServices($request); - $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(); - $gapicClient = $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'; - $request = (new ListServicesRequest()) - ->setParent($parent); - try { - $gapicClient->listServices($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateServiceRequest()) - ->setService($service); - $response = $gapicClient->updateService($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateServiceRequest()) - ->setService($service); - try { - $gapicClient->updateService($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateServiceLevelObjectiveRequest()) - ->setServiceLevelObjective($serviceLevelObjective); - $response = $gapicClient->updateServiceLevelObjective($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateServiceLevelObjectiveRequest()) - ->setServiceLevelObjective($serviceLevelObjective); - try { - $gapicClient->updateServiceLevelObjective($request); - // If the $gapicClient 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 createServiceAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateServiceRequest()) - ->setParent($parent) - ->setService($service); - $response = $gapicClient->createServiceAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php deleted file mode 100644 index 5eb2436b612..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/SnoozeServiceClientTest.php +++ /dev/null @@ -1,426 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SnoozeServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SnoozeServiceClient($options); - } - - /** @test */ - public function createSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - $response = $gapicClient->createSnooze($request); - $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.SnoozeService/CreateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - try { - $gapicClient->createSnooze($request); - // If the $gapicClient 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 getSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - $request = (new GetSnoozeRequest()) - ->setName($formattedName); - $response = $gapicClient->getSnooze($request); - $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.SnoozeService/GetSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - $request = (new GetSnoozeRequest()) - ->setName($formattedName); - try { - $gapicClient->getSnooze($request); - // If the $gapicClient 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 listSnoozesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $snoozesElement = new Snooze(); - $snoozes = [ - $snoozesElement, - ]; - $expectedResponse = new ListSnoozesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSnoozes($snoozes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $request = (new ListSnoozesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listSnoozes($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnoozesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $request = (new ListSnoozesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listSnoozes($request); - // If the $gapicClient 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 updateSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $request = (new UpdateSnoozeRequest()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateSnooze($request); - $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.SnoozeService/UpdateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $request = (new UpdateSnoozeRequest()) - ->setSnooze($snooze) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateSnooze($request); - // If the $gapicClient 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 createSnoozeAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $request = (new CreateSnoozeRequest()) - ->setParent($formattedParent) - ->setSnooze($snooze); - $response = $gapicClient->createSnoozeAsync($request)->wait(); - $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.SnoozeService/CreateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php deleted file mode 100644 index 8b1fc5ae653..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/Client/UptimeCheckServiceClientTest.php +++ /dev/null @@ -1,517 +0,0 @@ -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(); - $gapicClient = $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(); - $request = (new CreateUptimeCheckConfigRequest()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - $response = $gapicClient->createUptimeCheckConfig($request); - $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(); - $gapicClient = $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(); - $request = (new CreateUptimeCheckConfigRequest()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - try { - $gapicClient->createUptimeCheckConfig($request); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new DeleteUptimeCheckConfigRequest()) - ->setName($formattedName); - $gapicClient->deleteUptimeCheckConfig($request); - $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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new DeleteUptimeCheckConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteUptimeCheckConfig($request); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new GetUptimeCheckConfigRequest()) - ->setName($formattedName); - $response = $gapicClient->getUptimeCheckConfig($request); - $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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $request = (new GetUptimeCheckConfigRequest()) - ->setName($formattedName); - try { - $gapicClient->getUptimeCheckConfig($request); - // If the $gapicClient 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(); - $gapicClient = $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'; - $request = (new ListUptimeCheckConfigsRequest()) - ->setParent($parent); - $response = $gapicClient->listUptimeCheckConfigs($request); - $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(); - $gapicClient = $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'; - $request = (new ListUptimeCheckConfigsRequest()) - ->setParent($parent); - try { - $gapicClient->listUptimeCheckConfigs($request); - // If the $gapicClient 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(); - $gapicClient = $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); - $request = new ListUptimeCheckIpsRequest(); - $response = $gapicClient->listUptimeCheckIps($request); - $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(); - $gapicClient = $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); - $request = new ListUptimeCheckIpsRequest(); - try { - $gapicClient->listUptimeCheckIps($request); - // If the $gapicClient 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(); - $gapicClient = $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(); - $request = (new UpdateUptimeCheckConfigRequest()) - ->setUptimeCheckConfig($uptimeCheckConfig); - $response = $gapicClient->updateUptimeCheckConfig($request); - $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(); - $gapicClient = $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(); - $request = (new UpdateUptimeCheckConfigRequest()) - ->setUptimeCheckConfig($uptimeCheckConfig); - try { - $gapicClient->updateUptimeCheckConfig($request); - // If the $gapicClient 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 createUptimeCheckConfigAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $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(); - $request = (new CreateUptimeCheckConfigRequest()) - ->setParent($parent) - ->setUptimeCheckConfig($uptimeCheckConfig); - $response = $gapicClient->createUptimeCheckConfigAsync($request)->wait(); - $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()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php deleted file mode 100644 index 6ac70404aed..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php +++ /dev/null @@ -1,468 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createGroup($name, $group); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - try { - $gapicClient->deleteGroup($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - try { - $gapicClient->getGroup($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->groupName('[PROJECT]', '[GROUP]'); - try { - $gapicClient->listGroupMembers($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listGroups($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateGroup($group); - // If the $gapicClient 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 deleted file mode 100644 index 443a3f9faf1..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php +++ /dev/null @@ -1,672 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createMetricDescriptor($name, $metricDescriptor); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - try { - $gapicClient->createServiceTimeSeries($formattedName, $timeSeries); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->projectName('[PROJECT]'); - $timeSeries = []; - try { - $gapicClient->createTimeSeries($formattedName, $timeSeries); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - try { - $gapicClient->deleteMetricDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - try { - $gapicClient->getMetricDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - try { - $gapicClient->getMonitoredResourceDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listMetricDescriptors($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listMonitoredResourceDescriptors($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - try { - $gapicClient->listTimeSeries($formattedName, $filter, $interval, $view); - // If the $gapicClient 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 deleted file mode 100644 index 9b115e17697..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php +++ /dev/null @@ -1,716 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createNotificationChannel($name, $notificationChannel); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->deleteNotificationChannel($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->getNotificationChannel($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - try { - $gapicClient->getNotificationChannelDescriptor($formattedName); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $code = 'code3059181'; - $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); - $expectedResponse->setCode($code); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->getNotificationChannelVerificationCode($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listNotificationChannelDescriptors($name); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listNotificationChannels($name); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $gapicClient->sendNotificationChannelVerificationCode($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateNotificationChannel($notificationChannel); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - try { - $gapicClient->verifyNotificationChannel($formattedName, $code); - // If the $gapicClient 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 deleted file mode 100644 index c64caa89013..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php +++ /dev/null @@ -1,134 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->queryTimeSeries($name, $query); - // If the $gapicClient 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 deleted file mode 100644 index 7651f7245bc..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php +++ /dev/null @@ -1,701 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createService($parent, $service); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - try { - $gapicClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - try { - $gapicClient->deleteService($formattedName); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - try { - $gapicClient->deleteServiceLevelObjective($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - try { - $gapicClient->getService($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - try { - $gapicClient->getServiceLevelObjective($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->serviceName('[PROJECT]', '[SERVICE]'); - try { - $gapicClient->listServiceLevelObjectives($formattedParent); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listServices($parent); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateService($service); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateServiceLevelObjective($serviceLevelObjective); - // If the $gapicClient 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/SnoozeServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php deleted file mode 100644 index 653db774900..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/SnoozeServiceClientTest.php +++ /dev/null @@ -1,359 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SnoozeServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SnoozeServiceClient($options); - } - - /** @test */ - public function createSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $response = $gapicClient->createSnooze($formattedParent, $snooze); - $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.SnoozeService/CreateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - try { - $gapicClient->createSnooze($formattedParent, $snooze); - // If the $gapicClient 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 getSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - $response = $gapicClient->getSnooze($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.SnoozeService/GetSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->snoozeName('[PROJECT]', '[SNOOZE]'); - try { - $gapicClient->getSnooze($formattedName); - // If the $gapicClient 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 listSnoozesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $snoozesElement = new Snooze(); - $snoozes = [ - $snoozesElement, - ]; - $expectedResponse = new ListSnoozesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setSnoozes($snoozes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workspaceName('[PROJECT]'); - $response = $gapicClient->listSnoozes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getSnoozes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.SnoozeService/ListSnoozes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnoozesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 = $gapicClient->workspaceName('[PROJECT]'); - try { - $gapicClient->listSnoozes($formattedParent); - // If the $gapicClient 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 updateSnoozeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Snooze(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - $response = $gapicClient->updateSnooze($snooze, $updateMask); - $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.SnoozeService/UpdateSnooze', $actualFuncCall); - $actualValue = $actualRequestObject->getSnooze(); - $this->assertProtobufEquals($snooze, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateSnoozeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $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 - $snooze = new Snooze(); - $snoozeName = 'snoozeName1119820177'; - $snooze->setName($snoozeName); - $snoozeCriteria = new Criteria(); - $snooze->setCriteria($snoozeCriteria); - $snoozeInterval = new TimeInterval(); - $snooze->setInterval($snoozeInterval); - $snoozeDisplayName = 'snoozeDisplayName-1956223833'; - $snooze->setDisplayName($snoozeDisplayName); - $updateMask = new FieldMask(); - try { - $gapicClient->updateSnooze($snooze, $updateMask); - // If the $gapicClient 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 deleted file mode 100644 index 40d14acd439..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php +++ /dev/null @@ -1,450 +0,0 @@ -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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->createUptimeCheckConfig($parent, $uptimeCheckConfig); - // If the $gapicClient 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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $gapicClient->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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $gapicClient->deleteUptimeCheckConfig($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $response = $gapicClient->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(); - $gapicClient = $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 = $gapicClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $gapicClient->getUptimeCheckConfig($formattedName); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listUptimeCheckConfigs($parent); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->listUptimeCheckIps(); - // If the $gapicClient 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(); - $gapicClient = $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 = $gapicClient->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(); - $gapicClient = $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 { - $gapicClient->updateUptimeCheckConfig($uptimeCheckConfig); - // If the $gapicClient 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()); - } -}